Changeset fc0640e for protocols/jabber/conference.c
- Timestamp:
- 2012-02-10T18:00:00Z (12 years ago)
- Branches:
- master
- Children:
- b5fe39b
- Parents:
- bb2d198
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
protocols/jabber/conference.c
rbb2d198 rfc0640e 23 23 24 24 #include "jabber.h" 25 #include "sha1.h" 25 26 26 27 static xt_status jabber_chat_join_failed( struct im_connection *ic, struct xt_node *node, struct xt_node *orig ); … … 68 69 } 69 70 71 struct groupchat *jabber_chat_with( struct im_connection *ic, char *who ) 72 { 73 struct jabber_data *jd = ic->proto_data; 74 struct jabber_chat *jc; 75 struct groupchat *c; 76 sha1_state_t sum; 77 double now = gettime(); 78 char *uuid, *rjid, *cserv; 79 80 sha1_init( &sum ); 81 sha1_append( &sum, (uint8_t*) ic->acc->user, strlen( ic->acc->user ) ); 82 sha1_append( &sum, (uint8_t*) &now, sizeof( now ) ); 83 sha1_append( &sum, (uint8_t*) who, strlen( who ) ); 84 uuid = sha1_random_uuid( &sum ); 85 86 if( jd->flags & JFLAG_GTALK ) 87 cserv = g_strdup( "groupchat.google.com" ); 88 else 89 /* Guess... */ 90 cserv = g_strdup_printf( "conference.%s", jd->server ); 91 92 rjid = g_strdup_printf( "private-chat-%s@%s", uuid, cserv ); 93 g_free( uuid ); 94 g_free( cserv ); 95 96 c = jabber_chat_join( ic, rjid, jd->username, NULL ); 97 g_free( rjid ); 98 if( c == NULL ) 99 return NULL; 100 101 jc = c->data; 102 jc->invite = g_strdup( who ); 103 104 return c; 105 } 106 70 107 static xt_status jabber_chat_join_failed( struct im_connection *ic, struct xt_node *node, struct xt_node *orig ) 71 108 { … … 116 153 g_free( jc->my_full_jid ); 117 154 g_free( jc->name ); 155 g_free( jc->invite ); 118 156 g_free( jc ); 119 157 … … 283 321 } 284 322 323 if( bud == jc->me && jc->invite != NULL ) 324 { 325 char *msg = g_strdup_printf( "Please join me in room %s", jc->name ); 326 jabber_chat_invite( chat, jc->invite, msg ); 327 g_free( jc->invite ); 328 g_free( msg ); 329 jc->invite = NULL; 330 } 331 285 332 s = strchr( bud->ext_jid, '/' ); 286 333 if( s ) *s = 0; /* Should NEVER be NULL, but who knows... */
Note: See TracChangeset
for help on using the changeset viewer.