Changeset 0da65d5 for protocols/msn
- Timestamp:
- 2007-03-31T05:40:45Z (18 years ago)
- Branches:
- master
- Children:
- aef4828
- Parents:
- fa29d093
- Location:
- protocols/msn
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
protocols/msn/msn.c
rfa29d093 r0da65d5 29 29 static char *msn_set_display_name( set_t *set, char *value ); 30 30 31 static void msn_ acc_init( account_t *acc )31 static void msn_init( account_t *acc ) 32 32 { 33 33 set_t *s; … … 39 39 static void msn_login( account_t *acc ) 40 40 { 41 struct gaim_connection *gc = new_gaim_conn( acc );41 struct im_connection *ic = new_gaim_conn( acc ); 42 42 struct msn_data *md = g_new0( struct msn_data, 1 ); 43 43 44 gc->proto_data = md;44 ic->proto_data = md; 45 45 md->fd = -1; 46 46 47 47 if( strchr( acc->user, '@' ) == NULL ) 48 48 { 49 hide_login_progress( gc, "Invalid account name" );50 signoff( gc );49 hide_login_progress( ic, "Invalid account name" ); 50 signoff( ic ); 51 51 return; 52 52 } 53 53 54 set_login_progress( gc, 1, "Connecting" );55 56 md->fd = proxy_connect( "messenger.hotmail.com", 1863, msn_ns_connected, gc );54 set_login_progress( ic, 1, "Connecting" ); 55 56 md->fd = proxy_connect( "messenger.hotmail.com", 1863, msn_ns_connected, ic ); 57 57 if( md->fd < 0 ) 58 58 { 59 hide_login_progress( gc, "Could not connect to server" );60 signoff( gc );59 hide_login_progress( ic, "Could not connect to server" ); 60 signoff( ic ); 61 61 return; 62 62 } 63 63 64 md-> gc = gc;64 md->ic = ic; 65 65 md->away_state = msn_away_state_list; 66 66 67 msn_connections = g_slist_append( msn_connections, gc );68 } 69 70 static void msn_ close( struct gaim_connection *gc )71 { 72 struct msn_data *md = gc->proto_data;67 msn_connections = g_slist_append( msn_connections, ic ); 68 } 69 70 static void msn_logout( struct im_connection *ic ) 71 { 72 struct msn_data *md = ic->proto_data; 73 73 GSList *l; 74 74 … … 96 96 m = l->data; 97 97 98 serv_got_crap( gc, "Warning: Closing down MSN connection with unsent message to %s, you'll have to resend it.", m->who );98 serv_got_crap( ic, "Warning: Closing down MSN connection with unsent message to %s, you'll have to resend it.", m->who ); 99 99 g_free( m->who ); 100 100 g_free( m->text ); … … 111 111 } 112 112 113 for( l = gc->permit; l; l = l->next )113 for( l = ic->permit; l; l = l->next ) 114 114 g_free( l->data ); 115 g_slist_free( gc->permit );116 117 for( l = gc->deny; l; l = l->next )115 g_slist_free( ic->permit ); 116 117 for( l = ic->deny; l; l = l->next ) 118 118 g_free( l->data ); 119 g_slist_free( gc->deny );120 121 msn_connections = g_slist_remove( msn_connections, gc );122 } 123 124 static int msn_send_im( struct gaim_connection *gc, char *who, char *message, int len, int away )119 g_slist_free( ic->deny ); 120 121 msn_connections = g_slist_remove( msn_connections, ic ); 122 } 123 124 static int msn_send_im( struct im_connection *ic, char *who, char *message, int away ) 125 125 { 126 126 struct msn_switchboard *sb; 127 struct msn_data *md = gc->proto_data;128 129 if( ( sb = msn_sb_by_handle( gc, who ) ) )127 struct msn_data *md = ic->proto_data; 128 129 if( ( sb = msn_sb_by_handle( ic, who ) ) ) 130 130 { 131 131 return( msn_sb_sendmessage( sb, message ) ); … … 142 142 143 143 /* FIXME: *CHECK* the reliability of using spare sb's! */ 144 if( ( sb = msn_sb_spare( gc ) ) )144 if( ( sb = msn_sb_spare( ic ) ) ) 145 145 { 146 146 debug( "Trying to use a spare switchboard to message %s", who ); … … 160 160 /* If we reach this line, there was no spare switchboard, so let's make one. */ 161 161 g_snprintf( buf, sizeof( buf ), "XFR %d SB\r\n", ++md->trId ); 162 if( !msn_write( gc, buf, strlen( buf ) ) )162 if( !msn_write( ic, buf, strlen( buf ) ) ) 163 163 { 164 164 g_free( m->who ); … … 180 180 } 181 181 182 static GList *msn_away_states( struct gaim_connection *gc )182 static GList *msn_away_states( struct im_connection *ic ) 183 183 { 184 184 static GList *l = NULL; … … 192 192 } 193 193 194 static char *msn_get_status_string( struct gaim_connection *gc, int number )194 static char *msn_get_status_string( struct im_connection *ic, int number ) 195 195 { 196 196 const struct msn_away_state *st = msn_away_state_by_number( number ); … … 202 202 } 203 203 204 static void msn_set_away( struct gaim_connection *gc, char *state, char *message )204 static void msn_set_away( struct im_connection *ic, char *state, char *message ) 205 205 { 206 206 char buf[1024]; 207 struct msn_data *md = gc->proto_data;207 struct msn_data *md = ic->proto_data; 208 208 const struct msn_away_state *st; 209 209 … … 217 217 218 218 g_snprintf( buf, sizeof( buf ), "CHG %d %s\r\n", ++md->trId, st->code ); 219 msn_write( gc, buf, strlen( buf ) );220 } 221 222 static void msn_set_ info( struct gaim_connection *gc, char *info )223 { 224 msn_set_display_name( set_find( & gc->acc->set, "display_name" ), info );225 } 226 227 static void msn_get_info(struct gaim_connection *gc, char *who)219 msn_write( ic, buf, strlen( buf ) ); 220 } 221 222 static void msn_set_my_name( struct im_connection *ic, char *info ) 223 { 224 msn_set_display_name( set_find( &ic->acc->set, "display_name" ), info ); 225 } 226 227 static void msn_get_info(struct im_connection *ic, char *who) 228 228 { 229 229 /* Just make an URL and let the user fetch the info */ 230 serv_got_crap( gc, "%s\n%s: %s%s", _("User Info"), _("For now, fetch yourself"), PROFILE_URL, who );231 } 232 233 static void msn_add_buddy( struct gaim_connection *gc, char *who)234 { 235 msn_buddy_list_add( gc, "FL", who, who );236 } 237 238 static void msn_remove_buddy( struct gaim_connection *gc, char *who, char *group )239 { 240 msn_buddy_list_remove( gc, "FL", who );241 } 242 243 static int msn_chat_send( struct conversation *c, char *message)230 serv_got_crap( ic, "%s\n%s: %s%s", _("User Info"), _("For now, fetch yourself"), PROFILE_URL, who ); 231 } 232 233 static void msn_add_buddy( struct im_connection *ic, char *who, char *group ) 234 { 235 msn_buddy_list_add( ic, "FL", who, who ); 236 } 237 238 static void msn_remove_buddy( struct im_connection *ic, char *who, char *group ) 239 { 240 msn_buddy_list_remove( ic, "FL", who ); 241 } 242 243 static void msn_chat_send( struct groupchat *c, char *message, int flags ) 244 244 { 245 245 struct msn_switchboard *sb = msn_sb_by_chat( c ); 246 246 247 247 if( sb ) 248 return( msn_sb_sendmessage( sb, message ));249 else250 return( 0 );251 } 252 253 static void msn_chat_invite( struct conversation*c, char *msg, char *who )248 msn_sb_sendmessage( sb, message ); 249 /* FIXME: Error handling (although this can't happen unless something's 250 already severely broken) disappeared here! */ 251 } 252 253 static void msn_chat_invite( struct groupchat *c, char *msg, char *who ) 254 254 { 255 255 struct msn_switchboard *sb = msn_sb_by_chat( c ); … … 263 263 } 264 264 265 static void msn_chat_leave( struct conversation*c )265 static void msn_chat_leave( struct groupchat *c ) 266 266 { 267 267 struct msn_switchboard *sb = msn_sb_by_chat( c ); … … 271 271 } 272 272 273 static struct conversation *msn_chat_open( struct gaim_connection *gc, char *who )273 static struct groupchat *msn_chat_with( struct im_connection *ic, char *who ) 274 274 { 275 275 struct msn_switchboard *sb; 276 struct msn_data *md = gc->proto_data;276 struct msn_data *md = ic->proto_data; 277 277 char buf[1024]; 278 278 279 if( ( sb = msn_sb_by_handle( gc, who ) ) )279 if( ( sb = msn_sb_by_handle( ic, who ) ) ) 280 280 { 281 281 debug( "Converting existing switchboard to %s to a groupchat", who ); … … 286 286 struct msn_message *m; 287 287 288 if( ( sb = msn_sb_spare( gc ) ) )288 if( ( sb = msn_sb_spare( ic ) ) ) 289 289 { 290 290 debug( "Trying to reuse an existing switchboard as a groupchat with %s", who ); … … 299 299 /* Request a new switchboard. */ 300 300 g_snprintf( buf, sizeof( buf ), "XFR %d SB\r\n", ++md->trId ); 301 if( !msn_write( gc, buf, strlen( buf ) ) )301 if( !msn_write( ic, buf, strlen( buf ) ) ) 302 302 return( 0 ); 303 303 … … 317 317 } 318 318 319 static void msn_keepalive( struct gaim_connection *gc )320 { 321 msn_write( gc, "PNG\r\n", strlen( "PNG\r\n" ) );322 } 323 324 static void msn_add_permit( struct gaim_connection *gc, char *who )325 { 326 msn_buddy_list_add( gc, "AL", who, who );327 } 328 329 static void msn_rem_permit( struct gaim_connection *gc, char *who )330 { 331 msn_buddy_list_remove( gc, "AL", who );332 } 333 334 static void msn_add_deny( struct gaim_connection *gc, char *who )319 static void msn_keepalive( struct im_connection *ic ) 320 { 321 msn_write( ic, "PNG\r\n", strlen( "PNG\r\n" ) ); 322 } 323 324 static void msn_add_permit( struct im_connection *ic, char *who ) 325 { 326 msn_buddy_list_add( ic, "AL", who, who ); 327 } 328 329 static void msn_rem_permit( struct im_connection *ic, char *who ) 330 { 331 msn_buddy_list_remove( ic, "AL", who ); 332 } 333 334 static void msn_add_deny( struct im_connection *ic, char *who ) 335 335 { 336 336 struct msn_switchboard *sb; 337 337 338 msn_buddy_list_add( gc, "BL", who, who );338 msn_buddy_list_add( ic, "BL", who, who ); 339 339 340 340 /* If there's still a conversation with this person, close it. */ 341 if( ( sb = msn_sb_by_handle( gc, who ) ) )341 if( ( sb = msn_sb_by_handle( ic, who ) ) ) 342 342 { 343 343 msn_sb_destroy( sb ); … … 345 345 } 346 346 347 static void msn_rem_deny( struct gaim_connection *gc, char *who )348 { 349 msn_buddy_list_remove( gc, "BL", who );350 } 351 352 static int msn_send_typing( struct gaim_connection *gc, char *who, int typing )347 static void msn_rem_deny( struct im_connection *ic, char *who ) 348 { 349 msn_buddy_list_remove( ic, "BL", who ); 350 } 351 352 static int msn_send_typing( struct im_connection *ic, char *who, int typing ) 353 353 { 354 354 if( typing ) 355 return( msn_send_im( gc, who, TYPING_NOTIFICATION_MESSAGE, strlen( TYPING_NOTIFICATION_MESSAGE ), 0 ) );355 return( msn_send_im( ic, who, TYPING_NOTIFICATION_MESSAGE, 0 ) ); 356 356 else 357 357 return( 1 ); … … 361 361 { 362 362 account_t *acc = set->data; 363 struct gaim_connection *gc = acc->gc;363 struct im_connection *ic = acc->ic; 364 364 struct msn_data *md; 365 365 char buf[1024], *fn; 366 366 367 367 /* Double-check. */ 368 if( gc == NULL )368 if( ic == NULL ) 369 369 return NULL; 370 370 371 md = gc->proto_data;371 md = ic->proto_data; 372 372 373 373 if( strlen( value ) > 129 ) 374 374 { 375 serv_got_crap( gc, "Maximum name length exceeded" );375 serv_got_crap( ic, "Maximum name length exceeded" ); 376 376 return NULL; 377 377 } … … 379 379 fn = msn_http_encode( value ); 380 380 381 g_snprintf( buf, sizeof( buf ), "REA %d %s %s\r\n", ++md->trId, gc->username, fn );382 msn_write( gc, buf, strlen( buf ) );381 g_snprintf( buf, sizeof( buf ), "REA %d %s %s\r\n", ++md->trId, ic->username, fn ); 382 msn_write( ic, buf, strlen( buf ) ); 383 383 g_free( fn ); 384 384 … … 389 389 } 390 390 391 void msn_init ()391 void msn_initmodule() 392 392 { 393 393 struct prpl *ret = g_new0(struct prpl, 1); … … 395 395 ret->name = "msn"; 396 396 ret->login = msn_login; 397 ret-> acc_init = msn_acc_init;398 ret-> close = msn_close;397 ret->init = msn_init; 398 ret->logout = msn_logout; 399 399 ret->send_im = msn_send_im; 400 400 ret->away_states = msn_away_states; 401 401 ret->get_status_string = msn_get_status_string; 402 402 ret->set_away = msn_set_away; 403 ret->set_info = msn_set_info;404 403 ret->get_info = msn_get_info; 404 ret->set_my_name = msn_set_my_name; 405 405 ret->add_buddy = msn_add_buddy; 406 406 ret->remove_buddy = msn_remove_buddy; … … 408 408 ret->chat_invite = msn_chat_invite; 409 409 ret->chat_leave = msn_chat_leave; 410 ret->chat_ open = msn_chat_open;410 ret->chat_with = msn_chat_with; 411 411 ret->keepalive = msn_keepalive; 412 412 ret->add_permit = msn_add_permit; -
protocols/msn/msn.h
rfa29d093 r0da65d5 57 57 struct msn_data 58 58 { 59 struct gaim_connection *gc;59 struct im_connection *ic; 60 60 61 61 int fd; … … 75 75 struct msn_switchboard 76 76 { 77 struct gaim_connection *gc;77 struct im_connection *ic; 78 78 79 79 int fd; … … 89 89 GSList *msgq; 90 90 char *who; 91 struct conversation*chat;91 struct groupchat *chat; 92 92 }; 93 93 … … 149 149 150 150 /* msn_util.c */ 151 int msn_write( struct gaim_connection *gc, char *s, int len );152 int msn_logged_in( struct gaim_connection *gc );153 int msn_buddy_list_add( struct gaim_connection *gc, char *list, char *who, char *realname );154 int msn_buddy_list_remove( struct gaim_connection *gc, char *list, char *who );155 void msn_buddy_ask( struct gaim_connection *gc, char *handle, char *realname );151 int msn_write( struct im_connection *ic, char *s, int len ); 152 int msn_logged_in( struct im_connection *ic ); 153 int msn_buddy_list_add( struct im_connection *ic, char *list, char *who, char *realname ); 154 int msn_buddy_list_remove( struct im_connection *ic, char *list, char *who ); 155 void msn_buddy_ask( struct im_connection *ic, char *handle, char *realname ); 156 156 char *msn_findheader( char *text, char *header, int len ); 157 157 char **msn_linesplit( char *line ); … … 167 167 /* sb.c */ 168 168 int msn_sb_write( struct msn_switchboard *sb, char *s, int len ); 169 struct msn_switchboard *msn_sb_create( struct gaim_connection *gc, char *host, int port, char *key, int session );170 struct msn_switchboard *msn_sb_by_handle( struct gaim_connection *gc, char *handle );171 struct msn_switchboard *msn_sb_by_chat( struct conversation*c );172 struct msn_switchboard *msn_sb_spare( struct gaim_connection *gc );169 struct msn_switchboard *msn_sb_create( struct im_connection *ic, char *host, int port, char *key, int session ); 170 struct msn_switchboard *msn_sb_by_handle( struct im_connection *ic, char *handle ); 171 struct msn_switchboard *msn_sb_by_chat( struct groupchat *c ); 172 struct msn_switchboard *msn_sb_spare( struct im_connection *ic ); 173 173 int msn_sb_sendmessage( struct msn_switchboard *sb, char *text ); 174 struct conversation*msn_sb_to_chat( struct msn_switchboard *sb );174 struct groupchat *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/msn_util.c
rfa29d093 r0da65d5 28 28 #include <ctype.h> 29 29 30 int msn_write( struct gaim_connection *gc, char *s, int len )31 { 32 struct msn_data *md = gc->proto_data;30 int msn_write( struct im_connection *ic, char *s, int len ) 31 { 32 struct msn_data *md = ic->proto_data; 33 33 int st; 34 34 … … 36 36 if( st != len ) 37 37 { 38 hide_login_progress_error( gc, "Short write() to main server" );39 signoff( gc );38 hide_login_progress_error( ic, "Short write() to main server" ); 39 signoff( ic ); 40 40 return( 0 ); 41 41 } … … 44 44 } 45 45 46 int msn_logged_in( struct gaim_connection *gc )47 { 48 account_online( gc );46 int msn_logged_in( struct im_connection *ic ) 47 { 48 account_online( ic ); 49 49 50 50 return( 0 ); 51 51 } 52 52 53 int msn_buddy_list_add( struct gaim_connection *gc, char *list, char *who, char *realname_ )54 { 55 struct msn_data *md = gc->proto_data;53 int msn_buddy_list_add( struct im_connection *ic, char *list, char *who, char *realname_ ) 54 { 55 struct msn_data *md = ic->proto_data; 56 56 char buf[1024], *realname; 57 57 … … 59 59 60 60 g_snprintf( buf, sizeof( buf ), "ADD %d %s %s %s\r\n", ++md->trId, list, who, realname ); 61 if( msn_write( gc, buf, strlen( buf ) ) )61 if( msn_write( ic, buf, strlen( buf ) ) ) 62 62 { 63 63 g_free( realname ); … … 71 71 } 72 72 73 int msn_buddy_list_remove( struct gaim_connection *gc, char *list, char *who )74 { 75 struct msn_data *md = gc->proto_data;73 int msn_buddy_list_remove( struct im_connection *ic, char *list, char *who ) 74 { 75 struct msn_data *md = ic->proto_data; 76 76 char buf[1024]; 77 77 78 78 g_snprintf( buf, sizeof( buf ), "REM %d %s %s\r\n", ++md->trId, list, who ); 79 if( msn_write( gc, buf, strlen( buf ) ) )79 if( msn_write( ic, buf, strlen( buf ) ) ) 80 80 return( 1 ); 81 81 … … 85 85 struct msn_buddy_ask_data 86 86 { 87 struct gaim_connection *gc;87 struct im_connection *ic; 88 88 char *handle; 89 89 char *realname; … … 92 92 static void msn_buddy_ask_yes( gpointer w, struct msn_buddy_ask_data *bla ) 93 93 { 94 msn_buddy_list_add( bla-> gc, "AL", bla->handle, bla->realname );95 96 if( find_buddy( bla-> gc, bla->handle ) == NULL )97 show_got_added( bla-> gc, bla->handle, NULL );94 msn_buddy_list_add( bla->ic, "AL", bla->handle, bla->realname ); 95 96 if( find_buddy( bla->ic, bla->handle ) == NULL ) 97 show_got_added( bla->ic, bla->handle, NULL ); 98 98 99 99 g_free( bla->handle ); … … 104 104 static void msn_buddy_ask_no( gpointer w, struct msn_buddy_ask_data *bla ) 105 105 { 106 msn_buddy_list_add( bla-> gc, "BL", bla->handle, bla->realname );106 msn_buddy_list_add( bla->ic, "BL", bla->handle, bla->realname ); 107 107 108 108 g_free( bla->handle ); … … 111 111 } 112 112 113 void msn_buddy_ask( struct gaim_connection *gc, char *handle, char *realname )113 void msn_buddy_ask( struct im_connection *ic, char *handle, char *realname ) 114 114 { 115 115 struct msn_buddy_ask_data *bla = g_new0( struct msn_buddy_ask_data, 1 ); 116 116 char buf[1024]; 117 117 118 bla-> gc = gc;118 bla->ic = ic; 119 119 bla->handle = g_strdup( handle ); 120 120 bla->realname = g_strdup( realname ); … … 123 123 "The user %s (%s) wants to add you to his/her buddy list.", 124 124 handle, realname ); 125 do_ask_dialog( gc, buf, bla, msn_buddy_ask_yes, msn_buddy_ask_no );125 do_ask_dialog( ic, buf, bla, msn_buddy_ask_yes, msn_buddy_ask_no ); 126 126 } 127 127 -
protocols/msn/ns.c
rfa29d093 r0da65d5 38 38 gboolean msn_ns_connected( gpointer data, gint source, b_input_condition cond ) 39 39 { 40 struct gaim_connection *gc = data;40 struct im_connection *ic = data; 41 41 struct msn_data *md; 42 42 char s[1024]; 43 43 44 if( !g_slist_find( msn_connections, gc ) )44 if( !g_slist_find( msn_connections, ic ) ) 45 45 return FALSE; 46 46 47 47 if( source == -1 ) 48 48 { 49 hide_login_progress( gc, "Could not connect to server" );50 signoff( gc );49 hide_login_progress( ic, "Could not connect to server" ); 50 signoff( ic ); 51 51 return FALSE; 52 52 } 53 53 54 md = gc->proto_data;54 md = ic->proto_data; 55 55 56 56 if( !md->handler ) 57 57 { 58 58 md->handler = g_new0( struct msn_handler_data, 1 ); 59 md->handler->data = gc;59 md->handler->data = ic; 60 60 md->handler->exec_command = msn_ns_command; 61 61 md->handler->exec_message = msn_ns_message; … … 73 73 74 74 g_snprintf( s, sizeof( s ), "VER %d MSNP8 CVR0\r\n", ++md->trId ); 75 if( msn_write( gc, s, strlen( s ) ) )76 { 77 gc->inpa = b_input_add( md->fd, GAIM_INPUT_READ, msn_ns_callback, gc );78 set_login_progress( gc, 1, "Connected to server, waiting for reply" );75 if( msn_write( ic, s, strlen( s ) ) ) 76 { 77 ic->inpa = b_input_add( md->fd, GAIM_INPUT_READ, msn_ns_callback, ic ); 78 set_login_progress( ic, 1, "Connected to server, waiting for reply" ); 79 79 } 80 80 … … 84 84 static gboolean msn_ns_callback( gpointer data, gint source, b_input_condition cond ) 85 85 { 86 struct gaim_connection *gc = data;87 struct msn_data *md = gc->proto_data;86 struct im_connection *ic = data; 87 struct msn_data *md = ic->proto_data; 88 88 89 89 if( msn_handler( md->handler ) == -1 ) /* Don't do this on ret == 0, it's already done then. */ 90 90 { 91 hide_login_progress( gc, "Error while reading from server" );92 signoff( gc );91 hide_login_progress( ic, "Error while reading from server" ); 92 signoff( ic ); 93 93 94 94 return FALSE; … … 100 100 static int msn_ns_command( gpointer data, char **cmd, int num_parts ) 101 101 { 102 struct gaim_connection *gc = data;103 struct msn_data *md = gc->proto_data;102 struct im_connection *ic = data; 103 struct msn_data *md = ic->proto_data; 104 104 char buf[1024]; 105 105 … … 114 114 if( cmd[2] && strncmp( cmd[2], "MSNP8", 5 ) != 0 ) 115 115 { 116 hide_login_progress( gc, "Unsupported protocol" );117 signoff( gc );116 hide_login_progress( ic, "Unsupported protocol" ); 117 signoff( ic ); 118 118 return( 0 ); 119 119 } 120 120 121 121 g_snprintf( buf, sizeof( buf ), "CVR %d 0x0409 mac 10.2.0 ppc macmsgs 3.5.1 macmsgs %s\r\n", 122 ++md->trId, gc->username );123 return( msn_write( gc, buf, strlen( buf ) ) );122 ++md->trId, ic->username ); 123 return( msn_write( ic, buf, strlen( buf ) ) ); 124 124 } 125 125 else if( strcmp( cmd[0], "CVR" ) == 0 ) 126 126 { 127 127 /* We don't give a damn about the information we just received */ 128 g_snprintf( buf, sizeof( buf ), "USR %d TWN I %s\r\n", ++md->trId, gc->username );129 return( msn_write( gc, buf, strlen( buf ) ) );128 g_snprintf( buf, sizeof( buf ), "USR %d TWN I %s\r\n", ++md->trId, ic->username ); 129 return( msn_write( ic, buf, strlen( buf ) ) ); 130 130 } 131 131 else if( strcmp( cmd[0], "XFR" ) == 0 ) … … 136 136 if( num_parts == 6 && strcmp( cmd[2], "NS" ) == 0 ) 137 137 { 138 b_event_remove( gc->inpa );139 gc->inpa = 0;138 b_event_remove( ic->inpa ); 139 ic->inpa = 0; 140 140 closesocket( md->fd ); 141 141 … … 143 143 if( !server ) 144 144 { 145 hide_login_progress_error( gc, "Syntax error" );146 signoff( gc );145 hide_login_progress_error( ic, "Syntax error" ); 146 signoff( ic ); 147 147 return( 0 ); 148 148 } … … 151 151 server = cmd[3]; 152 152 153 set_login_progress( gc, 1, "Transferring to other server" );154 155 md->fd = proxy_connect( server, port, msn_ns_connected, gc );153 set_login_progress( ic, 1, "Transferring to other server" ); 154 155 md->fd = proxy_connect( server, port, msn_ns_connected, ic ); 156 156 } 157 157 else if( num_parts == 6 && strcmp( cmd[2], "SB" ) == 0 ) … … 162 162 if( !server ) 163 163 { 164 hide_login_progress_error( gc, "Syntax error" );165 signoff( gc );164 hide_login_progress_error( ic, "Syntax error" ); 165 signoff( ic ); 166 166 return( 0 ); 167 167 } … … 172 172 if( strcmp( cmd[4], "CKI" ) != 0 ) 173 173 { 174 hide_login_progress_error( gc, "Unknown authentication method for switchboard" );175 signoff( gc );174 hide_login_progress_error( ic, "Unknown authentication method for switchboard" ); 175 signoff( ic ); 176 176 return( 0 ); 177 177 } 178 178 179 179 debug( "Connecting to a new switchboard with key %s", cmd[5] ); 180 sb = msn_sb_create( gc, server, port, cmd[5], MSN_SB_NEW );180 sb = msn_sb_create( ic, server, port, cmd[5], MSN_SB_NEW ); 181 181 182 182 if( md->msgq ) … … 204 204 else 205 205 { 206 hide_login_progress_error( gc, "Syntax error" );207 signoff( gc );206 hide_login_progress_error( ic, "Syntax error" ); 207 signoff( ic ); 208 208 return( 0 ); 209 209 } … … 214 214 { 215 215 /* Time for some Passport black magic... */ 216 if( !passport_get_id( msn_auth_got_passport_id, gc, gc->username, gc->password, cmd[4] ) )217 { 218 hide_login_progress_error( gc, "Error while contacting Passport server" );219 signoff( gc );216 if( !passport_get_id( msn_auth_got_passport_id, ic, ic->username, ic->password, cmd[4] ) ) 217 { 218 hide_login_progress_error( ic, "Error while contacting Passport server" ); 219 signoff( ic ); 220 220 return( 0 ); 221 221 } … … 227 227 http_decode( cmd[4] ); 228 228 229 strncpy( gc->displayname, cmd[4], sizeof( gc->displayname ) );230 gc->displayname[sizeof(gc->displayname)-1] = 0;231 232 if( ( s = set_find( & gc->acc->set, "display_name" ) ) )229 strncpy( ic->displayname, cmd[4], sizeof( ic->displayname ) ); 230 ic->displayname[sizeof(ic->displayname)-1] = 0; 231 232 if( ( s = set_find( &ic->acc->set, "display_name" ) ) ) 233 233 { 234 234 g_free( s->value ); … … 236 236 } 237 237 238 set_login_progress( gc, 1, "Authenticated, getting buddy list" );238 set_login_progress( ic, 1, "Authenticated, getting buddy list" ); 239 239 240 240 g_snprintf( buf, sizeof( buf ), "SYN %d 0\r\n", ++md->trId ); 241 return( msn_write( gc, buf, strlen( buf ) ) );241 return( msn_write( ic, buf, strlen( buf ) ) ); 242 242 } 243 243 else 244 244 { 245 hide_login_progress( gc, "Unknown authentication type" );246 signoff( gc );245 hide_login_progress( ic, "Unknown authentication type" ); 246 signoff( ic ); 247 247 return( 0 ); 248 248 } … … 252 252 if( num_parts != 4 ) 253 253 { 254 hide_login_progress_error( gc, "Syntax error" );255 signoff( gc );254 hide_login_progress_error( ic, "Syntax error" ); 255 signoff( ic ); 256 256 return( 0 ); 257 257 } … … 261 261 if( md->handler->msglen <= 0 ) 262 262 { 263 hide_login_progress_error( gc, "Syntax error" );264 signoff( gc );263 hide_login_progress_error( ic, "Syntax error" ); 264 signoff( ic ); 265 265 return( 0 ); 266 266 } … … 276 276 277 277 if( !*cmd[3] || md->buddycount == 0 ) 278 msn_logged_in( gc );278 msn_logged_in( ic ); 279 279 } 280 280 else … … 283 283 Let's assume everything is okay. */ 284 284 285 msn_logged_in( gc );285 msn_logged_in( ic ); 286 286 } 287 287 } … … 292 292 if( num_parts != 4 && num_parts != 5 ) 293 293 { 294 hide_login_progress( gc, "Syntax error" );295 signoff( gc );294 hide_login_progress( ic, "Syntax error" ); 295 signoff( ic ); 296 296 return( 0 ); 297 297 } … … 308 308 group = md->grouplist[num]; 309 309 310 add_buddy( gc, group, cmd[1], cmd[2] );310 add_buddy( ic, group, cmd[1], cmd[2] ); 311 311 } 312 312 if( list & 2 ) /* AL */ 313 313 { 314 gc->permit = g_slist_append( gc->permit, g_strdup( cmd[1] ) );314 ic->permit = g_slist_append( ic->permit, g_strdup( cmd[1] ) ); 315 315 } 316 316 if( list & 4 ) /* BL */ 317 317 { 318 gc->deny = g_slist_append( gc->deny, g_strdup( cmd[1] ) );318 ic->deny = g_slist_append( ic->deny, g_strdup( cmd[1] ) ); 319 319 } 320 320 if( list & 8 ) /* RL */ 321 321 { 322 322 if( ( list & 6 ) == 0 ) 323 msn_buddy_ask( gc, cmd[1], cmd[2] );323 msn_buddy_ask( ic, cmd[1], cmd[2] ); 324 324 } 325 325 326 326 if( --md->buddycount == 0 ) 327 327 { 328 if( gc->flags & OPT_LOGGED_IN )329 { 330 serv_got_crap( gc, "Successfully transferred to different server" );328 if( ic->flags & OPT_LOGGED_IN ) 329 { 330 serv_got_crap( ic, "Successfully transferred to different server" ); 331 331 g_snprintf( buf, sizeof( buf ), "CHG %d %s %d\r\n", ++md->trId, md->away_state->code, 0 ); 332 return( msn_write( gc, buf, strlen( buf ) ) );332 return( msn_write( ic, buf, strlen( buf ) ) ); 333 333 } 334 334 else 335 335 { 336 msn_logged_in( gc );336 msn_logged_in( ic ); 337 337 } 338 338 } … … 344 344 if( num_parts != 4 ) 345 345 { 346 hide_login_progress_error( gc, "Syntax error" );347 signoff( gc );346 hide_login_progress_error( ic, "Syntax error" ); 347 signoff( ic ); 348 348 return( 0 ); 349 349 } … … 363 363 if( num_parts != 3 ) 364 364 { 365 hide_login_progress_error( gc, "Syntax error" );366 signoff( gc );365 hide_login_progress_error( ic, "Syntax error" ); 366 signoff( ic ); 367 367 return( 0 ); 368 368 } … … 377 377 g_snprintf( buf + strlen( buf ), 3, "%02x", digest[i] ); 378 378 379 return( msn_write( gc, buf, strlen( buf ) ) );379 return( msn_write( ic, buf, strlen( buf ) ) ); 380 380 } 381 381 else if( strcmp( cmd[0], "ILN" ) == 0 ) … … 385 385 if( num_parts != 6 ) 386 386 { 387 hide_login_progress_error( gc, "Syntax error" );388 signoff( gc );387 hide_login_progress_error( ic, "Syntax error" ); 388 signoff( ic ); 389 389 return( 0 ); 390 390 } 391 391 392 392 http_decode( cmd[4] ); 393 serv_buddy_rename( gc, cmd[3], cmd[4] );393 serv_buddy_rename( ic, cmd[3], cmd[4] ); 394 394 395 395 st = msn_away_state_by_code( cmd[2] ); … … 400 400 } 401 401 402 serv_got_update( gc, cmd[3], 1, 0, 0, 0, st->number, 0 );402 serv_got_update( ic, cmd[3], 1, 0, 0, 0, st->number, 0 ); 403 403 } 404 404 else if( strcmp( cmd[0], "FLN" ) == 0 ) 405 405 { 406 406 if( cmd[1] ) 407 serv_got_update( gc, cmd[1], 0, 0, 0, 0, 0, 0 );407 serv_got_update( ic, cmd[1], 0, 0, 0, 0, 0, 0 ); 408 408 } 409 409 else if( strcmp( cmd[0], "NLN" ) == 0 ) … … 413 413 if( num_parts != 5 ) 414 414 { 415 hide_login_progress_error( gc, "Syntax error" );416 signoff( gc );415 hide_login_progress_error( ic, "Syntax error" ); 416 signoff( ic ); 417 417 return( 0 ); 418 418 } 419 419 420 420 http_decode( cmd[3] ); 421 serv_buddy_rename( gc, cmd[2], cmd[3] );421 serv_buddy_rename( ic, cmd[2], cmd[3] ); 422 422 423 423 st = msn_away_state_by_code( cmd[1] ); … … 428 428 } 429 429 430 serv_got_update( gc, cmd[2], 1, 0, 0, 0, st->number, 0 );430 serv_got_update( ic, cmd[2], 1, 0, 0, 0, st->number, 0 ); 431 431 } 432 432 else if( strcmp( cmd[0], "RNG" ) == 0 ) … … 438 438 if( num_parts != 7 ) 439 439 { 440 hide_login_progress_error( gc, "Syntax error" );441 signoff( gc );440 hide_login_progress_error( ic, "Syntax error" ); 441 signoff( ic ); 442 442 return( 0 ); 443 443 } … … 448 448 if( !server ) 449 449 { 450 hide_login_progress_error( gc, "Syntax error" );451 signoff( gc );450 hide_login_progress_error( ic, "Syntax error" ); 451 signoff( ic ); 452 452 return( 0 ); 453 453 } … … 458 458 if( strcmp( cmd[3], "CKI" ) != 0 ) 459 459 { 460 hide_login_progress_error( gc, "Unknown authentication method for switchboard" );461 signoff( gc );460 hide_login_progress_error( ic, "Unknown authentication method for switchboard" ); 461 signoff( ic ); 462 462 return( 0 ); 463 463 } … … 465 465 debug( "Got a call from %s (session %d). Key = %s", cmd[5], session, cmd[4] ); 466 466 467 sb = msn_sb_create( gc, server, port, cmd[4], session );467 sb = msn_sb_create( ic, server, port, cmd[4], session ); 468 468 sb->who = g_strdup( cmd[5] ); 469 469 } … … 478 478 if( strchr( cmd[4], '@' ) == NULL ) 479 479 { 480 hide_login_progress_error( gc, "Syntax error" );481 signoff( gc );480 hide_login_progress_error( ic, "Syntax error" ); 481 signoff( ic ); 482 482 return( 0 ); 483 483 } 484 484 485 485 /* We got added by someone. If we don't have this person in permit/deny yet, inform the user. */ 486 for( l = gc->permit; l; l = l->next )486 for( l = ic->permit; l; l = l->next ) 487 487 if( g_strcasecmp( l->data, cmd[4] ) == 0 ) 488 488 return( 1 ); 489 489 490 for( l = gc->deny; l; l = l->next )490 for( l = ic->deny; l; l = l->next ) 491 491 if( g_strcasecmp( l->data, cmd[4] ) == 0 ) 492 492 return( 1 ); 493 493 494 msn_buddy_ask( gc, cmd[4], cmd[5] );494 msn_buddy_ask( ic, cmd[4], cmd[5] ); 495 495 } 496 496 } … … 499 499 if( cmd[1] && strcmp( cmd[1], "OTH" ) == 0 ) 500 500 { 501 hide_login_progress_error( gc, "Someone else logged in with your account" );502 gc->wants_to_die = 1;501 hide_login_progress_error( ic, "Someone else logged in with your account" ); 502 ic->wants_to_die = 1; 503 503 } 504 504 else if( cmd[1] && strcmp( cmd[1], "SSD" ) == 0 ) 505 505 { 506 hide_login_progress_error( gc, "Terminating session because of server shutdown" );506 hide_login_progress_error( ic, "Terminating session because of server shutdown" ); 507 507 } 508 508 else 509 509 { 510 hide_login_progress_error( gc, "Session terminated by remote server (reason unknown)" );511 } 512 513 signoff( gc );510 hide_login_progress_error( ic, "Session terminated by remote server (reason unknown)" ); 511 } 512 513 signoff( ic ); 514 514 return( 0 ); 515 515 } … … 518 518 if( num_parts != 5 ) 519 519 { 520 hide_login_progress_error( gc, "Syntax error" );521 signoff( gc );522 return( 0 ); 523 } 524 525 if( g_strcasecmp( cmd[3], gc->username ) == 0 )520 hide_login_progress_error( ic, "Syntax error" ); 521 signoff( ic ); 522 return( 0 ); 523 } 524 525 if( g_strcasecmp( cmd[3], ic->username ) == 0 ) 526 526 { 527 527 set_t *s; 528 528 529 529 http_decode( cmd[4] ); 530 strncpy( gc->displayname, cmd[4], sizeof( gc->displayname ) );531 gc->displayname[sizeof(gc->displayname)-1] = 0;532 533 if( ( s = set_find( & gc->acc->set, "display_name" ) ) )530 strncpy( ic->displayname, cmd[4], sizeof( ic->displayname ) ); 531 ic->displayname[sizeof(ic->displayname)-1] = 0; 532 533 if( ( s = set_find( &ic->acc->set, "display_name" ) ) ) 534 534 { 535 535 g_free( s->value ); … … 541 541 /* This is not supposed to happen, but let's handle it anyway... */ 542 542 http_decode( cmd[4] ); 543 serv_buddy_rename( gc, cmd[3], cmd[4] );543 serv_buddy_rename( ic, cmd[3], cmd[4] ); 544 544 } 545 545 } 546 546 else if( strcmp( cmd[0], "IPG" ) == 0 ) 547 547 { 548 do_error_dialog( gc, "Received IPG command, we don't handle them yet.", "MSN" );548 do_error_dialog( ic, "Received IPG command, we don't handle them yet.", "MSN" ); 549 549 550 550 md->handler->msglen = atoi( cmd[1] ); … … 552 552 if( md->handler->msglen <= 0 ) 553 553 { 554 hide_login_progress_error( gc, "Syntax error" );555 signoff( gc );554 hide_login_progress_error( ic, "Syntax error" ); 555 signoff( ic ); 556 556 return( 0 ); 557 557 } … … 563 563 564 564 g_snprintf( buf, sizeof( buf ), "Error reported by MSN server: %s", err->text ); 565 do_error_dialog( gc, buf, "MSN" );565 do_error_dialog( ic, buf, "MSN" ); 566 566 567 567 if( err->flags & STATUS_FATAL ) 568 568 { 569 signoff( gc );569 signoff( ic ); 570 570 return( 0 ); 571 571 } … … 581 581 static int msn_ns_message( gpointer data, char *msg, int msglen, char **cmd, int num_parts ) 582 582 { 583 struct gaim_connection *gc = data;583 struct im_connection *ic = data; 584 584 char *body; 585 585 int blen = 0; … … 617 617 { 618 618 if( arg1 ) 619 serv_got_crap( gc, "The server is going down for maintenance in %s minutes.", arg1 );619 serv_got_crap( ic, "The server is going down for maintenance in %s minutes.", arg1 ); 620 620 } 621 621 … … 634 634 if( inbox && folders ) 635 635 { 636 serv_got_crap( gc, "INBOX contains %s new messages, plus %s messages in other folders.", inbox, folders );636 serv_got_crap( ic, "INBOX contains %s new messages, plus %s messages in other folders.", inbox, folders ); 637 637 } 638 638 } … … 644 644 if( from && fromname ) 645 645 { 646 serv_got_crap( gc, "Received an e-mail message from %s <%s>.", fromname, from );646 serv_got_crap( ic, "Received an e-mail message from %s <%s>.", fromname, from ); 647 647 } 648 648 } … … 665 665 static void msn_auth_got_passport_id( struct passport_reply *rep ) 666 666 { 667 struct gaim_connection *gc = rep->data;668 struct msn_data *md = gc->proto_data;667 struct im_connection *ic = rep->data; 668 struct msn_data *md = ic->proto_data; 669 669 char *key = rep->result; 670 670 char buf[1024]; … … 677 677 rep->error_string ? rep->error_string : "Unknown error" ); 678 678 679 hide_login_progress( gc, err );680 signoff( gc );679 hide_login_progress( ic, err ); 680 signoff( ic ); 681 681 682 682 g_free( err ); … … 685 685 { 686 686 g_snprintf( buf, sizeof( buf ), "USR %d TWN S %s\r\n", ++md->trId, key ); 687 msn_write( gc, buf, strlen( buf ) );687 msn_write( ic, buf, strlen( buf ) ); 688 688 } 689 689 } -
protocols/msn/sb.c
rfa29d093 r0da65d5 48 48 } 49 49 50 struct msn_switchboard *msn_sb_create( struct gaim_connection *gc, char *host, int port, char *key, int session )51 { 52 struct msn_data *md = gc->proto_data;50 struct msn_switchboard *msn_sb_create( struct im_connection *ic, char *host, int port, char *key, int session ) 51 { 52 struct msn_data *md = ic->proto_data; 53 53 struct msn_switchboard *sb = g_new0( struct msn_switchboard, 1 ); 54 54 … … 60 60 } 61 61 62 sb-> gc = gc;62 sb->ic = ic; 63 63 sb->key = g_strdup( key ); 64 64 sb->session = session; … … 70 70 } 71 71 72 struct msn_switchboard *msn_sb_by_handle( struct gaim_connection *gc, char *handle )73 { 74 struct msn_data *md = gc->proto_data;72 struct msn_switchboard *msn_sb_by_handle( struct im_connection *ic, char *handle ) 73 { 74 struct msn_data *md = ic->proto_data; 75 75 struct msn_switchboard *sb; 76 76 GSList *l; … … 86 86 } 87 87 88 struct msn_switchboard *msn_sb_by_chat( struct conversation*c )89 { 90 struct msn_data *md = c-> gc->proto_data;88 struct msn_switchboard *msn_sb_by_chat( struct groupchat *c ) 89 { 90 struct msn_data *md = c->ic->proto_data; 91 91 struct msn_switchboard *sb; 92 92 GSList *l; … … 102 102 } 103 103 104 struct msn_switchboard *msn_sb_spare( struct gaim_connection *gc )105 { 106 struct msn_data *md = gc->proto_data;104 struct msn_switchboard *msn_sb_spare( struct im_connection *ic ) 105 { 106 struct msn_data *md = ic->proto_data; 107 107 struct msn_switchboard *sb; 108 108 GSList *l; … … 142 142 else 143 143 { 144 i = strlen( MSN_TYPING_HEADERS ) + strlen( sb-> gc->username );144 i = strlen( MSN_TYPING_HEADERS ) + strlen( sb->ic->username ); 145 145 buf = g_new0( char, i ); 146 i = g_snprintf( buf, i, MSN_TYPING_HEADERS, sb-> gc->username );146 i = g_snprintf( buf, i, MSN_TYPING_HEADERS, sb->ic->username ); 147 147 } 148 148 … … 177 177 } 178 178 179 struct conversation*msn_sb_to_chat( struct msn_switchboard *sb )180 { 181 struct gaim_connection *gc = sb->gc;179 struct groupchat *msn_sb_to_chat( struct msn_switchboard *sb ) 180 { 181 struct im_connection *ic = sb->ic; 182 182 char buf[1024]; 183 183 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, buf );186 sb->chat = serv_got_joined_chat( ic, buf ); 187 187 188 188 /* Populate the channel. */ 189 189 if( sb->who ) add_chat_buddy( sb->chat, sb->who ); 190 add_chat_buddy( sb->chat, gc->username );190 add_chat_buddy( sb->chat, ic->username ); 191 191 192 192 /* And make sure the switchboard doesn't look like a regular chat anymore. */ … … 202 202 void msn_sb_destroy( struct msn_switchboard *sb ) 203 203 { 204 struct gaim_connection *gc = sb->gc;205 struct msn_data *md = gc->proto_data;204 struct im_connection *ic = sb->ic; 205 struct msn_data *md = ic->proto_data; 206 206 207 207 debug( "Destroying switchboard: %s", sb->who ? sb->who : sb->key ? sb->key : "" ); … … 222 222 g_slist_free( sb->msgq ); 223 223 224 serv_got_crap( gc, "Warning: Closing down MSN switchboard connection with "224 serv_got_crap( ic, "Warning: Closing down MSN switchboard connection with " 225 225 "unsent message to %s, you'll have to resend it.", 226 226 sb->who ? sb->who : "(unknown)" ); … … 253 253 { 254 254 struct msn_switchboard *sb = data; 255 struct gaim_connection *gc;255 struct im_connection *ic; 256 256 struct msn_data *md; 257 257 char buf[1024]; … … 261 261 return FALSE; 262 262 263 gc = sb->gc;264 md = gc->proto_data;263 ic = sb->ic; 264 md = ic->proto_data; 265 265 266 266 if( source != sb->fd ) … … 280 280 281 281 if( sb->session == MSN_SB_NEW ) 282 g_snprintf( buf, sizeof( buf ), "USR %d %s %s\r\n", ++sb->trId, gc->username, sb->key );282 g_snprintf( buf, sizeof( buf ), "USR %d %s %s\r\n", ++sb->trId, ic->username, sb->key ); 283 283 else 284 g_snprintf( buf, sizeof( buf ), "ANS %d %s %s %d\r\n", ++sb->trId, gc->username, sb->key, sb->session );284 g_snprintf( buf, sizeof( buf ), "ANS %d %s %s %d\r\n", ++sb->trId, ic->username, sb->key, sb->session ); 285 285 286 286 if( msn_sb_write( sb, buf, strlen( buf ) ) ) … … 310 310 { 311 311 struct msn_switchboard *sb = data; 312 struct gaim_connection *gc = sb->gc;312 struct im_connection *ic = sb->ic; 313 313 char buf[1024]; 314 314 … … 321 321 if( strcmp( cmd[0], "XFR" ) == 0 ) 322 322 { 323 hide_login_progress_error( gc, "Received an XFR from a switchboard server, unable to comply! This is likely to be a bug, please report it!" );324 signoff( gc );323 hide_login_progress_error( ic, "Received an XFR from a switchboard server, unable to comply! This is likely to be a bug, please report it!" ); 324 signoff( ic ); 325 325 return( 0 ); 326 326 } … … 374 374 { 375 375 g_snprintf( buf, sizeof( buf ), "MSN groupchat session %d", sb->session ); 376 sb->chat = serv_got_joined_chat( gc, buf );376 sb->chat = serv_got_joined_chat( ic, buf ); 377 377 378 378 g_free( sb->who ); … … 384 384 if( num == tot ) 385 385 { 386 add_chat_buddy( sb->chat, gc->username );386 add_chat_buddy( sb->chat, ic->username ); 387 387 } 388 388 } … … 529 529 530 530 g_snprintf( buf, sizeof( buf ), "Error reported by switchboard server: %s", err->text ); 531 do_error_dialog( gc, buf, "MSN" );531 do_error_dialog( ic, buf, "MSN" ); 532 532 533 533 if( err->flags & STATUS_SB_FATAL ) … … 538 538 else if( err->flags & STATUS_FATAL ) 539 539 { 540 signoff( gc );540 signoff( ic ); 541 541 return 0; 542 542 } … … 579 579 { 580 580 struct msn_switchboard *sb = data; 581 struct gaim_connection *gc = sb->gc;581 struct im_connection *ic = sb->ic; 582 582 char *body; 583 583 int blen = 0; … … 608 608 if( sb->who ) 609 609 { 610 serv_got_im( gc, cmd[1], body, 0, 0, blen );610 serv_got_im( ic, cmd[1], body, 0, 0, blen ); 611 611 } 612 612 else if( sb->chat ) … … 667 667 if( sb->who ) 668 668 { 669 serv_got_im( gc, cmd[1], buf, 0, 0, strlen( buf ) );669 serv_got_im( ic, cmd[1], buf, 0, 0, strlen( buf ) ); 670 670 } 671 671 else if( sb->chat ) … … 684 684 if( who ) 685 685 { 686 serv_got_typing( gc, who, 5, 1 );686 serv_got_typing( ic, who, 5, 1 ); 687 687 g_free( who ); 688 688 }
Note: See TracChangeset
for help on using the changeset viewer.