Changeset 2a0f99c
- Timestamp:
- 2007-10-06T22:23:49Z (17 years ago)
- Branches:
- master
- Children:
- 31870ae
- Parents:
- 349ee4a
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
skype/skype.c
r349ee4a r2a0f99c 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 body and64 * the chatname. Store the handle and the body here so that we63 /* When we receive a new message id, we query the properties, finally 64 * the chatname. Store the properties here so that we can use 65 65 * imcb_buddy_msg() when we got the chatname. */ 66 66 char *handle; 67 67 char *body; 68 char *type; 68 69 /* This is necessary because we send a notification when we get the 69 70 * handle. So we store the state here and then we can send a … … 272 273 * (1) Request its from field 273 274 * (2) Request its body 274 * (3) Query chatname 275 * (3) Request its type 276 * (4) Query chatname 275 277 */ 276 278 g_snprintf(buf, 1024, "GET CHATMESSAGE %s FROM_HANDLE\n", id); 277 279 skype_write( ic, buf, strlen( buf ) ); 278 280 g_snprintf(buf, 1024, "GET CHATMESSAGE %s BODY\n", id); 281 skype_write( ic, buf, strlen( buf ) ); 282 g_snprintf(buf, 1024, "GET CHATMESSAGE %s TYPE\n", id); 279 283 skype_write( ic, buf, strlen( buf ) ); 280 284 g_snprintf(buf, 1024, "GET CHATMESSAGE %s CHATNAME\n", id); … … 308 312 sd->body = g_strdup(info); 309 313 } 314 else if(!strncmp(info, "TYPE ", 5)) 315 { 316 info += 5; 317 g_free(sd->type); 318 sd->type = g_strdup(info); 319 } 310 320 else if(!strncmp(info, "CHATNAME ", 9)) 311 321 { 312 322 info += 9; 313 if(sd->handle && sd->body && s trlen(info))323 if(sd->handle && sd->body && sd->type) 314 324 { 315 struct groupchat *gc = skype_chat_by_name(ic, info); 316 if(!gc) 317 /* Private message */ 318 imcb_buddy_msg(ic, sd->handle, sd->body, 0, 0); 319 else 320 /* Groupchat message */ 321 imcb_chat_msg(gc, sd->handle, sd->body, 0, 0); 325 if(!strcmp(sd->type, "SAID")) 326 { 327 struct groupchat *gc = skype_chat_by_name(ic, info); 328 if(!gc) 329 /* Private message */ 330 imcb_buddy_msg(ic, sd->handle, sd->body, 0, 0); 331 else 332 /* Groupchat message */ 333 imcb_chat_msg(gc, sd->handle, sd->body, 0, 0); 334 } 335 else if(!strcmp(sd->type, "SETTOPIC")) 336 { 337 struct groupchat *gc = skype_chat_by_name(ic, info); 338 if(gc) 339 imcb_log(ic, "%s changed the topic of %s to: %s", sd->handle, gc->title, sd->body); 340 } 322 341 } 323 342 }
Note: See TracChangeset
for help on using the changeset viewer.