libpurple/protocols/irc/irc.c

changeset 40708
53a26c29d26c
parent 40697
81f81f5d2f39
child 40765
a5381c20e802
equal deleted inserted replaced
40707:f84f2b4ef0e5 40708:53a26c29d26c
219 purple_notify_formatted(gc, title, title, NULL, body, NULL, NULL); 219 purple_notify_formatted(gc, title, title, NULL, body, NULL, NULL);
220 g_free(title); 220 g_free(title);
221 g_free(body); 221 g_free(body);
222 } 222 }
223 223
224 static int irc_send_raw(PurpleConnection *gc, const char *buf, int len) 224 static int
225 irc_send_raw(PurpleProtocolServer *protocol_server, PurpleConnection *gc,
226 const gchar *buf, gint len)
225 { 227 {
226 struct irc_conn *irc = purple_connection_get_protocol_data(gc); 228 struct irc_conn *irc = purple_connection_get_protocol_data(gc);
227 if (len == -1) { 229 if (len == -1) {
228 len = strlen(buf); 230 len = strlen(buf);
229 } 231 }
642 irc_cmd_privmsg(irc, "msg", NULL, args); 644 irc_cmd_privmsg(irc, "msg", NULL, args);
643 g_free(plain); 645 g_free(plain);
644 return 1; 646 return 1;
645 } 647 }
646 648
647 static void irc_get_info(PurpleConnection *gc, const char *who) 649 static void
650 irc_get_info(PurpleProtocolServer *protocol_server, PurpleConnection *gc,
651 const gchar *who)
648 { 652 {
649 struct irc_conn *irc = purple_connection_get_protocol_data(gc); 653 struct irc_conn *irc = purple_connection_get_protocol_data(gc);
650 const char *args[2]; 654 const char *args[2];
651 args[0] = who; 655 args[0] = who;
652 args[1] = NULL; 656 args[1] = NULL;
653 irc_cmd_whois(irc, "whois", NULL, args); 657 irc_cmd_whois(irc, "whois", NULL, args);
654 } 658 }
655 659
656 static void irc_set_status(PurpleAccount *account, PurpleStatus *status) 660 static void
661 irc_set_status(PurpleProtocolServer *protocol_server, PurpleAccount *account,
662 PurpleStatus *status)
657 { 663 {
658 PurpleConnection *gc = purple_account_get_connection(account); 664 PurpleConnection *gc = purple_account_get_connection(account);
659 struct irc_conn *irc; 665 struct irc_conn *irc;
660 const char *args[1]; 666 const char *args[1];
661 const char *status_id = purple_status_get_id(status); 667 const char *status_id = purple_status_get_id(status);
676 } else if (purple_strequal(status_id, "available")) { 682 } else if (purple_strequal(status_id, "available")) {
677 irc_cmd_away(irc, "back", NULL, args); 683 irc_cmd_away(irc, "back", NULL, args);
678 } 684 }
679 } 685 }
680 686
681 static void irc_add_buddy(PurpleConnection *gc, PurpleBuddy *buddy, PurpleGroup *group, const char *message) 687 static void
688 irc_add_buddy(PurpleProtocolServer *protocol_server, PurpleConnection *gc,
689 PurpleBuddy *buddy, PurpleGroup *group, const gchar *message)
682 { 690 {
683 struct irc_conn *irc = purple_connection_get_protocol_data(gc); 691 struct irc_conn *irc = purple_connection_get_protocol_data(gc);
684 struct irc_buddy *ib; 692 struct irc_buddy *ib;
685 const char *bname = purple_buddy_get_name(buddy); 693 const char *bname = purple_buddy_get_name(buddy);
686 694
701 * someone's online asap */ 709 * someone's online asap */
702 if (irc->timer) 710 if (irc->timer)
703 irc_ison_one(irc, ib); 711 irc_ison_one(irc, ib);
704 } 712 }
705 713
706 static void irc_remove_buddy(PurpleConnection *gc, PurpleBuddy *buddy, PurpleGroup *group) 714 static void
715 irc_remove_buddy(PurpleProtocolServer *protocol_server, PurpleConnection *gc,
716 PurpleBuddy *buddy, PurpleGroup *group)
707 { 717 {
708 struct irc_conn *irc = purple_connection_get_protocol_data(gc); 718 struct irc_conn *irc = purple_connection_get_protocol_data(gc);
709 struct irc_buddy *ib; 719 struct irc_buddy *ib;
710 720
711 ib = g_hash_table_lookup(irc->buddies, purple_buddy_get_name(buddy)); 721 ib = g_hash_table_lookup(irc->buddies, purple_buddy_get_name(buddy));
934 irc->roomlist = NULL; 944 irc->roomlist = NULL;
935 g_object_unref(list); 945 g_object_unref(list);
936 } 946 }
937 } 947 }
938 948
939 static void irc_keepalive(PurpleConnection *gc) 949 static void
940 { 950 irc_keepalive(PurpleProtocolServer *protocol_server, PurpleConnection *gc) {
941 struct irc_conn *irc = purple_connection_get_protocol_data(gc); 951 struct irc_conn *irc = purple_connection_get_protocol_data(gc);
942 if ((time(NULL) - irc->recv_time) > PING_TIMEOUT) 952 if ((time(NULL) - irc->recv_time) > PING_TIMEOUT)
943 irc_cmd_ping(irc, NULL, NULL, NULL); 953 irc_cmd_ping(irc, NULL, NULL, NULL);
944 } 954 }
945 955

mercurial