Opened 10 years ago

Last modified 8 years ago

#9668 new patch

Add an away flag for chat buddies

Reported by: thomas001 Owned by:
Milestone: Patches Needing Improvement Component: pidgin (gtk)
Version: 2.5.8 Keywords:
Cc:

Description

Some protocols broadcast the presence status (like away) of a user to all users that are in a chat room with the user. This information should somehow be registered by libpurple and presented to the user by pidgin (and/or other clients).

I added a new flag PURPLE_CBFLAG_AWAY and made away users display in italics in a chat's user list. This should not break any ABI or other libpurple users. There may be minor problems with the addition of a new flag. Pidgin sorts the users by directly comparing the buddy flag,this breaks because the new flag is the highest valued (assuming you do not want to show away buddies first).

Another problem is if buddy status should be forwarded to chats by pidgin or if the protocol plugin should set all the chat flags for the user. IMO the second one is better as a protocol may support custom chat presence states.

Attachments (1)

pidgin-away-2.diff (6.2 KB) - added by thomas001 10 years ago.
patch for pidgin 2.5.8

Download all attachments as: .zip

Change History (5)

Changed 10 years ago by thomas001

patch for pidgin 2.5.8

comment:1 Changed 10 years ago by darkrain42

  • Milestone set to Patches Needing Review
  • Type changed from enhancement to patch

Zac also made similar (but different? and not including the pidgin parts) changes in im.pidgin.adium.

comment:2 Changed 10 years ago by darkrain42

  • Component changed from unclassified to pidgin (gtk)
  • Milestone changed from Patches Needing Review to Patches Needing Improvement
  • Owner rekkanoryo deleted

This patch doesn't apply against 2.6.0devel. Additionally, it only works when the buddies are on the buddy list, whereas the code I've applied from Zac's work in im.pidgin.adium has the protocol plugins setting PURPLE_CBFLAGS_AWAY which allows the protocols to handle it even when we don't necessarily have the buddy on the list (for instance, XMPP always receives presence updates for chat buddies, but doesn't, I believe, transmit that information to the core. It could quite easily set this flag). (This is also an issue with the code in gtkconv.c), a PurpleBuddy?'s name is not necessarily going to match up with a PurpleConvChatBuddy?'s name (again, XMPP is the example). The prpl_info->get_cb_real_name function, if it exists and returns not NULL, will

The changes I'm referring to from Zac are in 8b61c7377aa6cc0a70bad84c90cac96a45ddd45e.

I don't think italicizing the names is the appropriate way to indicate away-ness (as a side-note, I also didn't know that names would bold. In Pidgin 2.6.0, names in the scrollback area will be italicized to indicate a user has left the chat and this might be too similar. Perhaps it would be possible to only display the status on a tooltip or replace the current owner/op/half-op/voice emblems with status baubles from the buddy list as a second column (or the only column and move the emblems to a tooltip (or some other representation). (or perhaps italicized would work. I don't know)

comment:3 follow-up: Changed 10 years ago by thomas001

I looked at Zacs patch the purple part simply does the same as my patch,it just defines the new flag, the rest of the patch seems to introduce some kind of custom attributes system which is unrelated to the away flag. No the flag is not just for buddies,it works for every chat user where the prpl plugin sets the flag. the additional function buddy_status_cb is meant for the case when a buddy is in some chat with you and is known to be away and the prpl does not set the away flag,because in this case you know the chat user is away without the flag. Currently this function is *not* hooked in and is unused,i left it in the patch for discussion if this behaviour is desired or if pidgin just reply totally on the away flag (which is the better version IMO). I did not know italics were "reserved",of cause other visualisation of the away status is fine too,but i think a tooltip is not a good idea,as a user list should give you a quick and complete overview of the chat buddies, which is not the case if you have to open up a tooltip for every chat buddy. an additional symbol whould be fine,too.

comment:4 in reply to: ↑ 3 Changed 10 years ago by darkrain42

Replying to thomas001:

I looked at Zacs patch the purple part simply does the same as my patch,it just defines the new flag, the rest of the patch seems to introduce some kind of custom attributes system which is unrelated to the away flag. No the flag is not just for buddies,it works for every chat user where the prpl plugin sets the flag. the additional function buddy_status_cb is meant for the case when a buddy is in some chat with you and is known to be away and the prpl does not set the away flag,because in this case you know the chat user is away without the flag. Currently this function is *not* hooked in and is unused,i left it in the patch for discussion if this behaviour is desired or if pidgin just reply totally on the away flag (which is the better version IMO).

I think I'd personally prefer pidgin relies on prpls to set it, but that might not be reasonable in all cases (it requires the prpls to correlate them). If the code is to be hooked in, it does need to use prpl_info->get_cb_real_name (if the function is defined), though.

I did not know italics were "reserved",

I wouldn't characterize it as reserved. I'm just commenting that new functionality has been introduced in 2.6.0 to use italics on nicknames in the scrollback area for a different meaning, and I'm unsure if italicized names would be the best way to convey this information. Another possibility is to fade the icon (or remove the color). These indicate idleness (and offline) respectively when used in the buddy list, but either might be close enough to convey the meaning?

of cause other visualisation of the away status is fine too,but i think a tooltip is not a good idea,as a user list should give you a quick and complete overview of the chat buddies, which is not the case if you have to open up a tooltip for every chat buddy.

Yes, I agree.

an additional symbol whould be fine,too.

Note: See TracTickets for help on using tickets.
All information, including names and email addresses, entered onto this website or sent to mailing lists affiliated with this website will be public. Do not post confidential information, especially passwords!