comparison libpurple/protocols/jabber/jabber.c @ 25144:9ab681f23007

propagate from branch 'im.pidgin.pidgin' (head c36cf6e54e25bff1ff7802082ae3c787d658187c) to branch 'org.darkrain42.pidgin.xmpp' (head 92d6837c02024957e64a843d1b409cf944cc89fc)
author Paul Aurich <paul@darkrain42.org>
date Thu, 20 Nov 2008 21:57:52 +0000
parents 907ca9a36fe0 3a3d36791a47
children 1225f3dcf5ab
comparison
equal deleted inserted replaced
25125:907ca9a36fe0 25144:9ab681f23007
41 41
42 #include "caps.h" 42 #include "caps.h"
43 #include "auth.h" 43 #include "auth.h"
44 #include "buddy.h" 44 #include "buddy.h"
45 #include "chat.h" 45 #include "chat.h"
46 #include "data.h"
46 #include "disco.h" 47 #include "disco.h"
47 #include "google.h" 48 #include "google.h"
48 #include "iq.h" 49 #include "iq.h"
49 #include "jutil.h" 50 #include "jutil.h"
50 #include "message.h" 51 #include "message.h"
56 #include "si.h" 57 #include "si.h"
57 #include "xdata.h" 58 #include "xdata.h"
58 #include "pep.h" 59 #include "pep.h"
59 #include "adhoccommands.h" 60 #include "adhoccommands.h"
60 61
62
61 #define JABBER_CONNECT_STEPS (js->gsc ? 9 : 5) 63 #define JABBER_CONNECT_STEPS (js->gsc ? 9 : 5)
62 64
63 static PurplePlugin *my_protocol = NULL; 65 static PurplePlugin *my_protocol = NULL;
64 66
65 GList *jabber_features = NULL; 67 GList *jabber_features = NULL;
132 PURPLE_CONNECTION_ERROR_NETWORK_ERROR, 134 PURPLE_CONNECTION_ERROR_NETWORK_ERROR,
133 _("Invalid response from server.")); 135 _("Invalid response from server."));
134 } 136 }
135 if((my_jb = jabber_buddy_find(js, full_jid, TRUE))) 137 if((my_jb = jabber_buddy_find(js, full_jid, TRUE)))
136 my_jb->subscription |= JABBER_SUB_BOTH; 138 my_jb->subscription |= JABBER_SUB_BOTH;
139
140 purple_connection_set_display_name(js->gc, full_jid);
141
137 g_free(full_jid); 142 g_free(full_jid);
138 } 143 }
139 } else { 144 } else {
140 PurpleConnectionError reason = PURPLE_CONNECTION_ERROR_NETWORK_ERROR; 145 PurpleConnectionError reason = PURPLE_CONNECTION_ERROR_NETWORK_ERROR;
141 char *msg = jabber_parse_error(js, packet, &reason); 146 char *msg = jabber_parse_error(js, packet, &reason);
691 const char *connect_server = purple_account_get_string(account, 696 const char *connect_server = purple_account_get_string(account,
692 "connect_server", ""); 697 "connect_server", "");
693 JabberStream *js; 698 JabberStream *js;
694 JabberBuddy *my_jb = NULL; 699 JabberBuddy *my_jb = NULL;
695 700
696 gc->flags |= PURPLE_CONNECTION_HTML; 701 gc->flags |= PURPLE_CONNECTION_HTML |
702 PURPLE_CONNECTION_ALLOW_CUSTOM_SMILEY;
697 js = gc->proto_data = g_new0(JabberStream, 1); 703 js = gc->proto_data = g_new0(JabberStream, 1);
698 js->gc = gc; 704 js->gc = gc;
699 js->fd = -1; 705 js->fd = -1;
700 js->iq_callbacks = g_hash_table_new_full(g_str_hash, g_str_equal, 706 js->iq_callbacks = g_hash_table_new_full(g_str_hash, g_str_equal,
701 g_free, g_free); 707 g_free, g_free);
1373 g_free(sh->zeroconf); 1379 g_free(sh->zeroconf);
1374 g_free(sh); 1380 g_free(sh);
1375 js->bs_proxies = g_list_delete_link(js->bs_proxies, js->bs_proxies); 1381 js->bs_proxies = g_list_delete_link(js->bs_proxies, js->bs_proxies);
1376 } 1382 }
1377 1383
1384 while(js->url_datas) {
1385 purple_util_fetch_url_cancel(js->url_datas->data);
1386 js->url_datas = g_slist_delete_link(js->url_datas, js->url_datas);
1387 }
1388
1378 g_free(js->stream_id); 1389 g_free(js->stream_id);
1379 if(js->user) 1390 if(js->user)
1380 jabber_id_free(js->user); 1391 jabber_id_free(js->user);
1381 g_free(js->avatar_hash); 1392 g_free(js->avatar_hash);
1382 1393
1786 "message", _("Message"), purple_value_new(PURPLE_TYPE_STRING), 1797 "message", _("Message"), purple_value_new(PURPLE_TYPE_STRING),
1787 NULL); 1798 NULL);
1788 types = g_list_append(types, type); 1799 types = g_list_append(types, type);
1789 1800
1790 type = purple_status_type_new_with_attrs(PURPLE_STATUS_TUNE, 1801 type = purple_status_type_new_with_attrs(PURPLE_STATUS_TUNE,
1791 "tune", NULL, TRUE, TRUE, TRUE, 1802 "tune", NULL, FALSE, TRUE, TRUE,
1792 PURPLE_TUNE_ARTIST, _("Tune Artist"), purple_value_new(PURPLE_TYPE_STRING), 1803 PURPLE_TUNE_ARTIST, _("Tune Artist"), purple_value_new(PURPLE_TYPE_STRING),
1793 PURPLE_TUNE_TITLE, _("Tune Title"), purple_value_new(PURPLE_TYPE_STRING), 1804 PURPLE_TUNE_TITLE, _("Tune Title"), purple_value_new(PURPLE_TYPE_STRING),
1794 PURPLE_TUNE_ALBUM, _("Tune Album"), purple_value_new(PURPLE_TYPE_STRING), 1805 PURPLE_TUNE_ALBUM, _("Tune Album"), purple_value_new(PURPLE_TYPE_STRING),
1795 PURPLE_TUNE_GENRE, _("Tune Genre"), purple_value_new(PURPLE_TYPE_STRING), 1806 PURPLE_TUNE_GENRE, _("Tune Genre"), purple_value_new(PURPLE_TYPE_STRING),
1796 PURPLE_TUNE_COMMENT, _("Tune Comment"), purple_value_new(PURPLE_TYPE_STRING), 1807 PURPLE_TUNE_COMMENT, _("Tune Comment"), purple_value_new(PURPLE_TYPE_STRING),
1962 { 1973 {
1963 JabberStream *js = gc->proto_data; 1974 JabberStream *js = gc->proto_data;
1964 JabberID *jid; 1975 JabberID *jid;
1965 JabberBuddy *jb; 1976 JabberBuddy *jb;
1966 JabberBuddyResource *jbr; 1977 JabberBuddyResource *jbr;
1967 1978
1968 if(!(jid = jabber_id_new(who))) 1979 if(!(jid = jabber_id_new(who)))
1969 return; 1980 return;
1970 1981
1971 if((jb = jabber_buddy_find(js, who, TRUE)) && 1982 if((jb = jabber_buddy_find(js, who, TRUE)) &&
1972 (jbr = jabber_buddy_find_resource(jb, jid->resource))) { 1983 (jbr = jabber_buddy_find_resource(jb, jid->resource))) {