If you alias a channel in pidgin, "Get history" returns nothing. But it works again after re-aliasing back to the original channel name. This is the case for regular channels and MPDM group chats, but not single-recipient DMs.
Turns out that for chats (channels & MPDM), PURPLE_BLIST_NODE_NAME() and purple_chat_get_name() actually return the alias for the chat (the pidgin alias, that is), rather than the real chat name.
(Presumably this is because PurpleBuddy has name & alias members, but PurpleChat only has an alias. The real chat name is under components.)
The result is, the channel alias is used to do the lookup against channel_names, which contains the real names. This lookup fails if the alias is different than the real channel name. (Or perhaps even succeeds for the wrong channel if aliased that way.)
Anyway, fix this by grabbing the real name for chats from components in the callback function.
Also go ahead and fix the name in get_history_prompt for chats, for a consistent display. That is, so that @user and #channel both display the real (slack) names rather than (pidgin) aliases.
If you alias a channel in pidgin, "Get history" returns nothing. But it works again after re-aliasing back to the original channel name. This is the case for regular channels and MPDM group chats, but not single-recipient DMs.
Turns out that for chats (channels & MPDM),
PURPLE_BLIST_NODE_NAME()
andpurple_chat_get_name()
actually return the alias for the chat (the pidgin alias, that is), rather than the real chat name.(Presumably this is because
PurpleBuddy
hasname
&alias
members, butPurpleChat
only has analias
. The real chat name is undercomponents
.)The result is, the channel alias is used to do the lookup against
channel_names
, which contains the real names. This lookup fails if the alias is different than the real channel name. (Or perhaps even succeeds for the wrong channel if aliased that way.)Anyway, fix this by grabbing the real name for chats from
components
in the callback function.Also go ahead and fix the
name
inget_history_prompt
for chats, for a consistent display. That is, so that@user
and#channel
both display the real (slack) names rather than (pidgin) aliases.