Changeset 62a2bf9 for protocols/skype/skype.c
- Timestamp:
- 2013-01-05T13:47:56Z (11 years ago)
- Branches:
- master
- Children:
- cfbecc9
- Parents:
- e6298e5 (diff), 757e1e0 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the(diff)
links above to see all the changes relative to each parent. - File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
protocols/skype/skype.c
re6298e5 r62a2bf9 2 2 * skype.c - Skype plugin for BitlBee 3 3 * 4 * Copyright (c) 2007 , 2008, 2009, 2010, 2011, 2012by Miklos Vajna <vmiklos@frugalware.org>4 * Copyright (c) 2007-2013 by Miklos Vajna <vmiklos@frugalware.org> 5 5 * 6 6 * This program is free software; you can redistribute it and/or modify … … 214 214 bla->handle = g_strdup(handle); 215 215 216 buf = g_strdup_printf("The user %s wants to add you to " 217 "his/her buddy list, saying: '%s'.", handle, message); 216 buf = g_strdup_printf("The user %s wants to add you to his/her buddy list, saying: '%s'.", handle, message); 218 217 imcb_ask(ic, buf, bla, skype_buddy_ask_yes, skype_buddy_ask_no); 219 218 g_free(buf); … … 409 408 g_string_free(st, TRUE); 410 409 } 411 } 412 else if (!strncmp(ptr, "BIRTHDAY ", 9)) { 410 } else if (!strncmp(ptr, "BIRTHDAY ", 9)) { 413 411 sd->info_birthday = g_strdup(ptr + 9); 414 412 … … 566 564 } 567 565 566 static void skype_parse_chatmessage_said_emoted(struct im_connection *ic, struct groupchat *gc, char *body) 567 { 568 struct skype_data *sd = ic->proto_data; 569 char buf[IRC_LINE_SIZE]; 570 if (!strcmp(sd->type, "SAID")) { 571 if (!sd->is_edit) 572 g_snprintf(buf, IRC_LINE_SIZE, "%s", body); 573 else { 574 g_snprintf(buf, IRC_LINE_SIZE, "%s %s", set_getstr(&ic->acc->set, "edit_prefix"), body); 575 sd->is_edit = 0; 576 } 577 } else 578 g_snprintf(buf, IRC_LINE_SIZE, "/me %s", body); 579 if (!gc) 580 /* Private message */ 581 imcb_buddy_msg(ic, sd->handle, buf, 0, 0); 582 else 583 /* Groupchat message */ 584 imcb_chat_msg(gc, sd->handle, buf, 0, 0); 585 } 586 568 587 static void skype_parse_chatmessage(struct im_connection *ic, char *line) 569 588 { 570 589 struct skype_data *sd = ic->proto_data; 571 char buf[IRC_LINE_SIZE];572 590 char *id = strchr(line, ' '); 573 591 … … 627 645 if (!strcmp(sd->type, "SAID") || 628 646 !strcmp(sd->type, "EMOTED")) { 629 if (!strcmp(sd->type, "SAID")) { 630 if (!sd->is_edit) 631 g_snprintf(buf, IRC_LINE_SIZE, "%s", 632 body); 633 else { 634 g_snprintf(buf, IRC_LINE_SIZE, "%s %s", 635 set_getstr(&ic->acc->set, "edit_prefix"), 636 body); 637 sd->is_edit = 0; 638 } 639 } else 640 g_snprintf(buf, IRC_LINE_SIZE, "/me %s", 641 body); 642 if (!gc) 643 /* Private message */ 644 imcb_buddy_msg(ic, 645 sd->handle, buf, 0, 0); 646 else 647 /* Groupchat message */ 648 imcb_chat_msg(gc, 649 sd->handle, buf, 0, 0); 647 skype_parse_chatmessage_said_emoted(ic, gc, body); 650 648 } else if (!strcmp(sd->type, "SETTOPIC") && gc) 651 649 imcb_chat_topic(gc, … … 716 714 case SKYPE_CALL_RINGING: 717 715 if (sd->call_out) 718 imcb_log(ic, "You are currently ringing " 719 "the user %s.", info); 716 imcb_log(ic, "You are currently ringing the user %s.", info); 720 717 else { 721 718 g_snprintf(buf, IRC_LINE_SIZE, … … 1231 1228 skype_printf(ic, "SET USERSTATUS OFFLINE\n"); 1232 1229 1233 while ( ic->groupchats)1230 while (ic->groupchats) 1234 1231 imcb_chat_free(ic->groupchats->data); 1235 1232 … … 1319 1316 1320 1317 skype_printf(ic, "SET PROFILE FULLNAME %s", value); 1318 return value; 1319 } 1320 1321 static char *skype_set_mood_text(set_t *set, char *value) 1322 { 1323 account_t *acc = set->data; 1324 struct im_connection *ic = acc->ic; 1325 1326 skype_printf(ic, "SET PROFILE MOOD_TEXT %s", value); 1321 1327 return value; 1322 1328 } … … 1514 1520 s->flags |= ACC_SET_NOSAVE | ACC_SET_ONLINE_ONLY; 1515 1521 1522 s = set_add(&acc->set, "mood_text", NULL, skype_set_mood_text, acc); 1523 s->flags |= ACC_SET_NOSAVE | ACC_SET_ONLINE_ONLY; 1524 1516 1525 s = set_add(&acc->set, "call", NULL, skype_set_call, acc); 1517 1526 s->flags |= ACC_SET_NOSAVE | ACC_SET_ONLINE_ONLY;
Note: See TracChangeset
for help on using the changeset viewer.