Changeset c81d0ef for skype/skype.c
- Timestamp:
- 2007-10-06T20:28:44Z (17 years ago)
- Branches:
- master
- Children:
- 548bf76
- Parents:
- 3ef1910
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
skype/skype.c
r3ef1910 rc81d0ef 61 61 * we're connected and when we aren't. */ 62 62 int bfd; 63 /* When we receive a new message id, we query the handle, the n the64 * body. Store the handle here so that we imcb_buddy_msg() when we got65 * the body. */63 /* When we receive a new message id, we query the handle, the body and 64 * the chatname. Store the handle and the body here so that we 65 * imcb_buddy_msg() when we got the chatname. */ 66 66 char *handle; 67 char *body; 67 68 /* This is necessary because we send a notification when we get the 68 69 * handle. So we store the state here and then we can send a … … 271 272 * (1) Request its from field 272 273 * (2) Request its body 274 * (3) Query chatname 273 275 */ 274 276 g_snprintf(buf, 1024, "GET CHATMESSAGE %s FROM_HANDLE\n", id); 275 277 skype_write( ic, buf, strlen( buf ) ); 276 278 g_snprintf(buf, 1024, "GET CHATMESSAGE %s BODY\n", id); 279 skype_write( ic, buf, strlen( buf ) ); 280 g_snprintf(buf, 1024, "GET CHATMESSAGE %s CHATNAME\n", id); 277 281 skype_write( ic, buf, strlen( buf ) ); 278 282 } … … 301 305 { 302 306 info += 5; 303 if(sd->handle && strlen(info)) 307 g_free(sd->body); 308 sd->body = g_strdup(info); 309 } 310 else if(!strncmp(info, "CHATNAME ", 9)) 311 { 312 info += 9; 313 if(sd->handle && sd->body && strlen(info)) 304 314 { 305 /* New body, we have everything to use imcb_buddy_msg() now! */ 306 imcb_buddy_msg(ic, sd->handle, info, 0, 0); 315 struct groupchat *gc = skype_chat_by_name(ic, info); 316 if(!gc) 317 { 318 printf("gc is null, id is '%s'\n", info); 319 /* Private message */ 320 imcb_buddy_msg(ic, sd->handle, sd->body, 0, 0); 321 } 322 else 323 { 324 printf("gc is not null, id is '%s'\n", info); 325 imcb_chat_msg(gc, sd->handle, sd->body, 0, 0); 326 } 307 327 } 308 328 } … … 572 592 } 573 593 574 intskype_chat_msg( struct groupchat *c, char *message, int flags )594 void skype_chat_msg( struct groupchat *c, char *message, int flags ) 575 595 { 576 596 // TODO: this is just here atm to prevent a segfault
Note: See TracChangeset
for help on using the changeset viewer.