static void winprefs_set_autostart(GtkWidget *w) { char *runval = NULL; if(gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(w))) runval = g_strdup_printf("\"%s" G_DIR_SEPARATOR_S "pidgin.exe\"", wpurple_install_dir()); if(!wpurple_write_reg_string(HKEY_CURRENT_USER, RUNKEY, "Pidgin", runval) /* For Win98 */ && !wpurple_write_reg_string(HKEY_LOCAL_MACHINE, RUNKEY, "Pidgin", runval)) purple_debug_error(WINPREFS_PLUGIN_ID, "Could not set registry key value\n"); g_free(runval); }
gchar *qq_get_icon_path(gchar *icon_name) { gchar *icon_path; const gchar *icon_dir; #ifdef _WIN32 static char *dir = NULL; if (dir == NULL) { dir = g_build_filename(wpurple_install_dir(), "pixmaps", "purple", "buddy_icons", "qq", NULL); } #endif icon_dir = purple_prefs_get_string("/plugins/prpl/qq/icon_dir"); if ( icon_dir == NULL || strlen(icon_dir) == 0) { #ifdef _WIN32 icon_dir = dir; #else icon_dir = QQ_BUDDY_ICON_DIR; #endif } icon_path = g_strdup_printf("%s%c%s", icon_dir, G_DIR_SEPARATOR, icon_name); return icon_path; }
static void init_plugin(PurplePlugin *plugin) { #ifdef HAVE_CYRUS_SASL #ifdef _WIN32 UINT old_error_mode; gchar *sasldir; #endif int ret; #endif PurpleAccountUserSplit *split; PurpleAccountOption *option; /* Translators: 'domain' is used here in the context of Internet domains, e.g. pidgin.im */ split = purple_account_user_split_new(_("Domain"), NULL, '@'); purple_account_user_split_set_reverse(split, FALSE); prpl_info.user_splits = g_list_append(prpl_info.user_splits, split); split = purple_account_user_split_new(_("Resource"), NULL, '/'); purple_account_user_split_set_reverse(split, FALSE); prpl_info.user_splits = g_list_append(prpl_info.user_splits, split); option = purple_account_option_bool_new(_("Require SSL/TLS"), "require_tls", FALSE); prpl_info.protocol_options = g_list_append(prpl_info.protocol_options, option); option = purple_account_option_bool_new(_("Force old (port 5223) SSL"), "old_ssl", FALSE); prpl_info.protocol_options = g_list_append(prpl_info.protocol_options, option); option = purple_account_option_bool_new( _("Allow plaintext auth over unencrypted streams"), "auth_plain_in_clear", FALSE); prpl_info.protocol_options = g_list_append(prpl_info.protocol_options, option); option = purple_account_option_int_new(_("Connect port"), "port", 5222); prpl_info.protocol_options = g_list_append(prpl_info.protocol_options, option); option = purple_account_option_string_new(_("Connect server"), "connect_server", NULL); prpl_info.protocol_options = g_list_append(prpl_info.protocol_options, option); option = purple_account_option_string_new(_("File transfer proxies"), "ft_proxies", /* TODO: Is this an acceptable default? */ "proxy.jabber.org"); prpl_info.protocol_options = g_list_append(prpl_info.protocol_options, option); /* this should probably be part of global smiley theme settings later on, shared with MSN */ option = purple_account_option_bool_new(_("Show Custom Smileys"), "custom_smileys", TRUE); prpl_info.protocol_options = g_list_append(prpl_info.protocol_options, option); jabber_init_plugin(plugin); purple_prefs_remove("/plugins/prpl/jabber"); /* XXX - If any other plugin wants SASL this won't be good ... */ #ifdef HAVE_CYRUS_SASL #ifdef _WIN32 sasldir = g_build_filename(wpurple_install_dir(), "sasl2", NULL); sasl_set_path(SASL_PATH_TYPE_PLUGIN, sasldir); g_free(sasldir); /* Suppress error popups for failing to load sasl plugins */ old_error_mode = SetErrorMode(SEM_FAILCRITICALERRORS); #endif if ((ret = sasl_client_init(NULL)) != SASL_OK) { purple_debug_error("xmpp", "Error (%d) initializing SASL.\n", ret); } #ifdef _WIN32 /* Restore the original error mode */ SetErrorMode(old_error_mode); #endif #endif jabber_register_commands(); jabber_iq_init(); jabber_pep_init(); jabber_tune_init(); jabber_caps_init(); jabber_data_init(); jabber_add_feature("avatarmeta", AVATARNAMESPACEMETA, jabber_pep_namespace_only_when_pep_enabled_cb); jabber_add_feature("avatardata", AVATARNAMESPACEDATA, jabber_pep_namespace_only_when_pep_enabled_cb); jabber_add_feature("buzz", "http://www.xmpp.org/extensions/xep-0224.html#ns", jabber_buzz_isenabled); jabber_add_feature("bob", XEP_0231_NAMESPACE, jabber_custom_smileys_isenabled); jabber_pep_register_handler("avatar", AVATARNAMESPACEMETA, jabber_buddy_avatar_update_metadata); }
const char* global_data_dir() { static char dir[512]; snprintf(dir,sizeof(dir),"%s"LWQQ_PATH_SEP"share",(char*)wpurple_install_dir()); return dir; }
static void init_plugin(PurplePlugin *plugin) { #ifdef HAVE_CYRUS_SASL #ifdef _WIN32 UINT old_error_mode; gchar *sasldir; #endif int ret; #endif PurpleAccountUserSplit *split; PurpleAccountOption *option; /* Translators: 'domain' is used here in the context of Internet domains, e.g. pidgin.im */ split = purple_account_user_split_new(_("Domain"), NULL, '@'); purple_account_user_split_set_reverse(split, FALSE); prpl_info.user_splits = g_list_append(prpl_info.user_splits, split); split = purple_account_user_split_new(_("Resource"), NULL, '/'); purple_account_user_split_set_reverse(split, FALSE); prpl_info.user_splits = g_list_append(prpl_info.user_splits, split); option = purple_account_option_bool_new(_("Require SSL/TLS"), "require_tls", JABBER_DEFAULT_REQUIRE_TLS); prpl_info.protocol_options = g_list_append(prpl_info.protocol_options, option); option = purple_account_option_bool_new(_("Force old (port 5223) SSL"), "old_ssl", FALSE); prpl_info.protocol_options = g_list_append(prpl_info.protocol_options, option); option = purple_account_option_bool_new( _("Allow plaintext auth over unencrypted streams"), "auth_plain_in_clear", FALSE); prpl_info.protocol_options = g_list_append(prpl_info.protocol_options, option); option = purple_account_option_int_new(_("Connect port"), "port", 5222); prpl_info.protocol_options = g_list_append(prpl_info.protocol_options, option); option = purple_account_option_string_new(_("Connect server"), "connect_server", NULL); prpl_info.protocol_options = g_list_append(prpl_info.protocol_options, option); option = purple_account_option_string_new(_("File transfer proxies"), "ft_proxies", /* TODO: Is this an acceptable default? * Also, keep this in sync as they add more servers */ "proxy.eu.jabber.org"); prpl_info.protocol_options = g_list_append(prpl_info.protocol_options, option); option = purple_account_option_string_new(_("BOSH URL"), "bosh_url", NULL); prpl_info.protocol_options = g_list_append(prpl_info.protocol_options, option); /* this should probably be part of global smiley theme settings later on, shared with MSN */ option = purple_account_option_bool_new(_("Show Custom Smileys"), "custom_smileys", TRUE); prpl_info.protocol_options = g_list_append(prpl_info.protocol_options, option); my_protocol = plugin; jabber_init_plugin(plugin); purple_prefs_remove("/plugins/prpl/jabber"); /* XXX - If any other plugin wants SASL this won't be good ... */ #ifdef HAVE_CYRUS_SASL #ifdef _WIN32 sasldir = g_build_filename(wpurple_install_dir(), "sasl2", NULL); sasl_set_path(SASL_PATH_TYPE_PLUGIN, sasldir); g_free(sasldir); /* Suppress error popups for failing to load sasl plugins */ old_error_mode = SetErrorMode(SEM_FAILCRITICALERRORS); #endif if ((ret = sasl_client_init(NULL)) != SASL_OK) { purple_debug_error("xmpp", "Error (%d) initializing SASL.\n", ret); } #ifdef _WIN32 /* Restore the original error mode */ SetErrorMode(old_error_mode); #endif #endif jabber_register_commands(); /* reverse order of unload_plugin */ jabber_iq_init(); jabber_caps_init(); /* PEP things should be init via jabber_pep_init, not here */ jabber_pep_init(); jabber_data_init(); jabber_bosh_init(); /* BEGIN SPICEBIRD CHANGES */ #if 0 #warning implement adding and retrieving own features via IPC API #endif /* END SPICEBIRD CHANGES */ jabber_ibb_init(); jabber_si_init(); purple_signal_connect(purple_get_core(), "uri-handler", plugin, PURPLE_CALLBACK(xmpp_uri_handler), NULL); }