dylex / slack-libpurple

Slack module for libpurple
GNU General Public License v2.0
280 stars 38 forks source link

Group typing notifications #65

Closed EionRobb closed 3 years ago

EionRobb commented 6 years ago

There's currently a TODO in the slack-message.c code for slack_user_typing that says "nothing seems to use [purple_conv_chat_user_set_flags]".

The typing flag is used by the https://github.com/EionRobb/pidgin-groupchat-typing-notifications plugin, as well as other UI's such as Adium

dylex commented 6 years ago

I presume I need to clear the PURPLE_CBFLAGS_TYPING flag again manually? Slack only sends a typing indicator once every 3 seconds, so i can set it, and (re)set a timer to clear it.

dylex commented 6 years ago

Though that's a little complicated because I need to keep track of the timeout state per-user/chat combination. I guess I can use a PurpleConvChatBuddy attribute.

EionRobb commented 6 years ago

Unfortunately the timeout is needed, yes. The PurpleConvChatBuddy doesn't store which PurpleConvChat it's associated with, however, so a different data structure might be needed (or cheating with a g_dataset_set() to attach the PurpleConvChat to the buddy object)

EionRobb commented 6 years ago

Tangentially, I have noticed that there's a flicker that happens between the typing events. Is it worth considering changing the serv_got_typing timeout value from 3 to 5 to allow the server to send another typing event (if it's going to) without causing a UI flicker?

dylex commented 6 years ago

My best idea so far is a list of currently typing chat, user, time_t and a global timeout task that runs whenever it's non empty to clear those that age out. Leaving this for now in case a better idea comes up.

I'm assuming in libpurple3 this will be easier if everything is a gobject because you could keep references to purple objects yourself. It would also be nice if purple_timeout handles were associated with accounts like fetch and such can be, so the prpl doesn't need to keep track of them all to cancel them on close.

krokodilerian commented 5 years ago

Does this issue include sending typing notification to group chats (which seems to be missing), or should I open a separate issue?

dylex commented 5 years ago

libpurple doesn't send typing events for group chats, that I can tell, so it would have to be added there first.

EionRobb commented 5 years ago

The pidgin-groupchat-typing-notifications plugin sends typing events for group chats

dylex commented 3 years ago

I think this is all done now, for IMs and channels.

EionRobb commented 3 years ago

Yup it is thanks. I think the timing values aren't quite right, but this particular issue is good enough to close :)