diff options
author | Wilmer van der Gaast <wilmer@gaast.net> | 2008-02-03 23:33:18 +0000 |
---|---|---|
committer | Wilmer van der Gaast <wilmer@gaast.net> | 2008-02-03 23:33:18 +0000 |
commit | 63075d7345355dde6e490ad00a886a1b165dbe17 (patch) | |
tree | 53af34fc96f3fc4a4239cdaf3381466aa1f90e37 /protocols/jabber/conference.c | |
parent | 8ff0a61e7389db201ff4534f267225af6f66736b (diff) |
Messages from the user are also included in backlogs when joining a Jabber
chatroom. Until now they were ignored, which might make backlogs a little
bit confusing.
Diffstat (limited to 'protocols/jabber/conference.c')
-rw-r--r-- | protocols/jabber/conference.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/protocols/jabber/conference.c b/protocols/jabber/conference.c index 515194fc..f206e084 100644 --- a/protocols/jabber/conference.c +++ b/protocols/jabber/conference.c @@ -122,6 +122,8 @@ int jabber_chat_msg( struct groupchat *c, char *message, int flags ) struct jabber_chat *jc = c->data; struct xt_node *node; + jc->flags |= JCFLAG_MESSAGE_SENT; + node = xt_new_node( "body", message, NULL ); node = jabber_make_packet( "message", "groupchat", jc->name, node ); @@ -294,10 +296,11 @@ void jabber_chat_pkt_message( struct im_connection *ic, struct jabber_buddy *bud { struct xt_node *subject = xt_find_node( node->children, "subject" ); struct xt_node *body = xt_find_node( node->children, "body" ); - struct groupchat *chat = NULL; + struct groupchat *chat = bud ? jabber_chat_by_jid( ic, bud->bare_jid ) : NULL; + struct jabber_chat *jc = chat ? chat->data : NULL; char *s; - if( bud == NULL ) + if( bud == NULL || ( jc && ~jc->flags & JCFLAG_MESSAGE_SENT && bud == jc->me ) ) { char *nick; @@ -345,7 +348,7 @@ void jabber_chat_pkt_message( struct im_connection *ic, struct jabber_buddy *bud return; } - else if( ( chat = jabber_chat_by_jid( ic, bud->bare_jid ) ) == NULL ) + else if( chat == NULL ) { /* How could this happen?? We could do kill( self, 11 ) now or just wait for the OS to do it. :-) */ |