- Timestamp:
- 2015-03-12T09:10:16Z (10 years ago)
- Children:
- fc650a8
- Parents:
- 0e4c3dd (diff), 3bb333c (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. - Location:
- protocols
- Files:
-
- 1 added
- 17 edited
Legend:
- Unmodified
- Added
- Removed
-
protocols/bee.h
r0e4c3dd r89db90e 154 154 G_MODULE_EXPORT void imcb_buddy_times(struct im_connection *ic, const char *handle, time_t login, time_t idle); 155 155 /* Call when a handle says something. 'flags' and 'sent_at may be just 0. */ 156 G_MODULE_EXPORT void imcb_buddy_msg(struct im_connection *ic, const char *handle, c har *msg, guint32 flags,156 G_MODULE_EXPORT void imcb_buddy_msg(struct im_connection *ic, const char *handle, const char *msg, guint32 flags, 157 157 time_t sent_at); 158 158 -
protocols/bee_user.c
r0e4c3dd r89db90e 68 68 } 69 69 70 bee->users = g_slist_remove(bee->users, bu); 71 70 72 g_free(bu->handle); 71 73 g_free(bu->fullname); … … 74 76 g_free(bu->status_msg); 75 77 g_free(bu); 76 77 bee->users = g_slist_remove(bee->users, bu);78 78 79 79 return 1; … … 247 247 } 248 248 249 void imcb_buddy_msg(struct im_connection *ic, const char *handle, c har *msg, uint32_t flags, time_t sent_at)249 void imcb_buddy_msg(struct im_connection *ic, const char *handle, const char *msg, uint32_t flags, time_t sent_at) 250 250 { 251 251 bee_t *bee = ic->bee; -
protocols/jabber/s5bytestream.c
r0e4c3dd r89db90e 23 23 24 24 #include "jabber.h" 25 #include "sha1.h"26 25 #include "lib/ftutil.h" 27 26 #include <poll.h> … … 42 41 43 42 /* SHA1( SID + Initiator JID + Target JID) */ 44 char *pseudoad r;43 char *pseudoaddr; 45 44 46 45 gint connect_timeout; … … 130 129 } 131 130 132 g_free(bt->pseudoad r);131 g_free(bt->pseudoaddr); 133 132 134 133 while (bt->streamhosts) { … … 254 253 } 255 254 255 void jabber_bs_remove_events(struct bs_transfer *bt) 256 { 257 struct jabber_transfer *tf = bt->tf; 258 259 if (tf->watch_out) { 260 b_event_remove(tf->watch_out); 261 tf->watch_out = 0; 262 } 263 264 if (tf->watch_in) { 265 b_event_remove(tf->watch_in); 266 tf->watch_in = 0; 267 } 268 269 if (tf->fd != -1) { 270 closesocket(tf->fd); 271 tf->fd = -1; 272 } 273 274 if (bt->connect_timeout) { 275 b_event_remove(bt->connect_timeout); 276 bt->connect_timeout = 0; 277 } 278 } 279 256 280 /* Bad luck */ 257 281 void jabber_bs_canceled(file_transfer_t *ft, char *reason) … … 260 284 261 285 imcb_log(tf->ic, "File transfer aborted: %s", reason); 286 } 287 288 static struct jabber_transfer *get_ft_by_sid(GSList *tflist, char *sid) { 289 GSList *l; 290 for (l = tflist; l; l = g_slist_next(l)) { 291 struct jabber_transfer *tft = l->data; 292 if ((strcmp(tft->sid, sid) == 0)) { 293 return tft; 294 } 295 } 296 return NULL; 297 } 298 299 /* SHA1( SID + Initiator JID + Target JID ) is given to the streamhost which it will match against the initiator's value 300 * Returns a newly allocated string */ 301 static char *generate_pseudoaddr(char *sid, char *ini_jid, char *tgt_jid) { 302 char *contents = g_strconcat(sid, ini_jid, tgt_jid, NULL); 303 char *hash_hex = g_compute_checksum_for_string(G_CHECKSUM_SHA1, contents, -1); 304 g_free(contents); 305 return hash_hex; 306 } 307 308 static jabber_streamhost_t *jabber_streamhost_new(char *jid, char *host, int port) 309 { 310 jabber_streamhost_t *sh = g_new0(jabber_streamhost_t, 1); 311 sh->jid = g_strdup(jid); 312 sh->host = g_strdup(host); 313 if (port) { 314 g_snprintf(sh->port, sizeof(sh->port), "%u", port); 315 } 316 return sh; 262 317 } 263 318 … … 270 325 struct jabber_data *jd = ic->proto_data; 271 326 struct jabber_transfer *tf = NULL; 272 GSList *tflist;273 327 struct bs_transfer *bt; 274 328 GSList *shlist = NULL; 275 329 struct xt_node *shnode; 276 277 sha1_state_t sha;278 char hash_hex[41];279 unsigned char hash[20];280 int i;281 330 282 331 if (!(iq_id = xt_find_attr(node, "id")) || … … 303 352 (port_s = xt_find_attr(shnode, "port")) && 304 353 (sscanf(port_s, "%d", &port) == 1)) { 305 jabber_streamhost_t *sh = g_new0(jabber_streamhost_t, 1); 306 sh->jid = g_strdup(jid); 307 sh->host = g_strdup(host); 308 sprintf(sh->port, "%u", port); 309 shlist = g_slist_append(shlist, sh); 354 shlist = g_slist_append(shlist, jabber_streamhost_new(jid, host, port)); 310 355 } 311 356 shnode = shnode->next; … … 317 362 } 318 363 319 /* Let's see if we can find out what this bytestream should be for... */ 320 321 for (tflist = jd->filetransfers; tflist; tflist = g_slist_next(tflist)) { 322 struct jabber_transfer *tft = tflist->data; 323 if ((strcmp(tft->sid, sid) == 0) && 324 (strcmp(tft->ini_jid, ini_jid) == 0) && 325 (strcmp(tft->tgt_jid, tgt_jid) == 0)) { 326 tf = tft; 327 break; 328 } 329 } 330 331 if (!tf) { 364 if (!(tf = get_ft_by_sid(jd->filetransfers, sid))) { 332 365 imcb_log(ic, "WARNING: Received bytestream request from %s that doesn't match an SI request", ini_jid); 333 366 return XT_HANDLED; … … 339 372 340 373 tf->ft->canceled = jabber_bs_canceled; 341 342 /* SHA1( SID + Initiator JID + Target JID ) is given to the streamhost which it will match against the initiator's value */343 sha1_init(&sha);344 sha1_append(&sha, (unsigned char *) sid, strlen(sid));345 sha1_append(&sha, (unsigned char *) ini_jid, strlen(ini_jid));346 sha1_append(&sha, (unsigned char *) tgt_jid, strlen(tgt_jid));347 sha1_finish(&sha, hash);348 349 for (i = 0; i < 20; i++) {350 sprintf(hash_hex + i * 2, "%02x", hash[i]);351 }352 374 353 375 bt = g_new0(struct bs_transfer, 1); … … 356 378 bt->sh = shlist->data; 357 379 bt->phase = BS_PHASE_CONNECT; 358 bt->pseudoad r = g_strdup(hash_hex);380 bt->pseudoaddr = generate_pseudoaddr(sid, ini_jid, tgt_jid); 359 381 tf->streamhandle = bt; 360 382 tf->ft->free = jabber_bs_free_transfer; … … 451 473 .rsv = 0, 452 474 .atyp = 0x03, 453 .addrlen = strlen(bt->pseudoad r),475 .addrlen = strlen(bt->pseudoaddr), 454 476 .port = 0 455 477 }; … … 468 490 469 491 /* copy hash into connect message */ 470 memcpy(socks5_connect.address, bt->pseudoad r, socks5_connect.addrlen);492 memcpy(socks5_connect.address, bt->pseudoaddr, socks5_connect.addrlen); 471 493 472 494 ASSERTSOCKOP(send(fd, &socks5_connect, sizeof(struct socks5_message), 0), "Sending SOCKS5 Connect"); … … 558 580 if (shlist && shlist->next) { 559 581 bt->sh = shlist->next->data; 582 jabber_bs_remove_events(bt); 560 583 return jabber_bs_recv_handshake(bt, -1, 0); 561 584 } … … 731 754 struct jabber_data *jd = ic->proto_data; 732 755 struct bs_transfer *bt; 733 GSList *tflist;734 756 struct xt_node *c; 735 757 char *sid, *jid; … … 750 772 /* Let's see if we can find out what this bytestream should be for... */ 751 773 752 for (tflist = jd->filetransfers; tflist; tflist = g_slist_next(tflist)) { 753 struct jabber_transfer *tft = tflist->data; 754 if ((strcmp(tft->sid, sid) == 0)) { 755 tf = tft; 756 break; 757 } 758 } 759 760 if (!tf) { 774 if (!(tf = get_ft_by_sid(jd->filetransfers, sid))) { 761 775 imcb_log(ic, "WARNING: Received SOCKS5 bytestream reply to unknown request"); 762 776 return XT_HANDLED; … … 776 790 /* using a proxy, abort listen */ 777 791 778 if (tf->watch_in) { 779 b_event_remove(tf->watch_in); 780 tf->watch_in = 0; 781 } 782 783 if (tf->fd != -1) { 784 closesocket(tf->fd); 785 tf->fd = -1; 786 } 787 788 if (bt->connect_timeout) { 789 b_event_remove(bt->connect_timeout); 790 bt->connect_timeout = 0; 791 } 792 jabber_bs_remove_events(bt); 792 793 793 794 GSList *shlist; … … 838 839 { 839 840 char *sid; 840 GSList *tflist;841 841 struct jabber_transfer *tf = NULL; 842 842 struct xt_node *query; … … 846 846 sid = xt_find_attr(query, "sid"); 847 847 848 for (tflist = jd->filetransfers; tflist; tflist = g_slist_next(tflist)) { 849 struct jabber_transfer *tft = tflist->data; 850 if ((strcmp(tft->sid, sid) == 0)) { 851 tf = tft; 852 break; 853 } 854 } 855 856 if (!tf) { 848 if (!(tf = get_ft_by_sid(jd->filetransfers, sid))) { 857 849 imcb_log(ic, "WARNING: Received SOCKS5 bytestream activation for unknown stream"); 858 850 return XT_HANDLED; … … 883 875 *port++ = '\0'; 884 876 885 sh = g_new0(jabber_streamhost_t, 1); 886 sh->jid = g_strdup(jid); 887 sh->host = g_strdup(host); 888 g_snprintf(sh->port, sizeof(sh->port), "%s", port); 877 sh = jabber_streamhost_new(jid, host, 0); 878 strncpy(sh->port, port, sizeof(sh->port)); 889 879 890 880 return sh; … … 910 900 if (strcmp(proxy, "<local>") == 0) { 911 901 if ((tf->fd = ft_listen(&tf->saddr, host, port, jd->fd, FALSE, &errmsg)) != -1) { 912 sh = g_new0(jabber_streamhost_t, 1); 913 sh->jid = g_strdup(tf->ini_jid); 914 sh->host = g_strdup(host); 915 g_snprintf(sh->port, sizeof(sh->port), "%s", port); 902 sh = jabber_streamhost_new(tf->ini_jid, host, 0); 903 strncpy(sh->port, port, sizeof(sh->port)); 916 904 bt->streamhosts = g_slist_append(bt->streamhosts, sh); 917 905 … … 948 936 { 949 937 struct bs_transfer *bt; 950 sha1_state_t sha;951 char hash_hex[41];952 unsigned char hash[20];953 int i, ret;954 955 /* SHA1( SID + Initiator JID + Target JID ) is given to the streamhost which it will match against the initiator's value */956 sha1_init(&sha);957 sha1_append(&sha, (unsigned char *) tf->sid, strlen(tf->sid));958 sha1_append(&sha, (unsigned char *) tf->ini_jid, strlen(tf->ini_jid));959 sha1_append(&sha, (unsigned char *) tf->tgt_jid, strlen(tf->tgt_jid));960 sha1_finish(&sha, hash);961 962 for (i = 0; i < 20; i++) {963 sprintf(hash_hex + i * 2, "%02x", hash[i]);964 }965 938 966 939 bt = g_new0(struct bs_transfer, 1); 967 940 bt->tf = tf; 968 941 bt->phase = BS_PHASE_CONNECT; 969 bt->pseudoad r = g_strdup(hash_hex);942 bt->pseudoaddr = generate_pseudoaddr(tf->sid, tf->ini_jid, tf->tgt_jid); 970 943 tf->streamhandle = bt; 971 944 tf->ft->free = jabber_bs_free_transfer; … … 974 947 jabber_si_set_proxies(bt); 975 948 976 ret = jabber_bs_send_request(tf, bt->streamhosts); 977 978 return ret; 949 return jabber_bs_send_request(tf, bt->streamhosts); 979 950 } 980 951 … … 1139 1110 socks5_connect.atyp); 1140 1111 } 1141 if (!(memcmp(socks5_connect.address, bt->pseudoad r, 40) == 0)) {1112 if (!(memcmp(socks5_connect.address, bt->pseudoaddr, 40) == 0)) { 1142 1113 return jabber_bs_abort(bt, "SOCKS5 Connect message contained wrong digest"); 1143 1114 } -
protocols/jabber/sasl.c
r0e4c3dd r89db90e 42 42 "https://www.facebook.com/dialog/oauth", 43 43 "https://graph.facebook.com/oauth/access_token", 44 "http ://www.bitlbee.org/main.php/Facebook/oauth2.html",44 "https://www.bitlbee.org/main.php/Facebook/oauth2.html", 45 45 "offline_access,xmpp_login", 46 46 "126828914005625", -
protocols/msn/msn.c
r0e4c3dd r89db90e 41 41 s->flags |= SET_NOSAVE | ACC_SET_ONLINE_ONLY; 42 42 43 s = set_add(&acc->set, "server", MSN_NS_HOST, set_eval_account, acc);43 s = set_add(&acc->set, "server", NULL, set_eval_account, acc); 44 44 s->flags |= SET_NOSAVE | ACC_SET_OFFLINE_ONLY; 45 45 … … 58 58 struct im_connection *ic = imcb_new(acc); 59 59 struct msn_data *md = g_new0(struct msn_data, 1); 60 char *server = set_getstr(&ic->acc->set, "server"); 60 61 61 62 ic->proto_data = md; 62 63 ic->flags |= OPT_PONGS | OPT_PONGED; 64 65 if (!server) { 66 imcb_error(ic, "The msn protocol is disabled in this version because most servers disabled MSNP18 over port 1863."); 67 imcb_error(ic, "If you find a working server, you can change the 'server' setting of this account. Good luck!"); 68 imcb_error(ic, "See also: http://ismsndeadyet.com/"); // shameless plug 69 imc_logout(ic, FALSE); 70 return; 71 } 63 72 64 73 if (strchr(acc->user, '@') == NULL) { … … 76 85 77 86 imcb_log(ic, "Connecting"); 78 msn_ns_connect(ic, md->ns, 79 set_getstr(&ic->acc->set, "server"), 87 msn_ns_connect(ic, md->ns, server, 80 88 set_getint(&ic->acc->set, "port")); 81 89 } … … 112 120 while (md->groups) { 113 121 struct msn_group *mg = md->groups->data; 122 md->groups = g_slist_remove(md->groups, mg); 114 123 g_free(mg->id); 115 124 g_free(mg->name); 116 125 g_free(mg); 117 md->groups = g_slist_remove(md->groups, mg);118 126 } 119 127 … … 127 135 while (md->grpq) { 128 136 struct msn_groupadd *ga = md->grpq->data; 137 md->grpq = g_slist_remove(md->grpq, ga); 129 138 g_free(ga->group); 130 139 g_free(ga->who); 131 140 g_free(ga); 132 md->grpq = g_slist_remove(md->grpq, ga);133 141 } 134 142 -
protocols/msn/ns.c
r0e4c3dd r89db90e 944 944 struct msn_message *m = (*msgq)->data; 945 945 946 *msgq = g_slist_remove(*msgq, m); 946 947 g_free(m->who); 947 948 g_free(m->text); 948 949 g_free(m); 949 950 *msgq = g_slist_remove(*msgq, m); 951 } 952 } 950 } 951 } -
protocols/msn/sb.c
r0e4c3dd r89db90e 519 519 } 520 520 } 521 sb->msgq = g_slist_remove(sb->msgq, m); 521 522 g_free(m->text); 522 523 g_free(m->who); 523 524 g_free(m); 524 525 sb->msgq = g_slist_remove(sb->msgq, m);526 525 } 527 526 -
protocols/msn/soap.h
r0e4c3dd r89db90e 167 167 168 168 #define SOAP_MEMLIST_PAYLOAD \ 169 "<FindMembership xmlns=\"http://www.msn.com/webservices/AddressBook\"><serviceFilter xmlns=\"http://www.msn.com/webservices/AddressBook\"><Types xmlns=\"http://www.msn.com/webservices/AddressBook\"><ServiceType xmlns=\"http://www.msn.com/webservices/AddressBook\">Messenger</ServiceType><ServiceType xmlns=\"http://www.msn.com/webservices/AddressBook\">Invitation</ServiceType><ServiceType xmlns=\"http://www.msn.com/webservices/AddressBook\">SocialNetwork</ServiceType><ServiceType xmlns=\"http://www.msn.com/webservices/AddressBook\">Space</ServiceType><ServiceType xmlns=\"http://www.msn.com/webservices/AddressBook\">Profile</ServiceType></Types></serviceFilter>" \169 "<FindMembership xmlns=\"http://www.msn.com/webservices/AddressBook\"><serviceFilter><Types><ServiceType>Messenger</ServiceType><ServiceType>IMAvailability</ServiceType></Types></serviceFilter><expandMembership>true</expandMembership>" \ 170 170 "</FindMembership>" 171 171 -
protocols/nogaim.h
r0e4c3dd r89db90e 180 180 void (* set_away) (struct im_connection *, char *state, char *message); 181 181 /* Implementing this function is optional. */ 182 void (* get_away) (struct im_connection *, char *who);183 /* Implementing this function is optional. */184 182 int (* send_typing) (struct im_connection *, char *who, int flags); 185 183 … … 195 193 void (* rem_permit) (struct im_connection *, char *who); 196 194 void (* rem_deny) (struct im_connection *, char *who); 197 /* Doesn't actually have UI hooks. Not used at all, can be removed. */198 void (* set_permit_deny)(struct im_connection *);199 195 200 196 /* Request profile info. Free-formatted stuff, the IM module gives back 201 197 this info via imcb_log(). Implementing these are optional. */ 202 198 void (* get_info) (struct im_connection *, char *who); 203 /* set_my_name is *DEPRECATED*, not used by the UI anymore. Use the204 display_name setting instead. */205 void (* set_my_name) (struct im_connection *, char *name);206 void (* set_name) (struct im_connection *, char *who, char *name);207 199 208 200 /* Group chat stuff. */ -
protocols/oscar/oscar.c
r0e4c3dd r89db90e 1914 1914 } 1915 1915 1916 static void oscar_get_away(struct im_connection *g, char *who)1917 {1918 struct oscar_data *odata = (struct oscar_data *) g->proto_data;1919 1920 if (odata->icq) {1921 /** FIXME(wilmer): Hmm, lost the ability to get away msgs here, do we care to get that back?1922 struct buddy *budlight = imcb_find_buddy(g, who);1923 if (budlight)1924 if ((budlight->uc & 0xff80) >> 7)1925 if (budlight->caps & AIM_CAPS_ICQSERVERRELAY)1926 aim_send_im_ch2_geticqmessage(odata->sess, who, (budlight->uc & 0xff80) >> 7);1927 */1928 } else {1929 aim_getinfo(odata->sess, odata->conn, who, AIM_GETINFO_AWAYMESSAGE);1930 }1931 }1932 1933 1916 static void oscar_set_away_aim(struct im_connection *ic, struct oscar_data *od, const char *state, const char *message) 1934 1917 { … … 2712 2695 ret->get_info = oscar_get_info; 2713 2696 ret->set_away = oscar_set_away; 2714 ret->get_away = oscar_get_away;2715 2697 ret->add_buddy = oscar_add_buddy; 2716 2698 ret->remove_buddy = oscar_remove_buddy; -
protocols/purple/ft-direct.c
r0e4c3dd r89db90e 28 28 29 29 #include "bitlbee.h" 30 #include "bpurple.h" 30 31 31 32 #include <stdarg.h> … … 207 208 void purple_transfer_request(struct im_connection *ic, file_transfer_t *ft, char *handle) 208 209 { 209 PurpleAccount *pa= ic->proto_data;210 struct purple_data *pd = ic->proto_data; 210 211 struct prpl_xfer_data *px; 211 212 … … 213 214 multi-threaded anyway. */ 214 215 next_ft = ft; 215 serv_send_file(purple_account_get_connection(pa), handle, ft->file_name); 216 serv_send_file(purple_account_get_connection(pd->account), handle, 217 ft->file_name); 216 218 217 219 ft->write = prpl_xfer_write; -
protocols/purple/ft.c
r0e4c3dd r89db90e 28 28 29 29 #include "bitlbee.h" 30 #include "bpurple.h" 30 31 31 32 #include <stdarg.h> … … 285 286 { 286 287 struct prpl_xfer_data *px = ft->data; 287 PurpleAccount *pa= px->ic->proto_data;288 struct purple_data *pd = px->ic->proto_data; 288 289 289 290 /* xfer_new() will pick up this variable. It's a hack but we're not 290 291 multi-threaded anyway. */ 291 292 next_ft = ft; 292 serv_send_file(purple_account_get_connection(pa), px->handle, px->fn); 293 serv_send_file(purple_account_get_connection(pd->account), 294 px->handle, px->fn); 293 295 } 294 296 -
protocols/purple/purple.c
r0e4c3dd r89db90e 23 23 24 24 #include "bitlbee.h" 25 #include "bpurple.h" 25 26 #include "help.h" 26 27 … … 42 43 { 43 44 GSList *i; 45 struct purple_data *pd; 44 46 45 47 for (i = purple_connections; i; i = i->next) { 46 if (((struct im_connection *) i->data)->proto_data == pa) { 48 pd = ((struct im_connection *) i->data)->proto_data; 49 if (pd->account == pa) { 47 50 return i->data; 48 51 } … … 290 293 { 291 294 struct im_connection *ic = imcb_new(acc); 292 PurpleAccount *pa;295 struct purple_data *pd; 293 296 294 297 if ((local_bee != NULL && local_bee != acc->bee) || … … 306 309 purple_connections = g_slist_prepend(purple_connections, ic); 307 310 308 ic->proto_data = pa = purple_account_new(acc->user, (char *) acc->prpl->data); 309 purple_account_set_password(pa, acc->pass); 310 purple_sync_settings(acc, pa); 311 312 purple_account_set_enabled(pa, "BitlBee", TRUE); 311 ic->proto_data = pd = g_new0(struct purple_data, 1); 312 pd->account = purple_account_new(acc->user, (char *) acc->prpl->data); 313 purple_account_set_password(pd->account, acc->pass); 314 purple_sync_settings(acc, pd->account); 315 316 purple_account_set_enabled(pd->account, "BitlBee", TRUE); 313 317 } 314 318 315 319 static void purple_logout(struct im_connection *ic) 316 320 { 317 PurpleAccount *pa= ic->proto_data;318 319 purple_account_set_enabled(p a, "BitlBee", FALSE);321 struct purple_data *pd = ic->proto_data; 322 323 purple_account_set_enabled(pd->account, "BitlBee", FALSE); 320 324 purple_connections = g_slist_remove(purple_connections, ic); 321 purple_accounts_remove(pa); 325 purple_accounts_remove(pd->account); 326 g_free(pd); 322 327 } 323 328 … … 325 330 { 326 331 PurpleConversation *conv; 332 struct purple_data *pd = ic->proto_data; 327 333 328 334 if ((conv = purple_find_conversation_with_account(PURPLE_CONV_TYPE_IM, 329 who, ic->proto_data)) == NULL) {335 who, pd->account)) == NULL) { 330 336 conv = purple_conversation_new(PURPLE_CONV_TYPE_IM, 331 ic->proto_data, who);337 pd->account, who); 332 338 } 333 339 … … 339 345 static GList *purple_away_states(struct im_connection *ic) 340 346 { 341 PurpleAccount *pa= ic->proto_data;347 struct purple_data *pd = ic->proto_data; 342 348 GList *st, *ret = NULL; 343 349 344 for (st = purple_account_get_status_types(p a); st; st = st->next) {350 for (st = purple_account_get_status_types(pd->account); st; st = st->next) { 345 351 PurpleStatusPrimitive prim = purple_status_type_get_primitive(st->data); 346 352 if (prim != PURPLE_STATUS_AVAILABLE && prim != PURPLE_STATUS_OFFLINE) { … … 354 360 static void purple_set_away(struct im_connection *ic, char *state_txt, char *message) 355 361 { 356 PurpleAccount *pa= ic->proto_data;357 GList *status_types = purple_account_get_status_types(p a), *st;362 struct purple_data *pd = ic->proto_data; 363 GList *status_types = purple_account_get_status_types(pd->account), *st; 358 364 PurpleStatusType *pst = NULL; 359 365 GList *args = NULL; … … 378 384 } 379 385 380 purple_account_set_status_list(pa, st ? purple_status_type_get_id(pst) : "away", 386 purple_account_set_status_list(pd->account, 387 st ? purple_status_type_get_id(pst) : "away", 381 388 TRUE, args); 382 389 … … 447 454 PurpleBuddy *pb; 448 455 PurpleGroup *pg = NULL; 456 struct purple_data *pd = ic->proto_data; 449 457 450 458 if (group && !(pg = purple_find_group(group))) { … … 453 461 } 454 462 455 pb = purple_buddy_new( (PurpleAccount *) ic->proto_data, who, NULL);463 pb = purple_buddy_new(pd->account, who, NULL); 456 464 purple_blist_add_buddy(pb, NULL, pg, NULL); 457 purple_account_add_buddy( (PurpleAccount *) ic->proto_data, pb);458 459 purple_gg_buddylist_export( ((PurpleAccount *) ic->proto_data)->gc);465 purple_account_add_buddy(pd->account, pb); 466 467 purple_gg_buddylist_export(pd->account->gc); 460 468 } 461 469 … … 463 471 { 464 472 PurpleBuddy *pb; 465 466 pb = purple_find_buddy((PurpleAccount *) ic->proto_data, who); 473 struct purple_data *pd = ic->proto_data; 474 475 pb = purple_find_buddy(pd->account, who); 467 476 if (pb != NULL) { 468 477 PurpleGroup *group; 469 478 470 479 group = purple_buddy_get_group(pb); 471 purple_account_remove_buddy( (PurpleAccount *) ic->proto_data, pb, group);480 purple_account_remove_buddy(pd->account, pb, group); 472 481 473 482 purple_blist_remove_buddy(pb); 474 483 } 475 484 476 purple_gg_buddylist_export( ((PurpleAccount *) ic->proto_data)->gc);485 purple_gg_buddylist_export(pd->account->gc); 477 486 } 478 487 479 488 static void purple_add_permit(struct im_connection *ic, char *who) 480 489 { 481 PurpleAccount *pa= ic->proto_data;482 483 purple_privacy_permit_add(p a, who, FALSE);490 struct purple_data *pd = ic->proto_data; 491 492 purple_privacy_permit_add(pd->account, who, FALSE); 484 493 } 485 494 486 495 static void purple_add_deny(struct im_connection *ic, char *who) 487 496 { 488 PurpleAccount *pa= ic->proto_data;489 490 purple_privacy_deny_add(p a, who, FALSE);497 struct purple_data *pd = ic->proto_data; 498 499 purple_privacy_deny_add(pd->account, who, FALSE); 491 500 } 492 501 493 502 static void purple_rem_permit(struct im_connection *ic, char *who) 494 503 { 495 PurpleAccount *pa= ic->proto_data;496 497 purple_privacy_permit_remove(p a, who, FALSE);504 struct purple_data *pd = ic->proto_data; 505 506 purple_privacy_permit_remove(pd->account, who, FALSE); 498 507 } 499 508 500 509 static void purple_rem_deny(struct im_connection *ic, char *who) 501 510 { 502 PurpleAccount *pa= ic->proto_data;503 504 purple_privacy_deny_remove(p a, who, FALSE);511 struct purple_data *pd = ic->proto_data; 512 513 purple_privacy_deny_remove(pd->account, who, FALSE); 505 514 } 506 515 507 516 static void purple_get_info(struct im_connection *ic, char *who) 508 517 { 509 serv_get_info(purple_account_get_connection(ic->proto_data), who); 518 struct purple_data *pd = ic->proto_data; 519 520 serv_get_info(purple_account_get_connection(pd->account), who); 510 521 } 511 522 … … 517 528 { 518 529 PurpleTypingState state = PURPLE_NOT_TYPING; 519 PurpleAccount *pa= ic->proto_data;530 struct purple_data *pd = ic->proto_data; 520 531 521 532 if (flags & OPT_TYPING) { … … 525 536 } 526 537 527 serv_send_typing(purple_account_get_connection(p a), who, state);538 serv_send_typing(purple_account_get_connection(pd->account), who, state); 528 539 529 540 return 1; … … 559 570 /* There went my nice afternoon. :-( */ 560 571 561 PurpleAccount *pa= ic->proto_data;562 PurplePlugin *prpl = purple_plugins_find_with_id(p a->protocol_id);572 struct purple_data *pd = ic->proto_data; 573 PurplePlugin *prpl = purple_plugins_find_with_id(pd->account->protocol_id); 563 574 PurplePluginProtocolInfo *pi = prpl->info->extra_info; 564 PurpleBuddy *pb = purple_find_buddy( (PurpleAccount *) ic->proto_data, who);575 PurpleBuddy *pb = purple_find_buddy(pd->account, who); 565 576 PurpleMenuAction *mi; 566 577 GList *menu; … … 597 608 PurpleConversation *pc = gc->data; 598 609 PurpleConvChat *pcc = PURPLE_CONV_CHAT(pc); 599 600 serv_chat_invite(purple_account_get_connection(gc->ic->proto_data), 610 struct purple_data *pd = gc->ic->proto_data; 611 612 serv_chat_invite(purple_account_get_connection(pd->account), 601 613 purple_conv_chat_get_id(pcc), 602 614 message && *message ? message : "Please join my chat", … … 623 635 set_t **sets) 624 636 { 625 PurpleAccount *pa= ic->proto_data;626 PurplePlugin *prpl = purple_plugins_find_with_id(p a->protocol_id);637 struct purple_data *pd = ic->proto_data; 638 PurplePlugin *prpl = purple_plugins_find_with_id(pd->account->protocol_id); 627 639 PurplePluginProtocolInfo *pi = prpl->info->extra_info; 628 640 GHashTable *chat_hash; … … 631 643 632 644 if (!pi->chat_info || !pi->chat_info_defaults || 633 !(info = pi->chat_info(purple_account_get_connection(p a)))) {645 !(info = pi->chat_info(purple_account_get_connection(pd->account)))) { 634 646 imcb_error(ic, "Joining chatrooms not supported by this protocol"); 635 647 return NULL; 636 648 } 637 649 638 if ((conv = purple_find_conversation_with_account(PURPLE_CONV_TYPE_CHAT, room, pa))) { 650 if ((conv = purple_find_conversation_with_account(PURPLE_CONV_TYPE_CHAT, 651 room, pd->account))) { 639 652 purple_conversation_destroy(conv); 640 653 } 641 654 642 chat_hash = pi->chat_info_defaults(purple_account_get_connection(pa), room); 655 chat_hash = pi->chat_info_defaults( 656 purple_account_get_connection(pd->account), room 657 ); 643 658 644 659 for (l = info; l; l = l->next) { … … 654 669 } 655 670 656 serv_join_chat(purple_account_get_connection(p a), chat_hash);671 serv_join_chat(purple_account_get_connection(pd->account), chat_hash); 657 672 658 673 return NULL; … … 1033 1048 } 1034 1049 1050 /* So it turns out some requests have no account context at all, because 1051 * libpurple hates us. This means that query_del_by_conn() won't remove those 1052 * on logout, and will segfault if the user replies. That's why this exists. 1053 */ 1054 static void prplcb_close_request(PurpleRequestType type, void *data) 1055 { 1056 if (type == PURPLE_REQUEST_ACTION) { 1057 struct prplcb_request_action_data *pqad = data; 1058 query_del(local_bee->ui_data, pqad->bee_data); 1059 } 1060 /* Add the request input handler here when that becomes a thing */ 1061 } 1062 1035 1063 /* 1036 1064 static void prplcb_request_test() … … 1047 1075 NULL, 1048 1076 NULL, 1049 NULL,1077 prplcb_close_request, 1050 1078 NULL, 1051 1079 }; -
protocols/skype/Makefile
r0e4c3dd r89db90e 6 6 DATE := $(shell date +%Y-%m-%d) 7 7 INSTALL = install 8 ASCIIDOC = yes9 8 10 ifeq ($(ASCIIDOC),yes) 9 10 ifdef ASCIIDOC 11 11 MANPAGES = skyped.1 12 12 else … … 29 29 30 30 install-doc: doc 31 if eq ($(ASCIIDOC),yes)31 ifdef ASCIIDOC 32 32 $(INSTALL) -d $(DESTDIR)$(MANDIR)/man1 33 33 $(INSTALL) -m644 $(MANPAGES) $(DESTDIR)$(MANDIR)/man1 -
protocols/twitter/twitter.c
r0e4c3dd r89db90e 852 852 } 853 853 854 /* Parses a decimal or hex tweet ID, returns TRUE on success */ 855 static gboolean twitter_parse_id(char *string, int base, guint64 *id) 856 { 857 guint64 parsed; 858 char *endptr; 859 860 errno = 0; 861 parsed = g_ascii_strtoull(string, &endptr, base); 862 if (errno || endptr == string || *endptr != '\0') { 863 return FALSE; 864 } 865 *id = parsed; 866 return TRUE; 867 } 868 854 869 /** Convert the given bitlbee tweet ID, bitlbee username, or twitter tweet ID 855 870 * into a twitter tweet ID. … … 879 894 arg++; 880 895 } 881 if (sscanf(arg, "%" G_GINT64_MODIFIER "x", &id) == 1 && 882 id < TWITTER_LOG_LENGTH) { 896 if (twitter_parse_id(arg, 16, &id) && id < TWITTER_LOG_LENGTH) { 883 897 bu = td->log[id].bu; 884 898 id = td->log[id].id; … … 887 901 bu = NULL; 888 902 } 889 } else if ( sscanf(arg, "%" G_GINT64_MODIFIER "d", &id) == 1) {903 } else if (twitter_parse_id(arg, 10, &id)) { 890 904 /* Allow normal tweet IDs as well; not a very useful 891 905 feature but it's always been there. Just ignore -
protocols/twitter/twitter_lib.c
r0e4c3dd r89db90e 862 862 863 863 imcb_error(ic, "Stream closed (%s)", req->status_string); 864 if (req->status_code == 401) { 865 imcb_error(ic, "Check your system clock."); 866 } 864 867 imc_logout(ic, TRUE); 865 868 return; -
protocols/yahoo/yahoo.c
r0e4c3dd r89db90e 733 733 inp = l->data; 734 734 if (inp->h == tag) { 735 byahoo_inputs = g_slist_remove(byahoo_inputs, inp); 735 736 g_free(inp->d); 736 737 g_free(inp); 737 byahoo_inputs = g_slist_remove(byahoo_inputs, inp);738 738 break; 739 739 }
Note: See TracChangeset
for help on using the changeset viewer.