Changeset 6286f80 for protocols/jabber
- Timestamp:
- 2007-04-26T04:41:34Z (18 years ago)
- Branches:
- master
- Children:
- bb95d43
- Parents:
- 2d317bb
- Location:
- protocols/jabber
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
protocols/jabber/conference.c
r2d317bb r6286f80 137 137 { 138 138 /* Yay, found what we need. :-) */ 139 bud-> orig_jid = g_strdup( s );139 bud->ext_jid = g_strdup( s ); 140 140 break; 141 141 } 142 142 } 143 143 144 /* Won't handle this for now. */ 145 if( bud->orig_jid == NULL ) 146 return; 147 148 s = strchr( bud->orig_jid, '/' ); 144 /* Make up some other handle, if necessary. */ 145 if( bud->ext_jid == NULL ) 146 { 147 /* Don't want the nick to be at the end, so let's 148 think of some slightly different notation to use 149 for anonymous groupchat participants in BitlBee. */ 150 bud->ext_jid = g_strdup_printf( "%s=%s", bud->resource, bud->bare_jid ); 151 bud->flags |= JBFLAG_IS_ANONYMOUS; 152 } 153 154 s = strchr( bud->ext_jid, '/' ); 149 155 if( s ) *s = 0; /* Should NEVER be NULL, but who knows... */ 150 imcb_chat_add_buddy( chat, bud-> orig_jid );156 imcb_chat_add_buddy( chat, bud->ext_jid ); 151 157 if( s ) *s = '/'; 152 158 } 153 159 else if( type ) /* This only gets called if type is NULL or "unavailable" */ 154 160 { 155 /* Won't handle this for now. */ 156 if( bud->orig_jid == NULL ) 157 return; 158 s = strchr( bud->orig_jid, '/' ); 159 if( s ) *s = 0; /* Should NEVER be NULL, but who knows... */ 160 imcb_chat_remove_buddy( chat, bud->orig_jid, NULL ); 161 s = strchr( bud->ext_jid, '/' ); 162 if( s ) *s = 0; 163 imcb_chat_remove_buddy( chat, bud->ext_jid, NULL ); 161 164 if( s ) *s = '/'; 162 165 … … 199 202 if( body && body->text_len > 0 ) 200 203 { 201 s = strchr( bud-> orig_jid, '/' );204 s = strchr( bud->ext_jid, '/' ); 202 205 if( s ) *s = 0; 203 imcb_chat_msg( chat, bud-> orig_jid, body->text, 0, jabber_get_timestamp( node ) );206 imcb_chat_msg( chat, bud->ext_jid, body->text, 0, jabber_get_timestamp( node ) ); 204 207 if( s ) *s = '/'; 205 208 } -
protocols/jabber/jabber.h
r2d317bb r6286f80 52 52 JBFLAG_IS_CHATROOM = 4, /* It's convenient to use this JID thingy for 53 53 groupchat state info too. */ 54 JBFLAG_IS_ANONYMOUS = 8, /* For anonymous chatrooms, when we don't have 55 have a real JID. */ 54 56 } jabber_buddy_flags_t; 55 57 … … 103 105 char *resource; 104 106 105 /* Groupchat-only*/106 char *orig_jid;107 char *ext_jid; /* The JID to use in BitlBee. The real JID if possible, */ 108 /* otherwise something similar to the conference JID. */ 107 109 108 110 int priority; -
protocols/jabber/jabber_util.c
r2d317bb r6286f80 451 451 g_hash_table_remove( jd->buddies, bud->bare_jid ); 452 452 g_free( bud->bare_jid ); 453 g_free( bud->ext_jid ); 453 454 g_free( bud->full_jid ); 454 455 g_free( bud->away_message ); … … 483 484 g_hash_table_replace( jd->buddies, bi->bare_jid, bi->next ); 484 485 486 g_free( bi->ext_jid ); 485 487 g_free( bi->full_jid ); 486 488 g_free( bi->away_message ); … … 526 528 { 527 529 next = bud->next; 530 g_free( bud->ext_jid ); 528 531 g_free( bud->full_jid ); 529 532 g_free( bud->away_message );
Note: See TracChangeset
for help on using the changeset viewer.