Changeset 208db4b
- Timestamp:
- 2012-09-29T19:38:18Z (12 years ago)
- Branches:
- master
- Children:
- 4c9d377
- Parents:
- 3901b5d
- Location:
- protocols/msn
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
protocols/msn/msn.c
r3901b5d r208db4b 140 140 static int msn_buddy_msg( struct im_connection *ic, char *who, char *message, int away ) 141 141 { 142 struct bee_user *bu = bee_user_by_handle( ic->bee, ic, who ); 143 struct msn_buddy_data *bd = bu ? bu->data : NULL; 142 144 struct msn_switchboard *sb; 143 145 … … 149 151 else 150 152 #endif 151 if( ( sb = msn_sb_by_handle( ic, who ) ) ) 153 if( bd && bd->flags & MSN_BUDDY_FED ) 154 { 155 msn_ns_sendmessage( ic, bu, message ); 156 } 157 else if( ( sb = msn_sb_by_handle( ic, who ) ) ) 152 158 { 153 159 return( msn_sb_sendmessage( sb, message ) ); … … 355 361 { 356 362 struct msn_data *md = bu->ic->proto_data; 357 bu->data = g_new0( struct msn_buddy_data, 1 ); 363 struct msn_buddy_data *bd; 364 char *handle; 365 366 bd = bu->data = g_new0( struct msn_buddy_data, 1 ); 358 367 g_tree_insert( md->domaintree, bu->handle, bu ); 368 369 for( handle = bu->handle; isdigit( *handle ); handle ++ ); 370 if( *handle == ':' ) 371 { 372 /* Pass a nick hint so hopefully the stupid numeric prefix 373 won't show up to the user. */ 374 char *s = strchr( ++handle, '@' ); 375 if( s ) 376 { 377 handle = g_strndup( handle, s - handle ); 378 imcb_buddy_nick_hint( bu->ic, bu->handle, handle ); 379 g_free( handle ); 380 } 381 382 bd->flags |= MSN_BUDDY_FED; 383 } 359 384 } 360 385 -
protocols/msn/msn.h
r3901b5d r208db4b 198 198 MSN_BUDDY_PL = 16, 199 199 MSN_BUDDY_ADL_SYNCED = 256, 200 MSN_BUDDY_FED = 512, 200 201 } msn_buddy_flags_t; 201 202 -
protocols/msn/ns.c
r3901b5d r208db4b 972 972 { 973 973 struct msn_data *md = ic->proto_data; 974 char *buf; 974 int type = 0; 975 char *buf, *handle; 975 976 976 977 if( strncmp( text, "\r\r\r", 3 ) == 0 ) … … 979 980 return 1; 980 981 982 /* This might be a federated contact. Get its network number, 983 prefixed to bu->handle with a colon. Default is 1. */ 984 for( handle = bu->handle; isdigit( *handle ); handle ++ ) 985 type = type * 10 + *handle - '0'; 986 if( *handle == ':' ) 987 handle ++; 988 else 989 type = 1; 990 981 991 buf = g_strdup_printf( "%s%s", MSN_MESSAGE_HEADERS, text ); 982 992 983 993 if( msn_ns_write( ic, -1, "UUM %d %s %d %d %zd\r\n%s", 984 ++md->trId, bu->handle, 985 1, /* type == MSN (offline) message */ 994 ++md->trId, handle, type, 986 995 1, /* type == IM (not nudge/typing) */ 987 996 strlen( buf ), buf ) )
Note: See TracChangeset
for help on using the changeset viewer.