Changeset 3fbce97 for protocols/purple
- Timestamp:
- 2016-09-24T20:14:34Z (8 years ago)
- Children:
- ba52ac5
- Parents:
- 63cad66 (diff), 82cb190 (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/purple
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
protocols/purple/ft-direct.c
r63cad66 r3fbce97 193 193 PurpleXferUiOps bee_xfer_uiops = 194 194 { 195 prplcb_xfer_new, 196 prplcb_xfer_dbg, 197 prplcb_xfer_dbg, 198 prplcb_xfer_progress, 199 prplcb_xfer_dbg, 200 prplcb_xfer_dbg, 201 prplcb_xfer_write, 202 prplcb_xfer_read, 203 prplcb_xfer_dbg, 195 prplcb_xfer_new, /* new_xfer */ 196 prplcb_xfer_dbg, /* destroy */ 197 prplcb_xfer_dbg, /* add_xfer */ 198 prplcb_xfer_progress, /* update_progress */ 199 prplcb_xfer_dbg, /* cancel_local */ 200 prplcb_xfer_dbg, /* cancel_remote */ 201 prplcb_xfer_write, /* ui_write */ 202 prplcb_xfer_read, /* ui_read */ 203 prplcb_xfer_dbg, /* data_not_sent */ 204 204 }; 205 205 -
protocols/purple/ft.c
r63cad66 r3fbce97 232 232 } 233 233 234 static void prplcb_xfer_dbg(PurpleXfer *xfer)235 {236 fprintf(stderr, "prplcb_xfer_dbg 0x%p\n", xfer);237 }238 239 234 240 235 /* Sending files (UI->IM): */ … … 337 332 PurpleXferUiOps bee_xfer_uiops = 338 333 { 339 prplcb_xfer_new, 340 prplcb_xfer_destroy, 341 NULL, /* prplcb_xfer_add,*/342 prplcb_xfer_progress, 343 prplcb_xfer_dbg,344 prplcb_xfer_cancel_remote, 345 NULL, 346 NULL, 347 prplcb_xfer_dbg,334 prplcb_xfer_new, /* new_xfer */ 335 prplcb_xfer_destroy, /* destroy */ 336 NULL, /* add_xfer */ 337 prplcb_xfer_progress, /* update_progress */ 338 NULL, /* cancel_local */ 339 prplcb_xfer_cancel_remote, /* cancel_remote */ 340 NULL, /* ui_write */ 341 NULL, /* ui_read */ 342 NULL, /* data_not_sent */ 348 343 }; -
protocols/purple/purple.c
r63cad66 r3fbce97 113 113 servers anyway! */ 114 114 if (!dir_fixed) { 115 PurpleCertificatePool *pool; 115 116 irc_t *irc = acc->bee->ui_data; 116 117 char *dir; … … 122 123 purple_blist_load(); 123 124 purple_prefs_load(); 125 126 if (proxytype == PROXY_SOCKS4A) { 127 /* do this here after loading prefs. yes, i know, it sucks */ 128 purple_prefs_set_bool("/purple/proxy/socks4_remotedns", TRUE); 129 } 130 131 /* re-create the certificate cache directory */ 132 pool = purple_certificate_find_pool("x509", "tls_peers"); 133 dir = purple_certificate_pool_mkpath(pool, NULL); 134 purple_build_dir(dir, 0700); 135 g_free(dir); 136 124 137 dir_fixed = TRUE; 125 138 } … … 352 365 if (!pd) { 353 366 return; 367 } 368 369 while (ic->groupchats) { 370 imcb_chat_free(ic->groupchats->data); 354 371 } 355 372 … … 639 656 /* Call the fucker. */ 640 657 callback = (void *) mi->callback; 641 callback(&pb->node, m enu->data);658 callback(&pb->node, mi->data); 642 659 643 660 return NULL; … … 707 724 g_hash_table_replace(chat_hash, "passwd", g_strdup(password)); 708 725 } 709 } 726 727 g_free(pce); 728 } 729 730 g_list_free(info); 710 731 711 732 serv_join_chat(purple_account_get_connection(pd->account), chat_hash); 712 733 713 return NULL; 734 g_hash_table_destroy(chat_hash); 735 736 return imcb_chat_new(ic, room); 714 737 } 715 738 … … 733 756 static PurpleCoreUiOps bee_core_uiops = 734 757 { 735 NULL, 736 NULL, 737 purple_ui_init, 738 NULL, 739 prplcb_ui_info, 758 NULL, /* ui_prefs_init */ 759 NULL, /* debug_ui_init */ 760 purple_ui_init, /* ui_init */ 761 NULL, /* quit */ 762 prplcb_ui_info, /* get_ui_info */ 740 763 }; 741 764 … … 764 787 purple_gg_buddylist_import(gc); 765 788 766 if (gc->flags & PURPLE_CONNECTION_HTML) { 767 ic->flags |= OPT_DOES_HTML; 768 } 789 ic->flags |= OPT_DOES_HTML; 769 790 } 770 791 … … 800 821 static PurpleConnectionUiOps bee_conn_uiops = 801 822 { 802 prplcb_conn_progress, 803 prplcb_conn_connected, 804 prplcb_conn_disconnected, 805 prplcb_conn_notice, 806 NULL, 807 NULL, 808 NULL, 809 prplcb_conn_report_disconnect_reason, 823 prplcb_conn_progress, /* connect_progress */ 824 prplcb_conn_connected, /* connected */ 825 prplcb_conn_disconnected, /* disconnected */ 826 prplcb_conn_notice, /* notice */ 827 NULL, /* report_disconnect */ 828 NULL, /* network_connected */ 829 NULL, /* network_disconnected */ 830 prplcb_conn_report_disconnect_reason, /* report_disconnect_reason */ 810 831 }; 811 832 … … 882 903 static PurpleBlistUiOps bee_blist_uiops = 883 904 { 884 NULL, 885 prplcb_blist_new, 886 NULL, 887 prplcb_blist_update, 888 prplcb_blist_remove, 905 NULL, /* new_list */ 906 prplcb_blist_new, /* new_node */ 907 NULL, /* show */ 908 prplcb_blist_update, /* update */ 909 prplcb_blist_remove, /* remove */ 889 910 }; 890 911 … … 895 916 struct groupchat *gc; 896 917 897 gc = imcb_chat_new(ic, conv->name); 898 if (conv->title != NULL) { 899 imcb_chat_name_hint(gc, conv->title); 918 gc = bee_chat_by_title(ic->bee, ic, conv->name); 919 920 if (!gc) { 921 gc = imcb_chat_new(ic, conv->name); 922 if (conv->title != NULL) { 923 imcb_chat_name_hint(gc, conv->title); 924 } 925 } 926 927 /* don't set the topic if it's just the name */ 928 if (conv->title != NULL && strcmp(conv->name, conv->title) != 0) { 900 929 imcb_chat_topic(gc, NULL, conv->title, 0); 901 930 } … … 940 969 } 941 970 942 void prplcb_conv_chat_msg(PurpleConversation *conv, const char *who, const char *message, PurpleMessageFlags flags, 943 time_t mtime) 944 { 971 /* Generic handler for IM or chat messages, covers write_chat, write_im and write_conv */ 972 static void handle_conv_msg(PurpleConversation *conv, const char *who, const char *message, guint32 bee_flags, time_t mtime) 973 { 974 struct im_connection *ic = purple_ic_by_pa(conv->account); 945 975 struct groupchat *gc = conv->ui_data; 946 976 PurpleBuddy *buddy; 947 948 /* ..._SEND means it's an outgoing message, no need to echo those. */949 if (flags & PURPLE_MESSAGE_SEND) {950 return;951 }952 977 953 978 buddy = purple_find_buddy(conv->account, who); … … 956 981 } 957 982 958 imcb_chat_msg(gc, who, (char *) message, 0, mtime); 959 } 960 961 static void prplcb_conv_im(PurpleConversation *conv, const char *who, const char *message, PurpleMessageFlags flags, 962 time_t mtime) 963 { 964 struct im_connection *ic = purple_ic_by_pa(conv->account); 965 PurpleBuddy *buddy; 966 967 /* ..._SEND means it's an outgoing message, no need to echo those. */ 983 if (conv->type == PURPLE_CONV_TYPE_IM) { 984 imcb_buddy_msg(ic, (char *) who, (char *) message, bee_flags, mtime); 985 } else if (gc) { 986 imcb_chat_msg(gc, who, (char *) message, bee_flags, mtime); 987 } 988 } 989 990 /* Handles write_im and write_chat. Removes echoes of locally sent messages */ 991 static void prplcb_conv_msg(PurpleConversation *conv, const char *who, const char *message, PurpleMessageFlags flags, time_t mtime) 992 { 993 if (!(flags & PURPLE_MESSAGE_SEND)) { 994 handle_conv_msg(conv, who, message, 0, mtime); 995 } 996 } 997 998 /* Handles write_conv. Only passes self messages from other locations through. 999 * That is, only writes of PURPLE_MESSAGE_SEND. 1000 * There are more events which might be handled in the future, but some are tricky. 1001 * (images look like <img id="123">, what do i do with that?) */ 1002 static void prplcb_conv_write(PurpleConversation *conv, const char *who, const char *alias, const char *message, 1003 PurpleMessageFlags flags, time_t mtime) 1004 { 968 1005 if (flags & PURPLE_MESSAGE_SEND) { 969 return; 970 } 971 972 buddy = purple_find_buddy(conv->account, who); 973 if (buddy != NULL) { 974 who = purple_buddy_get_name(buddy); 975 } 976 977 imcb_buddy_msg(ic, (char *) who, (char *) message, 0, mtime); 1006 handle_conv_msg(conv, who, message, OPT_SELFMESSAGE, mtime); 1007 } 978 1008 } 979 1009 … … 1008 1038 prplcb_conv_new, /* create_conversation */ 1009 1039 prplcb_conv_free, /* destroy_conversation */ 1010 prplcb_conv_ chat_msg,/* write_chat */1011 prplcb_conv_ im,/* write_im */1012 NULL,/* write_conv */1040 prplcb_conv_msg, /* write_chat */ 1041 prplcb_conv_msg, /* write_im */ 1042 prplcb_conv_write, /* write_conv */ 1013 1043 prplcb_conv_add_users, /* chat_add_users */ 1014 1044 NULL, /* chat_rename_user */ … … 1175 1205 static PurpleRequestUiOps bee_request_uiops = 1176 1206 { 1177 prplcb_request_input, 1178 NULL, 1179 prplcb_request_action, 1180 NULL, 1181 NULL, 1182 prplcb_close_request, 1183 NULL, 1207 prplcb_request_input, /* request_input */ 1208 NULL, /* request_choice */ 1209 prplcb_request_action, /* request_action */ 1210 NULL, /* request_fields */ 1211 NULL, /* request_file */ 1212 prplcb_close_request, /* close_request */ 1213 NULL, /* request_folder */ 1184 1214 }; 1185 1215 … … 1222 1252 static PurplePrivacyUiOps bee_privacy_uiops = 1223 1253 { 1224 prplcb_privacy_permit_added, 1225 prplcb_privacy_permit_removed, 1226 prplcb_privacy_deny_added, 1227 prplcb_privacy_deny_removed, 1254 prplcb_privacy_permit_added, /* permit_added */ 1255 prplcb_privacy_permit_removed, /* permit_removed */ 1256 prplcb_privacy_deny_added, /* deny_added */ 1257 prplcb_privacy_deny_removed, /* deny_removed */ 1228 1258 }; 1229 1259 … … 1235 1265 static PurpleDebugUiOps bee_debug_uiops = 1236 1266 { 1237 prplcb_debug_print, 1267 prplcb_debug_print, /* print */ 1238 1268 }; 1239 1269 … … 1256 1286 static PurpleEventLoopUiOps glib_eventloops = 1257 1287 { 1258 prplcb_ev_timeout_add, 1259 prplcb_ev_remove, 1260 prplcb_ev_input_add, 1261 prplcb_ev_remove, 1288 prplcb_ev_timeout_add, /* timeout_add */ 1289 prplcb_ev_remove, /* timeout_remove */ 1290 prplcb_ev_input_add, /* input_add */ 1291 prplcb_ev_remove, /* input_remove */ 1262 1292 }; 1293 1294 /* Absolutely no connection context at all. Thanks purple! brb crying */ 1295 static void *prplcb_notify_message(PurpleNotifyMsgType type, const char *title, 1296 const char *primary, const char *secondary) 1297 { 1298 char *text = g_strdup_printf("%s%s - %s%s%s", 1299 (type == PURPLE_NOTIFY_MSG_ERROR) ? "Error: " : "", 1300 title, 1301 primary ?: "", 1302 (primary && secondary) ? " - " : "", 1303 secondary ?: "" 1304 ); 1305 1306 if (local_bee->ui->log) { 1307 local_bee->ui->log(local_bee, "purple", text); 1308 } 1309 1310 g_free(text); 1311 1312 return NULL; 1313 } 1263 1314 1264 1315 static void *prplcb_notify_email(PurpleConnection *gc, const char *subject, const char *from, … … 1322 1373 static PurpleNotifyUiOps bee_notify_uiops = 1323 1374 { 1324 NULL,1325 prplcb_notify_email, 1326 NULL, 1327 NULL, 1328 NULL, 1329 NULL, 1330 prplcb_notify_userinfo, 1375 prplcb_notify_message, /* notify_message */ 1376 prplcb_notify_email, /* notify_email */ 1377 NULL, /* notify_emails */ 1378 NULL, /* notify_formatted */ 1379 NULL, /* notify_searchresults */ 1380 NULL, /* notify_searchresults_new_rows */ 1381 prplcb_notify_userinfo, /* notify_userinfo */ 1331 1382 }; 1332 1383 … … 1355 1406 static PurpleAccountUiOps bee_account_uiops = 1356 1407 { 1357 NULL, 1358 NULL, 1359 NULL, 1360 prplcb_account_request_authorize, 1361 NULL, 1408 NULL, /* notify_added */ 1409 NULL, /* status_changed */ 1410 NULL, /* request_add */ 1411 prplcb_account_request_authorize, /* request_authorize */ 1412 NULL, /* close_account_request */ 1362 1413 }; 1363 1414 … … 1387 1438 char *dir; 1388 1439 1389 if (B_EV_IO_READ != PURPLE_INPUT_READ || 1390 B_EV_IO_WRITE != PURPLE_INPUT_WRITE) { 1391 /* FIXME FIXME FIXME FIXME FIXME :-) */ 1392 exit(1); 1393 } 1440 g_assert((int) B_EV_IO_READ == (int) PURPLE_INPUT_READ); 1441 g_assert((int) B_EV_IO_WRITE == (int) PURPLE_INPUT_WRITE); 1394 1442 1395 1443 dir = g_strdup_printf("%s/purple", global.conf->configdir); … … 1409 1457 PurpleProxyInfo *pi = purple_global_proxy_get_info(); 1410 1458 switch (proxytype) { 1459 case PROXY_SOCKS4A: 1411 1460 case PROXY_SOCKS4: 1412 1461 purple_proxy_info_set_type(pi, PURPLE_PROXY_SOCKS4);
Note: See TracChangeset
for help on using the changeset viewer.