Changeset 89db90e
- 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. - Files:
-
- 1 added
- 27 edited
Legend:
- Unmodified
- Added
- Removed
-
.gitignore
r0e4c3dd r89db90e 30 30 .git 31 31 .gitignore 32 bitlbee.service 33 bitlbee@.service -
.travis.yml
r0e4c3dd r89db90e 1 1 language: c 2 script: ./configure && make check && dpkg-buildpackage -uc -us 2 3 script: 4 - ./configure 5 - make check 6 - dpkg-buildpackage -uc -us 7 3 8 before_install: 4 9 - sudo apt-get update -qq … … 7 12 - sudo dpkg -i *.deb 8 13 14 env: 15 global: 16 # The next declaration is the encrypted COVERITY_SCAN_TOKEN, created 17 # via the "travis encrypt" command using the project repo's public key 18 - secure: "MO6hy2cRxR02A0nSenfQFyPFpepxorJ+XgNkq2JS7LtI6tcwYRR0alvunIPJXam1/OUKxoFsBJLS1nCJTvEUXFCOvoTSAoMiePTBUEg2zfzcTb5k+cqtcOUznCXHNmXAwrqriP4vkG+57ijO9Ojz2r9LijcvjtFDRFJQY9Rcs38=" 19 20 addons: 21 coverity_scan: 22 project: 23 name: "bitlbee/bitlbee" 24 description: "An IRC to other chat networks gateway" 25 notification_email: dx@dxzone.com.ar 26 build_command_prepend: ./configure --otr=1 --debug=1 27 build_command: make 28 branch_pattern: coverity_scan 29 30 notifications: 31 email: false -
Makefile
r0e4c3dd r89db90e 25 25 26 26 doc: 27 ifdef DOC 27 28 $(MAKE) -C doc 29 endif 28 30 29 31 uninstall: uninstall-bin uninstall-doc … … 73 75 74 76 install-doc: 77 ifdef DOC 75 78 $(MAKE) -C doc install 79 endif 76 80 ifdef SKYPE_PI 77 81 $(MAKE) -C protocols/skype install-doc … … 79 83 80 84 uninstall-doc: 85 ifdef DOC 81 86 $(MAKE) -C doc uninstall 87 endif 82 88 ifdef SKYPE_PI 83 89 $(MAKE) -C protocols/skype uninstall-doc -
configure
r0e4c3dd r89db90e 37 37 purple=0 38 38 39 doc=1 39 40 debug=0 40 41 strip=1 … … 59 60 # Cygwin and Darwin don't support PIC/PIE 60 61 case "$arch" in 61 62 63 64 62 CYGWIN* ) 63 pie=0;; 64 Darwin ) 65 pie=0;; 65 66 esac 66 67 … … 94 95 (automatically disables other protocol modules) 95 96 97 --doc=0/1 Disable/enable help.txt generation $doc 96 98 --debug=0/1 Disable/enable debugging $debug 97 99 --strip=0/1 Disable/enable binary stripping $strip … … 448 450 ret=1 449 451 echo "$RESOLV_NS_TESTCODE" | $CC -o $TMPFILE -x c - $LIBRESOLV >/dev/null 2>/dev/null 450 451 452 452 if [ "$?" = "0" ]; then 453 ret=0 454 fi 453 455 454 456 rm -f $TMPFILE … … 463 465 if [ -f $i/libresolv.a ]; then 464 466 echo "$RESOLV_NS_TESTCODE" | $CC -o $TMPFILE -x c - -Wl,$i/libresolv.a >/dev/null 2>/dev/null 465 466 467 467 if [ "$?" = "0" ]; then 468 ret=0 469 fi 468 470 fi 469 471 done … … 475 477 detect_nameser_has_ns_types() 476 478 { 477 478 479 480 481 482 483 484 485 486 487 479 TMPFILE=$(mktemp /tmp/bitlbee-configure.XXXXXX) 480 ret=1 481 # since we aren't actually linking with ns_* routines 482 # we can just compile the test code 483 echo "$RESOLV_NS_TYPES_TESTCODE" | $CC -o $TMPFILE -x c - >/dev/null 2>/dev/null 484 if [ "$?" = "0" ]; then 485 ret=0 486 fi 487 488 rm -f $TMPFILE 489 return $ret 488 490 } 489 491 … … 546 548 if detect_resolv_dynamic || detect_resolv_static; then 547 549 echo '#define HAVE_RESOLV_A' >> config.h 548 549 550 551 else 552 550 if detect_resolv_ns_dynamic || detect_resolv_ns_static; then 551 echo '#define HAVE_RESOLV_A_WITH_NS' >> config.h 552 fi 553 else 554 echo 'Insufficient resolv routines. Jabber server must be set explicitly' 553 555 fi 554 556 … … 647 649 fi 648 650 649 if [ ! -e doc/user-guide/help.txt ] && ! type xmlto > /dev/null 2> /dev/null; then 650 echo 651 echo 'WARNING: Building from an unreleased source tree without prebuilt helpfile.' 652 echo 'Install xmlto if you want online help to work.' 651 if [ "$doc" = "1" ]; then 652 if [ ! -e doc/user-guide/help.txt ] && \ 653 ! type xmlto > /dev/null 2> /dev/null || \ 654 ! type xsltproc > /dev/null 2> /dev/null 655 then 656 echo 657 echo 'WARNING: Building from an unreleased source tree without prebuilt helpfile.' 658 echo 'Install xmlto and xsltproc if you want online help to work.' 659 else 660 echo "DOC=1" >> Makefile.settings 661 fi 662 663 if [ "$skype" = "1" -o "$skype" = "plugin" ]; then 664 # skype also needs asciidoc 665 if ! type a2x > /dev/null 2> /dev/null; then 666 echo 667 echo 'WARNING: The skyped man page requires asciidoc. It will not be generated.' 668 else 669 echo "ASCIIDOC=1" >> Makefile.settings 670 fi 671 fi 653 672 fi 654 673 -
help.c
r0e4c3dd r89db90e 30 30 #undef write 31 31 32 #define BUFSIZE 110032 #define BUFSIZE 2048 33 33 34 34 help_t *help_init(help_t **help, const char *helpfile) -
ipc.c
r0e4c3dd r89db90e 776 776 } 777 777 778 child_list = g_slist_remove(child_list, c); 779 778 780 g_free(c->host); 779 781 g_free(c->nick); … … 781 783 g_free(c->password); 782 784 g_free(c); 783 784 child_list = g_slist_remove(child_list, c);785 785 786 786 /* Also, if any child has a reference to this one, remove it. */ -
irc.c
r0e4c3dd r89db90e 764 764 irc_rootmsg(irc, 765 765 "Welcome to the BitlBee gateway!\n\n" 766 "Running %s %s\n\n" 766 767 "If you've never used BitlBee before, please do read the help " 767 768 "information using the \x02help\x02 command. Lots of FAQs are " 768 769 "answered there.\n" 769 770 "If you already have an account on this server, just use the " 770 "\x02identify\x02 command to identify yourself."); 771 "\x02identify\x02 command to identify yourself.", 772 PACKAGE, BITLBEE_VERSION); 771 773 772 774 /* This is for bug #209 (use PASS to identify to NickServ). */ -
irc_send.c
r0e4c3dd r89db90e 55 55 { 56 56 char motd[2048]; 57 s ize_t len;57 ssize_t len; 58 58 int fd; 59 59 -
lib/oauth.c
r0e4c3dd r89db90e 96 96 { 97 97 int key_len = strlen(key); 98 GSList *l , *n;99 100 if ( params == NULL) {98 GSList *l; 99 100 if (!params) { 101 101 return; 102 102 } 103 103 104 for (l = *params; l; l = n) { 105 n = l->next; 106 107 if (strncmp((char *) l->data, key, key_len) == 0 && 108 ((char *) l->data)[key_len] == '=') { 109 g_free(l->data); 110 *params = g_slist_remove(*params, l->data); 104 for (l = *params; l; l = l->next) { 105 char *data = l->data; 106 107 if (strncmp(data, key, key_len) == 0 && data[key_len] == '=') { 108 *params = g_slist_remove(*params, data); 109 g_free(data); 111 110 } 112 111 } -
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 } -
storage_xml.c
r0e4c3dd r89db90e 103 103 if (protocol) { 104 104 prpl = find_protocol(protocol); 105 if (!prpl) { 106 irc_rootmsg(xd->irc, "Error loading user config: Protocol not found: `%s'", protocol); 107 return XT_ABORT; 108 } 105 109 local = protocol_account_islocal(protocol); 106 110 } … … 197 201 fn = g_strconcat(global.conf->configdir, xd->given_nick, ".xml", NULL); 198 202 if ((fd = open(fn, O_RDONLY)) < 0) { 199 ret = STORAGE_NO_SUCH_USER; 203 if (errno == ENOENT) { 204 ret = STORAGE_NO_SUCH_USER; 205 } else { 206 irc_rootmsg(irc, "Error loading user config: %s", g_strerror(errno)); 207 } 200 208 goto error; 201 209 } … … 259 267 260 268 261 static gboolean xml_generate_nick(gpointer key, gpointer value, gpointer data);262 269 static void xml_generate_settings(struct xt_node *cur, set_t **head); 263 270 … … 292 299 293 300 for (acc = irc->b->accounts; acc; acc = acc->next) { 301 GHashTableIter iter; 302 gpointer key, value; 294 303 unsigned char *pass_cr; 295 304 char *pass_b64; … … 312 321 g_free(pass_b64); 313 322 314 /* This probably looks pretty strange. g_hash_table_foreach 315 is quite a PITA already (but it can't get much better in 316 C without using #define, I'm afraid), and it 317 doesn't seem to be possible to abort the foreach on write 318 errors, so instead let's use the _find function and 319 return TRUE on write errors. Which means, if we found 320 something, there was an error. :-) */ 321 g_hash_table_find(acc->nicks, xml_generate_nick, cur); 323 g_hash_table_iter_init(&iter, acc->nicks); 324 while (g_hash_table_iter_next(&iter, &key, &value)) { 325 struct xt_node *node = xt_new_node("buddy", NULL, NULL); 326 xt_add_attr(node, "handle", key); 327 xt_add_attr(node, "nick", value); 328 xt_add_child(cur, node); 329 } 322 330 323 331 xml_generate_settings(cur, &acc->set); … … 343 351 344 352 return root; 345 }346 347 static gboolean xml_generate_nick(gpointer key, gpointer value, gpointer data)348 {349 struct xt_node *node = xt_new_node("buddy", NULL, NULL);350 351 xt_add_attr(node, "handle", key);352 xt_add_attr(node, "nick", value);353 xt_add_child((struct xt_node *) data, node);354 355 return FALSE;356 353 } 357 354 … … 388 385 strcat(path, ".XXXXXX"); 389 386 if ((fd = mkstemp(path)) < 0) { 390 irc_rootmsg(irc, "Error while opening configuration file."); 391 return STORAGE_OTHER_ERROR; 387 goto error; 392 388 } 393 389 … … 411 407 412 408 error: 413 irc_rootmsg(irc, "Write error . Disk full?");409 irc_rootmsg(irc, "Write error: %s", g_strerror(errno)); 414 410 ret = STORAGE_OTHER_ERROR; 415 411
Note: See TracChangeset
for help on using the changeset viewer.