- Timestamp:
- 2018-03-10T11:30:39Z (7 years ago)
- Children:
- 5447c59
- Parents:
- 3f44e43 (diff), 4a9c6b0 (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:
-
- 20 edited
Legend:
- Unmodified
- Added
- Removed
-
protocols/Makefile
r3f44e43 r7a9d968 43 43 44 44 $(subdirs): 45 @$(MAKE) -C $@ $(MAKECMDGOALS)45 $(MAKE) -C $@ $(MAKECMDGOALS) 46 46 47 47 ### MAIN PROGRAM … … 49 49 protocols.o: $(objects) $(subdirs) 50 50 @echo '*' Linking protocols.o 51 @$(LD) $(LFLAGS) $(objects) $(subdirobjs) -o protocols.o51 $(VERBOSE) $(LD) $(LFLAGS) $(objects) $(subdirobjs) -o protocols.o 52 52 53 53 $(objects): ../Makefile.settings Makefile … … 55 55 $(objects): %.o: $(_SRCDIR_)%.c 56 56 @echo '*' Compiling $< 57 @$(CC) -c $(CFLAGS) $(CFLAGS_BITLBEE) $< -o $@57 $(VERBOSE) $(CC) -c $(CFLAGS) $(CFLAGS_BITLBEE) $< -o $@ 58 58 59 59 -include .depend/*.d -
protocols/account.c
r3f44e43 r7a9d968 55 55 56 56 s = set_add(&a->set, "auto_reconnect", "true", set_eval_bool, a); 57 58 s = set_add(&a->set, "handle_unknown", NULL, NULL, a); 59 s->flags |= SET_NULL_OK; 57 60 58 61 s = set_add(&a->set, "nick_format", NULL, NULL, a); -
protocols/bee_user.c
r3f44e43 r7a9d968 170 170 171 171 if (!(bu = bee_user_by_handle(bee, ic, handle))) { 172 if (g_strcasecmp(set_getstr(&ic->bee->set, "handle_unknown"), "add") == 0) { 172 char *h = set_getstr(&ic->acc->set, "handle_unknown") ? : 173 set_getstr(&ic->bee->set, "handle_unknown"); 174 175 if (g_strncasecmp(h, "add", 3) == 0) { 173 176 bu = bee_user_new(bee, ic, handle, BEE_USER_LOCAL); 174 177 } else { 175 if (g_strcasecmp( set_getstr(&ic->bee->set, "handle_unknown"), "ignore") != 0) {178 if (g_strcasecmp(h, "ignore") != 0) { 176 179 imcb_log(ic, "imcb_buddy_status() for unknown handle %s:\n" 177 180 "flags = %d, state = %s, message = %s", handle, flags, … … 255 258 256 259 if (!bu && !(ic->flags & OPT_LOGGING_OUT)) { 257 char *h = set_getstr(&bee->set, "handle_unknown"); 260 char *h = set_getstr(&ic->acc->set, "handle_unknown") ? : 261 set_getstr(&ic->bee->set, "handle_unknown"); 258 262 259 263 if (g_strcasecmp(h, "ignore") == 0) { -
protocols/jabber/Makefile
r3f44e43 r7a9d968 38 38 $(objects): %.o: $(_SRCDIR_)%.c 39 39 @echo '*' Compiling $< 40 @$(CC) -c $(CFLAGS) $(CFLAGS_BITLBEE) $< -o $@40 $(VERBOSE) $(CC) -c $(CFLAGS) $(CFLAGS_BITLBEE) $< -o $@ 41 41 42 42 jabber_mod.o: $(objects) 43 43 @echo '*' Linking jabber_mod.o 44 @$(LD) $(LFLAGS) $(objects) -o jabber_mod.o44 $(VERBOSE) $(LD) $(LFLAGS) $(objects) -o jabber_mod.o 45 45 46 46 -include .depend/*.d -
protocols/jabber/conference.c
r3f44e43 r7a9d968 167 167 jabber_buddy_remove_bare(c->ic, jc->name); 168 168 169 g_free(jc->last_sent_message); 169 170 g_free(jc->my_full_jid); 170 171 g_free(jc->name); … … 187 188 188 189 jabber_cache_add(ic, node, jabber_chat_self_message); 190 191 g_free(jc->last_sent_message); 192 jc->last_sent_message = g_strdup(message); 189 193 190 194 return !jabber_write_packet(ic, node); … … 325 329 } 326 330 bud->flags |= JBFLAG_IS_ANONYMOUS; 331 } else if (bud == jc->me) { 332 g_free(bud->ext_jid); 333 bud->ext_jid = g_strdup(jd->me); 327 334 } 328 335 … … 347 354 } 348 355 356 imcb_chat_add_buddy(chat, bud->ext_jid); 357 349 358 if (bud != jc->me && (jc->flags & JCFLAG_ALWAYS_USE_NICKS) && !(bud->flags & JBFLAG_IS_ANONYMOUS)) { 350 359 imcb_buddy_nick_change(ic, bud->ext_jid, bud->resource); 351 360 } 352 361 353 imcb_chat_add_buddy(chat, bud->ext_jid);354 362 if (s) { 355 363 *s = '/'; … … 494 502 imcb_chat_log(chat, "From conference server: %s", body->text); 495 503 return; 496 } else if (jc && jc->flags & JCFLAG_MESSAGE_SENT && bud == jc->me && 497 (jabber_cache_handle_packet(ic, node) == XT_ABORT)) { 498 /* Self message marked by this bitlbee, don't show it */ 499 return; 504 } else if (jc && jc->flags & JCFLAG_MESSAGE_SENT && bud == jc->me) { 505 if (jabber_cache_handle_packet(ic, node) == XT_ABORT) { 506 /* Self message marked by this bitlbee, don't show it */ 507 return; 508 } else if (xt_find_attr(node, "id") == NULL && 509 g_strcmp0(body->text, jc->last_sent_message) == 0) { 510 /* Some misbehaving servers (like slack) eat the ids and echo anyway. 511 * Try to detect those cases by comparing against the last sent message. */ 512 return; 513 } 500 514 } 501 515 -
protocols/jabber/jabber.h
r3f44e43 r7a9d968 161 161 struct jabber_buddy *me; 162 162 char *invite; 163 char *last_sent_message; 163 164 }; 164 165 -
protocols/jabber/s5bytestream.c
r3f44e43 r7a9d968 500 500 case BS_PHASE_REPLY: 501 501 { 502 struct socks5_message socks5_reply ;502 struct socks5_message socks5_reply = {0}; 503 503 int ret; 504 504 … … 888 888 char *proxy, *next, *errmsg = NULL; 889 889 char port[6]; 890 char host[ HOST_NAME_MAX+ 1];890 char host[NI_MAXHOST + 1]; 891 891 jabber_streamhost_t *sh, *sh2; 892 892 GSList *streamhosts = jd->streamhosts; … … 1046 1046 unsigned char nmethods; 1047 1047 unsigned char method; 1048 } socks5_hello ;1048 } socks5_hello = {0}; 1049 1049 1050 1050 if (!(ret = jabber_bs_peek(bt, &socks5_hello, sizeof(socks5_hello)))) { … … 1091 1091 case BS_PHASE_REQUEST: 1092 1092 { 1093 struct socks5_message socks5_connect ;1093 struct socks5_message socks5_connect = {0}; 1094 1094 int msgsize = sizeof(struct socks5_message); 1095 1095 int ret; -
protocols/msn/Makefile
r3f44e43 r7a9d968 38 38 $(objects): %.o: $(_SRCDIR_)%.c 39 39 @echo '*' Compiling $< 40 @$(CC) -c $(CFLAGS) $(CFLAGS_BITLBEE) $< -o $@40 $(VERBOSE) $(CC) -c $(CFLAGS) $(CFLAGS_BITLBEE) $< -o $@ 41 41 42 42 msn_mod.o: $(objects) 43 43 @echo '*' Linking msn_mod.o 44 @$(LD) $(LFLAGS) $(objects) -o msn_mod.o44 $(VERBOSE) $(LD) $(LFLAGS) $(objects) -o msn_mod.o 45 45 46 46 -include .depend/*.d -
protocols/msn/msn_util.c
r3f44e43 r7a9d968 180 180 if (getenv("BITLBEE_DEBUG")) { 181 181 fprintf(stderr, "\n\x1b[92m<<< "); 182 write(2, bytes , st);182 fwrite(bytes, st, 1, stderr); 183 183 fprintf(stderr, "\x1b[97m"); 184 184 } -
protocols/msn/soap.c
r3f44e43 r7a9d968 213 213 if (headers) { 214 214 if ((s = strstr(headers, "\r\n\r\n"))) { 215 write(2, headers, s - headers + 4);215 fwrite(headers, s - headers + 4, 1, stderr); 216 216 } else { 217 write(2, headers, strlen(headers));217 fwrite(headers, strlen(headers), 1, stderr); 218 218 } 219 219 } -
protocols/nogaim.c
r3f44e43 r7a9d968 50 50 } 51 51 52 /* semi-private */ 53 gboolean plugin_info_validate(struct plugin_info *info, const char *path) 54 { 55 GList *l; 56 gboolean loaded = FALSE; 57 58 if (!path) { 59 path = "(null)"; 60 } 61 62 if (info->abiver != BITLBEE_ABI_VERSION_CODE) { 63 log_message(LOGLVL_ERROR, 64 "`%s' uses ABI %u but %u is required\n", 65 path, info->abiver, 66 BITLBEE_ABI_VERSION_CODE); 67 return FALSE; 68 } 69 70 if (!info->name || !info->version) { 71 log_message(LOGLVL_ERROR, 72 "Name or version missing from the " 73 "plugin info in `%s'\n", path); 74 return FALSE; 75 } 76 77 for (l = plugins; l; l = l->next) { 78 struct plugin_info *i = l->data; 79 80 if (g_strcasecmp(i->name, info->name) == 0) { 81 loaded = TRUE; 82 break; 83 } 84 } 85 86 if (loaded) { 87 log_message(LOGLVL_WARNING, 88 "%s plugin already loaded\n", 89 info->name); 90 return FALSE; 91 } 92 93 return TRUE; 94 } 95 96 /* semi-private */ 97 gboolean plugin_info_add(struct plugin_info *info) 98 { 99 plugins = g_list_insert_sorted_with_data(plugins, info, pluginscmp, NULL); 100 return TRUE; 101 } 102 52 103 gboolean load_plugin(char *path) 53 104 { 54 GList *l; 55 struct plugin_info *i; 56 struct plugin_info *info; 105 struct plugin_info *info = NULL; 57 106 struct plugin_info * (*info_function) (void) = NULL; 58 107 void (*init_function) (void); 59 108 60 109 GModule *mod = g_module_open(path, G_MODULE_BIND_LAZY); 61 gboolean loaded = FALSE;62 110 63 111 if (!mod) { … … 69 117 info = info_function(); 70 118 71 if (info->abiver != BITLBEE_ABI_VERSION_CODE) { 72 log_message(LOGLVL_ERROR, 73 "`%s' uses ABI %u but %u is required\n", 74 path, info->abiver, 75 BITLBEE_ABI_VERSION_CODE); 76 g_module_close(mod); 77 return FALSE; 78 } 79 80 if (!info->name || !info->version) { 81 log_message(LOGLVL_ERROR, 82 "Name or version missing from the " 83 "plugin info in `%s'\n", path); 84 g_module_close(mod); 85 return FALSE; 86 } 87 88 for (l = plugins; l; l = l->next) { 89 i = l->data; 90 91 if (g_strcasecmp(i->name, info->name) == 0) { 92 loaded = TRUE; 93 break; 94 } 95 } 96 97 if (loaded) { 98 log_message(LOGLVL_WARNING, 99 "%s plugin already loaded\n", 100 info->name); 119 if (!plugin_info_validate(info, path)) { 101 120 g_module_close(mod); 102 121 return FALSE; … … 113 132 114 133 if (info_function) { 115 plugins = g_list_insert_sorted_with_data(plugins, info, 116 pluginscmp, NULL); 134 plugin_info_add(info); 117 135 } 118 136 … … 797 815 msg = ic->acc->flags & ACC_FLAG_AWAY_MESSAGE ? away : NULL; 798 816 away = imc_away_state_find(m, away, &msg) ? : 799 (imc_away_state_find(m, "away", &msg) ? : m->data);817 (imc_away_state_find(m, "away", NULL) ? : m->data); 800 818 } else if (ic->acc->flags & ACC_FLAG_STATUS_MESSAGE) { 801 819 away = NULL; … … 831 849 contains no data unless it adds something to what 832 850 we have in state already. */ 833 if ( strlen(m->data) == strlen(away)) {851 if (message && strlen(m->data) == strlen(away)) { 834 852 *message = NULL; 835 853 } … … 857 875 for (m = gcm; m; m = m->next) { 858 876 if (g_strcasecmp(imc_away_alias_list[i][j], m->data) == 0) { 859 if (!keep_message ) {877 if (!keep_message && message) { 860 878 *message = NULL; 861 879 } -
protocols/oscar/Makefile
r3f44e43 r7a9d968 39 39 $(objects): %.o: $(_SRCDIR_)%.c 40 40 @echo '*' Compiling $< 41 @$(CC) -c $(CFLAGS) $(CFLAGS_BITLBEE) $< -o $@41 $(VERBOSE) $(CC) -c $(CFLAGS) $(CFLAGS_BITLBEE) $< -o $@ 42 42 43 43 oscar_mod.o: $(objects) 44 44 @echo '*' Linking oscar_mod.o 45 @$(LD) $(LFLAGS) $(objects) -o oscar_mod.o45 $(VERBOSE) $(LD) $(LFLAGS) $(objects) -o oscar_mod.o 46 46 47 47 -include .depend/*.d -
protocols/oscar/rxhandlers.c
r3f44e43 r7a9d968 235 235 struct aim_rxcblist_s *newcb; 236 236 237 if (!conn) { 238 return -1; 239 } 240 241 if (checkdisallowed(family, type)) { 242 g_assert(0); 243 return -1; 244 } 237 g_return_val_if_fail(conn, -1); 238 g_return_val_if_fail(!checkdisallowed(family, type), -1); 245 239 246 240 if (!(newcb = (struct aim_rxcblist_s *) g_new0(struct aim_rxcblist_s, 1))) { -
protocols/purple/Makefile
r3f44e43 r7a9d968 39 39 $(objects): %.o: $(_SRCDIR_)%.c 40 40 @echo '*' Compiling $< 41 @$(CC) -c $(CFLAGS) $(CFLAGS_BITLBEE) $< -o $@41 $(VERBOSE) $(CC) -c $(CFLAGS) $(CFLAGS_BITLBEE) $< -o $@ 42 42 43 43 purple_mod.o: $(objects) 44 44 @echo '*' Linking purple_mod.o 45 @$(LD) $(LFLAGS) $(objects) -o purple_mod.o45 $(VERBOSE) $(LD) $(LFLAGS) $(objects) -o purple_mod.o 46 46 47 47 -include .depend/*.d -
protocols/purple/bpurple.h
r3f44e43 r7a9d968 6 6 7 7 #define PURPLE_REQUEST_HANDLE "purple_request" 8 9 #define PURPLE_OPT_SHOULD_SET_NICK 1 8 10 9 11 struct purple_data … … 15 17 char *chat_list_server; 16 18 GSList *filetransfers; 19 20 int flags; 17 21 }; 18 22 -
protocols/purple/ft.c
r3f44e43 r7a9d968 146 146 remove the evil cast below. */ 147 147 px->ft = imcb_file_send_start(ic, (char *) who, xfer->filename, xfer->size); 148 149 if (!px->ft) { 150 return FALSE; 151 } 148 152 px->ft->data = px; 149 153 -
protocols/purple/purple.c
r3f44e43 r7a9d968 114 114 } 115 115 116 static gboolean purple_account_should_set_nick(account_t *acc) 117 { 118 /* whitelist of protocols that tend to have numeric or meaningless usernames, and should 119 * always offer the 'alias' as a nick. this is just so that users don't have to do 120 * 'account whatever set nick_format %full_name' 121 */ 122 char *whitelist[] = { 123 "prpl-hangouts", 124 "prpl-eionrobb-funyahoo-plusplus", 125 "prpl-icq", 126 "prpl-line", 127 NULL, 128 }; 129 char **p; 130 131 for (p = whitelist; *p; p++) { 132 if (g_strcmp0(acc->prpl->data, *p) == 0) { 133 return TRUE; 134 } 135 } 136 137 return FALSE; 138 } 139 116 140 static void purple_init(account_t *acc) 117 141 { … … 281 305 } 282 306 307 if (g_strcmp0(prpl->info->id, "prpl-line") == 0) { 308 s = set_add(&acc->set, "line-auth-token", NULL, NULL, acc); 309 s->flags |= SET_HIDDEN; 310 } 311 283 312 /* Go through all away states to figure out if away/status messages 284 313 are possible. */ … … 344 373 purple_account_set_check_mail(pa, set_getbool(&acc->set, "mail_notifications")); 345 374 } 375 376 if (g_strcmp0(prpl->info->id, "prpl-line") == 0) { 377 const char *name = "line-auth-token"; 378 purple_account_set_string(pa, name, set_getstr(&acc->set, name)); 379 } 346 380 } 347 381 … … 372 406 purple_account_set_password(pd->account, acc->pass); 373 407 purple_sync_settings(acc, pd->account); 408 409 if (purple_account_should_set_nick(acc)) { 410 pd->flags = PURPLE_OPT_SHOULD_SET_NICK; 411 } 374 412 375 413 purple_account_set_enabled(pd->account, "BitlBee", TRUE); … … 741 779 struct groupchat *gc; 742 780 GList *info, *l; 781 GString *missing_settings = NULL; 743 782 744 783 if (!pi->chat_info || !pi->chat_info_defaults || … … 766 805 } else if (strcmp(pce->identifier, "passwd") == 0) { 767 806 g_hash_table_replace(chat_hash, "passwd", g_strdup(password)); 807 } else { 808 char *key, *value; 809 810 key = g_strdup_printf("purple_%s", pce->identifier); 811 str_reject_chars(key, " -", '_'); 812 813 if ((value = set_getstr(sets, key))) { 814 /* sync from bitlbee to the prpl */ 815 g_hash_table_replace(chat_hash, (char *) pce->identifier, g_strdup(value)); 816 } else if ((value = g_hash_table_lookup(chat_hash, pce->identifier))) { 817 /* if the bitlbee one was empty, sync from prpl to bitlbee */ 818 set_setstr(sets, key, value); 819 } 820 821 g_free(key); 822 } 823 824 if (pce->required && !g_hash_table_lookup(chat_hash, pce->identifier)) { 825 if (!missing_settings) { 826 missing_settings = g_string_sized_new(32); 827 } 828 g_string_append_printf(missing_settings, "%s, ", pce->identifier); 768 829 } 769 830 … … 772 833 773 834 g_list_free(info); 835 836 if (missing_settings) { 837 /* remove the ", " from the end */ 838 g_string_truncate(missing_settings, missing_settings->len - 2); 839 840 imcb_error(ic, "Can't join %s. The following settings are required: %s", room, missing_settings->str); 841 842 g_string_free(missing_settings, TRUE); 843 g_hash_table_destroy(chat_hash); 844 return NULL; 845 } 774 846 775 847 /* do this before serv_join_chat to handle cases where prplcb_conv_new is called immediately (not async) */ … … 806 878 purple_roomlist_ref(list); 807 879 } 880 } 881 882 /* handles either prpl->chat_(add|free)_settings depending on the value of 'add' */ 883 static void purple_chat_update_settings(account_t *acc, set_t **head, gboolean add) 884 { 885 PurplePlugin *prpl = purple_plugins_find_with_id((char *) acc->prpl->data); 886 PurplePluginProtocolInfo *pi = prpl->info->extra_info; 887 GList *info, *l; 888 889 if (!pi->chat_info || !pi->chat_info_defaults) { 890 return; 891 } 892 893 /* hack / leap of faith: pass a NULL here because we don't have a connection yet. 894 * i reviewed all the built-in prpls and a bunch of third-party ones and none 895 * of them seem to need this parameter at all, so... i hope it never crashes */ 896 info = pi->chat_info(NULL); 897 898 for (l = info; l; l = l->next) { 899 struct proto_chat_entry *pce = l->data; 900 char *key; 901 902 if (strcmp(pce->identifier, "handle") == 0 || 903 strcmp(pce->identifier, "password") == 0 || 904 strcmp(pce->identifier, "passwd") == 0) { 905 /* skip these, they are handled above */ 906 g_free(pce); 907 continue; 908 } 909 910 key = g_strdup_printf("purple_%s", pce->identifier); 911 str_reject_chars(key, " -", '_'); 912 913 if (add) { 914 set_add(head, key, NULL, NULL, NULL); 915 } else { 916 set_del(head, key); 917 } 918 919 g_free(key); 920 g_free(pce); 921 } 922 923 g_list_free(NULL); 924 g_list_free(info); 925 } 926 927 static void purple_chat_add_settings(account_t *acc, set_t **head) 928 { 929 purple_chat_update_settings(acc, head, TRUE); 930 } 931 932 static void purple_chat_free_settings(account_t *acc, set_t **head) 933 { 934 purple_chat_update_settings(acc, head, FALSE); 808 935 } 809 936 … … 844 971 { 845 972 struct im_connection *ic = purple_ic_by_gc(gc); 846 const char *dn; 973 struct purple_data *pd = ic->proto_data; 974 const char *dn, *token; 847 975 set_t *s; 848 976 … … 857 985 // user list needs to be requested for Gadu-Gadu 858 986 purple_gg_buddylist_import(gc); 987 988 /* more awful hacks, because clearly we didn't have enough of those */ 989 if ((s = set_find(&ic->acc->set, "line-auth-token")) && 990 (token = purple_account_get_string(pd->account, "line-auth-token", NULL))) { 991 g_free(s->value); 992 s->value = g_strdup(token); 993 } 859 994 860 995 ic->flags |= OPT_DOES_HTML; … … 908 1043 PurpleGroup *group = purple_buddy_get_group(bud); 909 1044 struct im_connection *ic = purple_ic_by_pa(bud->account); 1045 struct purple_data *pd = ic->proto_data; 910 1046 PurpleStatus *as; 911 1047 int flags = 0; 1048 char *alias = NULL; 912 1049 913 1050 if (ic == NULL) { … … 915 1052 } 916 1053 917 if (bud->server_alias) { 918 imcb_rename_buddy(ic, bud->name, bud->server_alias); 919 } else if (bud->alias) { 920 imcb_rename_buddy(ic, bud->name, bud->alias); 1054 alias = bud->server_alias ? : bud->alias; 1055 1056 if (alias) { 1057 imcb_rename_buddy(ic, bud->name, alias); 1058 if (pd->flags & PURPLE_OPT_SHOULD_SET_NICK) { 1059 imcb_buddy_nick_change(ic, bud->name, alias); 1060 } 921 1061 } 922 1062 … … 1062 1202 } 1063 1203 1064 /* Handles write_im and write_chat. Removes echoes of locally sent messages */ 1204 /* Handles write_im and write_chat. Removes echoes of locally sent messages. 1205 * 1206 * PURPLE_MESSAGE_DELAYED is used for chat backlogs - if a message has both 1207 * that flag and _SEND, it's a self-message from before joining the channel. 1208 * Those are safe to display. The rest (with just _SEND) may be echoes. */ 1065 1209 static void prplcb_conv_msg(PurpleConversation *conv, const char *who, const char *message, PurpleMessageFlags flags, time_t mtime) 1066 1210 { 1067 if ( !(flags & PURPLE_MESSAGE_SEND)) {1068 handle_conv_msg(conv, who, message, 0, mtime);1211 if ((!(flags & PURPLE_MESSAGE_SEND)) || (flags & PURPLE_MESSAGE_DELAYED)) { 1212 handle_conv_msg(conv, who, message, (flags & PURPLE_MESSAGE_SEND) ? OPT_SELFMESSAGE : 0, mtime); 1069 1213 } 1070 1214 } … … 1392 1536 } 1393 1537 1538 static char *prplcb_roomlist_get_room_name(PurpleRoomlist *list, PurpleRoomlistRoom *room) 1539 { 1540 struct im_connection *ic = purple_ic_by_pa(list->account); 1541 struct purple_data *pd = ic->proto_data; 1542 PurplePlugin *prpl = purple_plugins_find_with_id(pd->account->protocol_id); 1543 PurplePluginProtocolInfo *pi = prpl->info->extra_info; 1544 1545 if (pi && pi->roomlist_room_serialize) { 1546 return pi->roomlist_room_serialize(room); 1547 } else { 1548 return g_strdup(purple_roomlist_room_get_name(room)); 1549 } 1550 } 1551 1394 1552 static void prplcb_roomlist_add_room(PurpleRoomlist *list, PurpleRoomlistRoom *room) 1395 1553 { 1396 1554 bee_chat_info_t *ci; 1397 c onst char *title;1555 char *title; 1398 1556 const char *topic; 1399 1557 GList *fields; … … 1401 1559 1402 1560 fields = purple_roomlist_room_get_fields(room); 1403 title = p urple_roomlist_room_get_name(room);1561 title = prplcb_roomlist_get_room_name(list, room); 1404 1562 1405 1563 if (rld->topic >= 0) { … … 1410 1568 1411 1569 ci = g_new(bee_chat_info_t, 1); 1412 ci->title = g_strdup(title);1570 ci->title = title; 1413 1571 ci->topic = g_strdup(topic); 1414 1572 rld->chats = g_slist_prepend(rld->chats, ci); … … 1632 1790 } 1633 1791 1792 /* borrowing this semi-private function 1793 * TODO: figure out a better interface later (famous last words) */ 1794 gboolean plugin_info_add(struct plugin_info *info); 1795 1634 1796 void purple_initmodule() 1635 1797 { … … 1638 1800 GString *help; 1639 1801 char *dir; 1802 gboolean debug_enabled = !!getenv("BITLBEE_DEBUG"); 1640 1803 1641 1804 if (purple_get_core() != NULL) { … … 1645 1808 } 1646 1809 1647 g_ assert((int) B_EV_IO_READ == (int) PURPLE_INPUT_READ);1648 g_ assert((int) B_EV_IO_WRITE == (int) PURPLE_INPUT_WRITE);1810 g_return_if_fail((int) B_EV_IO_READ == (int) PURPLE_INPUT_READ); 1811 g_return_if_fail((int) B_EV_IO_WRITE == (int) PURPLE_INPUT_WRITE); 1649 1812 1650 1813 dir = g_strdup_printf("%s/purple", global.conf->configdir); … … 1656 1819 g_free(dir); 1657 1820 1658 purple_debug_set_enabled( FALSE);1821 purple_debug_set_enabled(debug_enabled); 1659 1822 purple_core_set_ui_ops(&bee_core_uiops); 1660 1823 purple_eventloop_set_ui_ops(&glib_eventloops); … … 1664 1827 abort(); 1665 1828 } 1829 purple_debug_set_enabled(FALSE); 1666 1830 1667 1831 if (proxytype != PROXY_NONE) { … … 1722 1886 funcs.chat_join = purple_chat_join; 1723 1887 funcs.chat_list = purple_chat_list; 1888 funcs.chat_add_settings = purple_chat_add_settings; 1889 funcs.chat_free_settings = purple_chat_free_settings; 1724 1890 funcs.transfer_request = purple_transfer_request; 1725 1891 … … 1732 1898 PurplePluginProtocolInfo *pi = prot->info->extra_info; 1733 1899 struct prpl *ret; 1900 struct plugin_info *info; 1734 1901 1735 1902 /* If we already have this one (as a native module), don't … … 1766 1933 register_protocol(ret); 1767 1934 } 1935 1936 info = g_new0(struct plugin_info, 1); 1937 info->abiver = BITLBEE_ABI_VERSION_CODE; 1938 info->name = ret->name; 1939 info->version = prot->info->version; 1940 info->description = prot->info->description; 1941 info->author = prot->info->author; 1942 info->url = prot->info->homepage; 1943 1944 plugin_info_add(info); 1768 1945 } 1769 1946 -
protocols/twitter/Makefile
r3f44e43 r7a9d968 38 38 $(objects): %.o: $(_SRCDIR_)%.c 39 39 @echo '*' Compiling $< 40 @$(CC) -c $(CFLAGS) $(CFLAGS_BITLBEE) $< -o $@40 $(VERBOSE) $(CC) -c $(CFLAGS) $(CFLAGS_BITLBEE) $< -o $@ 41 41 42 42 twitter_mod.o: $(objects) 43 43 @echo '*' Linking twitter_mod.o 44 @$(LD) $(LFLAGS) $(objects) -o twitter_mod.o44 $(VERBOSE) $(LD) $(LFLAGS) $(objects) -o twitter_mod.o 45 45 46 46 -include .depend/*.d -
protocols/twitter/twitter.c
r3f44e43 r7a9d968 576 576 s->flags |= SET_HIDDEN | SET_NOSAVE; 577 577 578 s = set_add(&acc->set, "in_korea", "false", set_eval_bool, acc); 579 s->flags |= SET_HIDDEN; 580 578 581 if (strcmp(acc->prpl->name, "twitter") == 0) { 579 582 s = set_add(&acc->set, "stream", "true", set_eval_bool, acc); -
protocols/twitter/twitter_lib.c
r3f44e43 r7a9d968 239 239 if ((ret = json_parse_string(req->reply_body)) == NULL) { 240 240 imcb_error(ic, "Could not retrieve %s: %s", 241 path, " XMLparse error");241 path, "JSON parse error"); 242 242 } 243 243 return ret; … … 310 310 311 311 txl->list = g_slist_prepend(txl->list, 312 g_strdup_printf("% lld", id));312 g_strdup_printf("%" PRIu64, id); 313 313 } 314 314 … … 443 443 txl = g_new0(struct twitter_xml_list, 1); 444 444 txl->list = td->noretweets_ids; 445 445 446 446 // Process the retweet ids 447 447 txl->type = TXL_ID; … … 452 452 jint id = json_array_get_integer(arr, i); 453 453 txl->list = g_slist_prepend(txl->list, 454 g_strdup_printf("% lld", id));454 g_strdup_printf("%" PRId64, id)); 455 455 } 456 456 } … … 713 713 return; 714 714 if ((quoted = json_object_get_object(node, "quoted_status"))) { 715 /* New "retweets with comments" feature. Note that this info 716 * seems to be included in the streaming API only! Grab the 715 /* New "retweets with comments" feature. Grab the 717 716 * full message and try to insert it when we run into the 718 717 * Tweet entity. */ … … 755 754 char *pos, *new; 756 755 757 if (!kort || !disp || !(pos = strstr(*text, kort))) { 756 /* Skip if a required field is missing, if the t.co URL is not in fact 757 in the Tweet at all, or if the full-ish one *is* in it already 758 (dupes appear, especially in streaming API). */ 759 if (!kort || !disp || !(pos = strstr(*text, kort)) || strstr(*text, disp)) { 758 760 continue; 759 761 } … … 980 982 return; 981 983 } 982 984 983 985 /* Check this is not a tweet that should be muted */ 984 986 uid_str = g_strdup_printf("%" G_GUINT64_FORMAT, status->user->uid); … … 1691 1693 }; 1692 1694 1695 if (set_getbool(&ic->acc->set, "in_korea") && !in_reply_to) { 1696 g_free(args[3]); 1697 args[2] = "place_id"; 1698 args[3] = g_strdup("c999e6a453e9ef72"); 1699 in_reply_to = 1; 1700 } 1701 1693 1702 twitter_http(ic, TWITTER_STATUS_UPDATE_URL, twitter_http_post, ic, 1, 1694 1703 args, in_reply_to ? 4 : 2);
Note: See TracChangeset
for help on using the changeset viewer.