How to handle persistent chat rooms / conversations

David Woodhouse dwmw2 at infradead.org
Sat Jun 24 12:46:22 EDT 2017


I'm working on a new prpl for a protocol where conversations are
persistent — all the historical messages are available.

For chat rooms, I've handled this by fetching all old messages when the
room is joined. The first time, I fetch everything; then I remember the
latest message (using purple_account_set_string(…"last-msg-$roomid"…)
and subsequent joins will only fetch the messages since then.

This isn't perfect, but it seems to work OK. Anyone got better
suggestions? Is there a way to mark chats as persistent from the back
end, rather than just in the UI? That would help.

It gets slightly more complex when I get to other "conversations" in
this protocol. Those are mostly two-party conversations which are
basically IM, but there are also multi-party conversations.

The simplest conversation has two parties, and should basically be
represented as IM. But how do I "insert" the history when the account
is first opened, including both incoming and outgoing messages? Is
there a way to get those to be represented as 'chat' conversations in
Pidgin? I could automatically call serv_got_joined_chat() for incoming
messages and even on outgoing... but the normal IM window would still
exist. Any other ideas? 

Then there's multi-party conversations, which I suppose will need to be
handled as chat conversations — will I need to do my own UI actions to
allow for creating, listing and joining those? 



-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/x-pkcs7-signature
Size: 4938 bytes
Desc: not available
URL: <https://pidgin.im/pipermail/devel/attachments/20170624/7c3f7394/attachment.bin>


More information about the Devel mailing list