Changeset fa29d093 for protocols/msn
- Timestamp:
- 2007-03-28T05:53:11Z (18 years ago)
- Branches:
- master
- Children:
- 0da65d5
- Parents:
- 723e611
- Location:
- protocols/msn
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
protocols/msn/msn.c
r723e611 rfa29d093 241 241 } 242 242 243 static int msn_chat_send( struct gaim_connection *gc, int id, char *message )244 { 245 struct msn_switchboard *sb = msn_sb_by_ id( gc, id);243 static int msn_chat_send( struct conversation *c, char *message ) 244 { 245 struct msn_switchboard *sb = msn_sb_by_chat( c ); 246 246 247 247 if( sb ) … … 251 251 } 252 252 253 static void msn_chat_invite( struct gaim_connection *gc, int id, char *msg, char *who )254 { 255 struct msn_switchboard *sb = msn_sb_by_ id( gc, id);253 static void msn_chat_invite( struct conversation *c, char *msg, char *who ) 254 { 255 struct msn_switchboard *sb = msn_sb_by_chat( c ); 256 256 char buf[1024]; 257 257 … … 263 263 } 264 264 265 static void msn_chat_leave( struct gaim_connection *gc, int id)266 { 267 struct msn_switchboard *sb = msn_sb_by_ id( gc, id);265 static void msn_chat_leave( struct conversation *c ) 266 { 267 struct msn_switchboard *sb = msn_sb_by_chat( c ); 268 268 269 269 if( sb ) … … 271 271 } 272 272 273 static intmsn_chat_open( struct gaim_connection *gc, char *who )273 static struct conversation *msn_chat_open( struct gaim_connection *gc, char *who ) 274 274 { 275 275 struct msn_switchboard *sb; … … 280 280 { 281 281 debug( "Converting existing switchboard to %s to a groupchat", who ); 282 msn_sb_to_chat( sb ); 283 return( 1 ); 282 return msn_sb_to_chat( sb ); 284 283 } 285 284 else … … 292 291 g_snprintf( buf, sizeof( buf ), "CAL %d %s\r\n", ++sb->trId, who ); 293 292 if( msn_sb_write( sb, buf, strlen( buf ) ) ) 294 { 295 msn_sb_to_chat( sb ); 296 return( 1 ); 297 } 293 return msn_sb_to_chat( sb ); 298 294 } 299 295 … … 314 310 md->msgq = g_slist_append( md->msgq, m ); 315 311 316 return( 1 ); 317 } 318 319 return( 0 ); 312 /* FIXME: Can I try to return something here already? */ 313 return NULL; 314 } 315 316 return NULL; 320 317 } 321 318 -
protocols/msn/msn.h
r723e611 rfa29d093 169 169 struct msn_switchboard *msn_sb_create( struct gaim_connection *gc, char *host, int port, char *key, int session ); 170 170 struct msn_switchboard *msn_sb_by_handle( struct gaim_connection *gc, char *handle ); 171 struct msn_switchboard *msn_sb_by_ id( struct gaim_connection *gc, int id);171 struct msn_switchboard *msn_sb_by_chat( struct conversation *c ); 172 172 struct msn_switchboard *msn_sb_spare( struct gaim_connection *gc ); 173 173 int msn_sb_sendmessage( struct msn_switchboard *sb, char *text ); 174 voidmsn_sb_to_chat( struct msn_switchboard *sb );174 struct conversation *msn_sb_to_chat( struct msn_switchboard *sb ); 175 175 void msn_sb_destroy( struct msn_switchboard *sb ); 176 176 gboolean msn_sb_connected( gpointer data, gint source, b_input_condition cond ); -
protocols/msn/sb.c
r723e611 rfa29d093 86 86 } 87 87 88 struct msn_switchboard *msn_sb_by_ id( struct gaim_connection *gc, int id)89 { 90 struct msn_data *md = gc->proto_data;88 struct msn_switchboard *msn_sb_by_chat( struct conversation *c ) 89 { 90 struct msn_data *md = c->gc->proto_data; 91 91 struct msn_switchboard *sb; 92 92 GSList *l; … … 95 95 { 96 96 sb = l->data; 97 if( sb->chat && sb->chat->id == id)97 if( sb->chat == c ) 98 98 return( sb ); 99 99 } … … 177 177 } 178 178 179 voidmsn_sb_to_chat( struct msn_switchboard *sb )179 struct conversation *msn_sb_to_chat( struct msn_switchboard *sb ) 180 180 { 181 181 struct gaim_connection *gc = sb->gc; … … 184 184 /* Create the groupchat structure. */ 185 185 g_snprintf( buf, sizeof( buf ), "MSN groupchat session %d", sb->session ); 186 sb->chat = serv_got_joined_chat( gc, ++msn_chat_id,buf );186 sb->chat = serv_got_joined_chat( gc, buf ); 187 187 188 188 /* Populate the channel. */ … … 196 196 sb->who = NULL; 197 197 } 198 199 return sb->chat; 198 200 } 199 201 … … 230 232 if( sb->chat ) 231 233 { 232 serv_got_chat_left( gc, sb->chat->id);234 serv_got_chat_left( sb->chat ); 233 235 } 234 236 … … 372 374 { 373 375 g_snprintf( buf, sizeof( buf ), "MSN groupchat session %d", sb->session ); 374 sb->chat = serv_got_joined_chat( gc, ++msn_chat_id,buf );376 sb->chat = serv_got_joined_chat( gc, buf ); 375 377 376 378 g_free( sb->who ); … … 610 612 else if( sb->chat ) 611 613 { 612 serv_got_chat_in( gc, sb->chat->id, cmd[1], 0, body, 0 );614 serv_got_chat_in( sb->chat, cmd[1], 0, body, 0 ); 613 615 } 614 616 else … … 669 671 else if( sb->chat ) 670 672 { 671 serv_got_chat_in( gc, sb->chat->id, cmd[1], 0, buf, 0 );673 serv_got_chat_in( sb->chat, cmd[1], 0, buf, 0 ); 672 674 } 673 675 else
Note: See TracChangeset
for help on using the changeset viewer.