diff options
author | Wilmer van der Gaast <wilmer@gaast.net> | 2007-07-01 20:58:23 +0100 |
---|---|---|
committer | Wilmer van der Gaast <wilmer@gaast.net> | 2007-07-01 20:58:23 +0100 |
commit | 9c9b37cbfa27a038bc57624cb9001f8db019290c (patch) | |
tree | 7fa0b45faaefb5b79e1688b7d95fb34f3f7c384d /protocols | |
parent | b9f8b870f7b884747b747be91ce0ac797a7c6e82 (diff) |
Keeping an original (not normalized) copy of the user's nickname. This
fixes a bug reported by James Teh in the monster ticket #20. There's no
proper garbage collection yet in the Jabber conference code, really have
to do that soon. :-(
Diffstat (limited to 'protocols')
-rw-r--r-- | protocols/jabber/conference.c | 7 | ||||
-rw-r--r-- | protocols/jabber/jabber.h | 1 | ||||
-rw-r--r-- | protocols/jabber/presence.c | 2 |
3 files changed, 7 insertions, 3 deletions
diff --git a/protocols/jabber/conference.c b/protocols/jabber/conference.c index d8c18df7..d236f0bb 100644 --- a/protocols/jabber/conference.c +++ b/protocols/jabber/conference.c @@ -53,7 +53,10 @@ struct groupchat *jabber_chat_join( struct im_connection *ic, char *room, char * g_free( jc ); return NULL; } - g_free( roomjid ); + + /* roomjid isn't normalized yet, and we need an original version + of the nick to send a proper presence update. */ + jc->my_full_jid = roomjid; c = imcb_chat_new( ic, room ); c->data = jc; @@ -88,7 +91,7 @@ int jabber_chat_leave( struct groupchat *c, const char *reason ) node = xt_new_node( "x", NULL, NULL ); xt_add_attr( node, "xmlns", XMLNS_MUC ); - node = jabber_make_packet( "presence", "unavailable", jc->me->full_jid, node ); + node = jabber_make_packet( "presence", "unavailable", jc->my_full_jid, node ); if( !jabber_write_packet( ic, node ) ) { diff --git a/protocols/jabber/jabber.h b/protocols/jabber/jabber.h index 51550af8..bc639fea 100644 --- a/protocols/jabber/jabber.h +++ b/protocols/jabber/jabber.h @@ -118,6 +118,7 @@ struct jabber_chat { int flags; char *name; + char *my_full_jid; /* Separate copy because of case sensitivity. */ struct jabber_buddy *me; }; diff --git a/protocols/jabber/presence.c b/protocols/jabber/presence.c index 63d4f66a..e53978ea 100644 --- a/protocols/jabber/presence.c +++ b/protocols/jabber/presence.c @@ -194,7 +194,7 @@ int presence_send_update( struct im_connection *ic ) { struct jabber_chat *jc = c->data; - xt_add_attr( node, "to", jc->me->full_jid ); + xt_add_attr( node, "to", jc->my_full_jid ); st = jabber_write_packet( ic, node ); } |