comparison libpurple/protocols/silc/silc.c @ 23113:8c3444f04709

propagate from branch 'im.pidgin.pidgin' (head d7144f5dbbde09137aff1ceadfd419e25303bf7d) to branch 'im.pidgin.pidgin.next.minor' (head b6f1c6f279a87ac4b59426eea116c349eb31fe8c)
author Evan Schoenberg <evan.s@dreskin.net>
date Wed, 07 May 2008 12:14:28 +0000
parents bb41bdce8981 67a4c8c46f78
children e0bcb8cfda74
comparison
equal deleted inserted replaced
23112:bb41bdce8981 23113:8c3444f04709
573 if (!purple_account_get_username(account)) 573 if (!purple_account_get_username(account))
574 purple_account_set_username(account, silc_get_username()); 574 purple_account_set_username(account, silc_get_username());
575 575
576 username = (char *)purple_account_get_username(account); 576 username = (char *)purple_account_get_username(account);
577 up = g_strsplit(username, "@", 2); 577 up = g_strsplit(username, "@", 2);
578 username = strdup(up[0]); 578 username = g_strdup(up[0]);
579 g_strfreev(up); 579 g_strfreev(up);
580 580
581 if (!purple_account_get_user_info(account)) { 581 if (!purple_account_get_user_info(account)) {
582 purple_account_set_user_info(account, silc_get_real_name()); 582 purple_account_set_user_info(account, silc_get_real_name());
583 if (!purple_account_get_user_info(account)) 583 if (!purple_account_get_user_info(account))
617 silcpurple_running, sg)) { 617 silcpurple_running, sg)) {
618 purple_connection_error_reason(gc, PURPLE_CONNECTION_ERROR_OTHER_ERROR, 618 purple_connection_error_reason(gc, PURPLE_CONNECTION_ERROR_OTHER_ERROR,
619 _("Cannot initialize SILC protocol")); 619 _("Cannot initialize SILC protocol"));
620 gc->proto_data = NULL; 620 gc->proto_data = NULL;
621 silc_free(sg); 621 silc_free(sg);
622 free(hostname); 622 silc_free(hostname);
623 free(username); 623 g_free(username);
624 return; 624 return;
625 } 625 }
626 free(hostname); 626 silc_free(hostname);
627 free(username); 627 g_free(username);
628 628
629 /* Check the ~/.silc dir and create it, and new key pair if necessary. */ 629 /* Check the ~/.silc dir and create it, and new key pair if necessary. */
630 if (!silcpurple_check_silc_dir(gc)) { 630 if (!silcpurple_check_silc_dir(gc)) {
631 purple_connection_error_reason(gc, PURPLE_CONNECTION_ERROR_OTHER_ERROR, 631 purple_connection_error_reason(gc, PURPLE_CONNECTION_ERROR_OTHER_ERROR,
632 _("Error loading SILC key pair")); 632 _("Error loading SILC key pair"));
2110 NULL, 2110 NULL,
2111 NULL, 2111 NULL,
2112 NULL 2112 NULL
2113 }; 2113 };
2114 2114
2115 #if 0
2116 static SilcBool silcpurple_debug_cb(char *file, char *function, int line,
2117 char *message, void *context)
2118 {
2119 purple_debug_info("SILC", "%s:%d:%s - %s\n", file ? file : "(null)", line, function ? function : "(null)", message ? message : "(null)");
2120 return TRUE;
2121 }
2122 #endif
2123
2115 static void 2124 static void
2116 init_plugin(PurplePlugin *plugin) 2125 init_plugin(PurplePlugin *plugin)
2117 { 2126 {
2118 PurpleAccountOption *option; 2127 PurpleAccountOption *option;
2119 PurpleAccountUserSplit *split; 2128 PurpleAccountUserSplit *split;
2188 silcpurple_register_commands(); 2197 silcpurple_register_commands();
2189 2198
2190 #if 0 2199 #if 0
2191 silc_log_debug(TRUE); 2200 silc_log_debug(TRUE);
2192 silc_log_set_debug_string("*client*"); 2201 silc_log_set_debug_string("*client*");
2202 silc_log_quick(TRUE);
2203 silc_log_set_debug_callbacks(silcpurple_debug_cb, NULL, NULL, NULL);
2193 #endif 2204 #endif
2194 2205
2195 } 2206 }
2196 2207
2197 PURPLE_INIT_PLUGIN(silc, init_plugin, info); 2208 PURPLE_INIT_PLUGIN(silc, init_plugin, info);