GObjectified Conversations

Sadrul Habib Chowdhury imadil at gmail.com
Wed Jul 21 23:28:41 EDT 2010


* Richard Laager had this to say on [21 Jul 2010, 21:59:35 -0500]:
> On Wed, 2010-07-21 at 18:01 -0400, sadrul at pidgin.im wrote:
> > PurpleIM is for 1-1 conversations, and PurpleMUC for multi-user
> > conversations.
> 
> Is it necessary to make this distinction?
> 
> It seems to me that this complicates the situation with MSN, where you
> can add a third user to a one-on-one conversation at any time. Assuming
> this is still possible with the MSN protocol, how are we going to handle
> that transition?
> 
> If we can avoid this distinction in libpurple, we can leave the UI
> decisions to the UI. On the flip side, though, I don't think we want the
> UI to represent an IRC/Jabber/etc. room with two users the same way it
> represents a one-on-one AIM conversation.

This is one of the primary reasons I think we should maintain the
distinction between IM and MUC. A few of us discussed this a bit in
devel at cpi a couple of days back, and a few of us agreed that the UI will
need some help from libpurple to decide whether a conversation with
one/two users is a MUC or an IM.

> So, perhaps we'll just need a defined way to switch between the two
> types? Even so, do we need different objects, or just a bit that flags
> what type it is currently?

We can do that even now, since we maintain the message history in a
PurpleConversation. So we would do something like this:

  PurpleConversation *convert_im_into_muc(PurpleConversation *im)
  {
    PurpleConversation *muc =
      purple_conversation_new(TYPE_CHAT, im->account, im->name);
    GList *iter;
    for (iter = im->message_history; iter; iter = iter->next) {
        PurpleConvMessage *msg = iter->data;
        add_message_to_history(muc,
                msg->who, msg->alias,
                msg->what, msg->flags, msg->when);
    }
    return muc;
  }

[treat this as pseudocode]

MSN can present an 'Invite' option for IM conversations, and inviting
someone to an IM would create a MUC, close the IM and invite the new
person into the chat ... something like that might work. But it is
very likely something we can experiment with in 2.7.x.

Cheers.
Sadrul




More information about the Devel mailing list