pidgin: 0257ab6e: Set PURPLE_MESSAGE_RECV before receiving...

Mark Doliner mark at kingant.net
Mon Apr 6 11:30:44 EDT 2009


On Mon, Apr 6, 2009 at 6:12 AM, Richard Nelson <wabz at whatsbeef.net> wrote:
> On Mon, Apr 06, 2009 at 08:48:56AM -0400, Stu Tomlinson wrote:
>> On Mon, 2009-04-06 at 08:25 -0400, Daniel Atallah wrote:
>> > On Mon, Apr 6, 2009 at 6:40 AM,  <wabz at pidgin.im> wrote:
>> > > ============================================================
>> > > --- libpurple/server.c  b9c6a880738b280c7302dd352dfe947ee3f7101e
>> > > +++ libpurple/server.c  3765f51e4eaa8ab0a6b533e07c639497950eb605
>> > > @@ -925,6 +925,12 @@ void serv_got_chat_in(PurpleConnection *
>> > >        g_return_if_fail(who != NULL);
>> > >        g_return_if_fail(message != NULL);
>
>> > > +       /*
>> > > +        * XXX: Should we be setting this here, or relying on prpls to set it?
>> > > +        */
>> > > +       if (g_strcmp0(purple_account_get_username(g->account), who))
>> > > +               flags |= PURPLE_MESSAGE_RECV;
>> > > +
>> > >        for (bcs = g->buddy_chats; bcs != NULL; bcs = bcs->next) {
>> > >                conv = (PurpleConversation *)bcs->data;
>
>
>> > I don't think this part is necessarily right - "who" may not be your
>> > account username when you're sending a message (e.g. in an XMPP
>> > conference).
>
>> Also the addition of g_strcmp0 (which I think is unnecessary) adds a
>> requirement on GLib 2.16.
>
> Thanks for looking at this. I just realised conversation.c sets
> _MESSAGE_(SEND|RECV) properly in purple_conv_chat_write. The problem is that I
> think it would be nice for them to be set for plugins using
> {received,receiving}-chat-msg, which happens just before the call to
> purple_conv_chat_write. I propose to move the setting of these flags where I put
> the above erroneous code, and will do so in the morning, unless someone beats me
> to it, or has a better idea :)
>
> I'll also double check the glib requirements for the stuff I just added to
> finch, and correct.
>
> cheers,
> -- Richard Nelson
>
> _______________________________________________
> Devel mailing list
> Devel at pidgin.im
> http://pidgin.im/cgi-bin/mailman/listinfo/devel
>

FYI we have purple_strequal() in libpurple/util.c, which I think is
equivalent to g_strcmp0

-Mark




More information about the Devel mailing list