Tue, 18 Feb 2025 23:31:14 -0600
IRCv3: Return an error when trying to join multiple channels at once
IRCv3 allows you to put names in like `#channel1,#channel2` which works in
Pidgin 2 and other clients, but the
`Purple.ProtocolConversations.join_channel_async` function really only works for
a single channel and the channel join dialog was meant for a single channel.
So this solution isn't ideal, but it's better than creating a conversation
named `#channel1,#channel2` at least for the time being.
Testing Done:
Attempted to join `#channel1,#channel2` and instead got the error message.
Bugs closed: PIDGIN-18044
Reviewed at https://reviews.imfreedom.org/r/3841/
| protocols/ircv3/purpleircv3protocolconversation.c | file | annotate | diff | comparison | revisions |
--- a/protocols/ircv3/purpleircv3protocolconversation.c Tue Feb 18 23:28:19 2025 -0600 +++ b/protocols/ircv3/purpleircv3protocolconversation.c Tue Feb 18 23:31:14 2025 -0600 @@ -135,8 +135,16 @@ /* TODO: check that name match the ISUPPORT channel prefixes. */ name = purple_channel_join_details_get_name(details); if(purple_strempty(name)) { - g_task_return_new_error(task, PURPLE_IRCV3_DOMAIN, 0, - "channel name is empty"); + g_task_return_new_error_literal(task, PURPLE_IRCV3_DOMAIN, 0, + _("channel name is empty")); + g_clear_object(&task); + + return; + } + + if(strchr(name, ',') != NULL) { + g_task_return_new_error_literal(task, PURPLE_IRCV3_DOMAIN, 0, + _("only one channel may be joined at a time")); g_clear_object(&task); return;