Пример #1
0
/*------------------------------------------------------------------------
 * Initializing the MXit protocol instance.
 *
 *  @param protocol	The MXit protocol
 */
static void
mxit_protocol_init( PurpleProtocol *protocol )
{
	PurpleAccountOption *option;

	protocol->id        = MXIT_PROTOCOL_ID;
	protocol->name      = MXIT_PROTOCOL_NAME;
	protocol->options   = OPT_PROTO_REGISTER_NOSCREENNAME |
	                      OPT_PROTO_UNIQUE_CHATNAME |
	                      OPT_PROTO_INVITE_MESSAGE |
	                      OPT_PROTO_AUTHORIZATION_DENIED_MESSAGE;
	protocol->icon_spec = purple_buddy_icon_spec_new(
		"png,jpeg,bmp",										/* supported formats */
		32, 32,												/* min width & height */
		800, 800,											/* max width & height */
		CP_MAX_FILESIZE,									/* max filesize */
		PURPLE_ICON_SCALE_SEND | PURPLE_ICON_SCALE_DISPLAY	/* scaling rules */
	);

	/* Configuration options */

	/* WAP server (reference: "libpurple/accountopt.h") */
	option = purple_account_option_string_new( _( "WAP Server" ), MXIT_CONFIG_WAPSERVER, DEFAULT_WAPSITE );
	protocol->account_options = g_list_append( protocol->account_options, option );

	option = purple_account_option_bool_new( _( "Connect via HTTP" ), MXIT_CONFIG_USE_HTTP, FALSE );
	protocol->account_options = g_list_append( protocol->account_options, option );

	option = purple_account_option_bool_new( _( "Enable splash-screen popup" ), MXIT_CONFIG_SPLASHPOPUP, FALSE );
	protocol->account_options = g_list_append( protocol->account_options, option );
}
Пример #2
0
static void
init_plugin(PurplePlugin *plugin)
{
	PurpleAccountOption *option;

	option = purple_account_option_int_new(_("Pager port"), "port", YAHOO_PAGER_PORT);
	prpl_info.protocol_options = g_list_append(prpl_info.protocol_options, option);

	option = purple_account_option_string_new(_("File transfer server"), "xfer_host", YAHOOJP_XFER_HOST);
	prpl_info.protocol_options = g_list_append(prpl_info.protocol_options, option);

	option = purple_account_option_int_new(_("File transfer port"), "xfer_port", YAHOO_XFER_PORT);
	prpl_info.protocol_options = g_list_append(prpl_info.protocol_options, option);

	option = purple_account_option_string_new(_("Chat room locale"), "room_list_locale", YAHOOJP_ROOMLIST_LOCALE);
	prpl_info.protocol_options = g_list_append(prpl_info.protocol_options, option);

	option = purple_account_option_string_new(_("Encoding"), "local_charset", "UTF-8");
	prpl_info.protocol_options = g_list_append(prpl_info.protocol_options, option);

	option = purple_account_option_bool_new(_("Ignore conference and chatroom invitations"), "ignore_invites", FALSE);
	prpl_info.protocol_options = g_list_append(prpl_info.protocol_options, option);

	option = purple_account_option_bool_new(_("Use account proxy for HTTP and HTTPS connections"), "proxy_ssl", FALSE);
	prpl_info.protocol_options = g_list_append(prpl_info.protocol_options, option);

#if 0
	option = purple_account_option_string_new(_("Chat room list URL"), "room_list", YAHOO_ROOMLIST_URL);
	prpl_info.protocol_options = g_list_append(prpl_info.protocol_options, option);
#endif

	yahoojp_register_commands();
	yahoo_init_colorht();
}
Пример #3
0
Файл: irc.c Проект: dylex/pidgin
static void _init_plugin(PurplePlugin *plugin)
{
	PurpleAccountUserSplit *split;
	PurpleAccountOption *option;

	split = purple_account_user_split_new(_("Server"), IRC_DEFAULT_SERVER, '@');
	prpl_info.user_splits = g_list_append(prpl_info.user_splits, split);

	option = purple_account_option_int_new(_("Port"), "port", IRC_DEFAULT_PORT);
	prpl_info.protocol_options = g_list_append(prpl_info.protocol_options, option);

	option = purple_account_option_string_new(_("Encodings"), "encoding", IRC_DEFAULT_CHARSET);
	prpl_info.protocol_options = g_list_append(prpl_info.protocol_options, option);

	option = purple_account_option_bool_new(_("Auto-detect incoming UTF-8"), "autodetect_utf8", IRC_DEFAULT_AUTODETECT);
	prpl_info.protocol_options = g_list_append(prpl_info.protocol_options, option);

	option = purple_account_option_string_new(_("Ident name"), "username", "");
	prpl_info.protocol_options = g_list_append(prpl_info.protocol_options, option);

	option = purple_account_option_string_new(_("Real name"), "realname", "");
	prpl_info.protocol_options = g_list_append(prpl_info.protocol_options, option);

	/*
	option = purple_account_option_string_new(_("Quit message"), "quitmsg", IRC_DEFAULT_QUIT);
	prpl_info.protocol_options = g_list_append(prpl_info.protocol_options, option);
	*/

	option = purple_account_option_bool_new(_("Use SSL"), "ssl", FALSE);
	prpl_info.protocol_options = g_list_append(prpl_info.protocol_options, option);

#ifdef HAVE_CYRUS_SASL
	option = purple_account_option_bool_new(_("Authenticate with SASL"), "sasl", FALSE);
	prpl_info.protocol_options = g_list_append(prpl_info.protocol_options, option);

	option = purple_account_option_bool_new(
						_("Allow plaintext SASL auth over unencrypted connection"),
						"auth_plain_in_clear", FALSE);
	prpl_info.protocol_options = g_list_append(prpl_info.protocol_options, option);
#endif

	_irc_plugin = plugin;

	purple_prefs_remove("/plugins/prpl/irc/quitmsg");
	purple_prefs_remove("/plugins/prpl/irc");

	irc_register_commands();
}
Пример #4
0
G_MODULE_EXPORT gboolean 
purple_init_plugin(PurplePlugin *plugin)
{
	PurplePluginInfo *info = g_new0(PurplePluginInfo, 1);
	PurplePluginProtocolInfo *prpl_info = g_new0(PurplePluginProtocolInfo, 1);
#endif

#if PURPLE_VERSION_CHECK(3, 0, 0)
static void 
skypeweb_protocol_init(PurpleProtocol *prpl_info) 
{
	PurpleProtocol *info = prpl_info;
#endif
	PurpleAccountOption *option;
	PurpleBuddyIconSpec icon_spec = {"jpeg", 0, 0, 96, 96, 0, PURPLE_ICON_SCALE_DISPLAY};

	//PurpleProtocol
	info->id = SKYPEWEB_PLUGIN_ID;
	info->name = "Skype (HTTP)";
	prpl_info->options = OPT_PROTO_CHAT_TOPIC | OPT_PROTO_INVITE_MESSAGE /*| OPT_PROTO_IM_IMAGE*/;
	option = purple_account_option_bool_new("", "", FALSE);
#if !PURPLE_VERSION_CHECK(3, 0, 0)
	prpl_info->protocol_options = g_list_append(prpl_info->protocol_options, option);
	prpl_info->icon_spec = icon_spec;
#else
	prpl_info->account_options = g_list_append(prpl_info->account_options, option);
	prpl_info->icon_spec = &icon_spec;
#endif
	
#if PURPLE_VERSION_CHECK(3, 0, 0)
}
Пример #5
0
static void _init_plugin(PurplePlugin *plugin)
{
	PurpleAccountUserSplit *split;
	PurpleAccountOption *option;

	split = purple_account_user_split_new(_("Server"), IRC_DEFAULT_SERVER, '@');
	prpl_info.user_splits = g_list_append(prpl_info.user_splits, split);

	option = purple_account_option_int_new(_("Port"), "port", IRC_DEFAULT_PORT);
	prpl_info.protocol_options = g_list_append(prpl_info.protocol_options, option);

	option = purple_account_option_string_new(_("Encodings"), "encoding", IRC_DEFAULT_CHARSET);
	prpl_info.protocol_options = g_list_append(prpl_info.protocol_options, option);

	option = purple_account_option_string_new(_("Username"), "username", "");
	prpl_info.protocol_options = g_list_append(prpl_info.protocol_options, option);

	option = purple_account_option_string_new(_("Real name"), "realname", "");
	prpl_info.protocol_options = g_list_append(prpl_info.protocol_options, option);

	/*
	option = purple_account_option_string_new(_("Quit message"), "quitmsg", IRC_DEFAULT_QUIT);
	prpl_info.protocol_options = g_list_append(prpl_info.protocol_options, option);
	*/

	option = purple_account_option_bool_new(_("Use SSL"), "ssl", FALSE);
	prpl_info.protocol_options = g_list_append(prpl_info.protocol_options, option);

	_irc_plugin = plugin;

	purple_prefs_remove("/plugins/prpl/irc/quitmsg");
	purple_prefs_remove("/plugins/prpl/irc");

	irc_register_commands();
}
Пример #6
0
static void
init_plugin(PurplePlugin *plugin)
{
	PurpleAccountOption *option;

	option = purple_account_option_string_new(_("Pager server"), "server", YAHOO_PAGER_HOST);
	prpl_info.protocol_options = g_list_append(prpl_info.protocol_options, option);

	option = purple_account_option_int_new(_("Pager port"), "port", YAHOO_PAGER_PORT);
	prpl_info.protocol_options = g_list_append(prpl_info.protocol_options, option);

	option = purple_account_option_string_new(_("File transfer server"), "xfer_host", YAHOO_XFER_HOST);
	prpl_info.protocol_options = g_list_append(prpl_info.protocol_options, option);

	option = purple_account_option_int_new(_("File transfer port"), "xfer_port", YAHOO_XFER_PORT);
	prpl_info.protocol_options = g_list_append(prpl_info.protocol_options, option);

	option = purple_account_option_string_new(_("Chat room locale"), "room_list_locale", YAHOO_ROOMLIST_LOCALE);
	prpl_info.protocol_options = g_list_append(prpl_info.protocol_options, option);

	option = purple_account_option_string_new(_("Encoding"), "local_charset", "UTF-8");
	prpl_info.protocol_options = g_list_append(prpl_info.protocol_options, option);

	option = purple_account_option_bool_new(_("Ignore conference and chatroom invitations"), "ignore_invites", FALSE);
	prpl_info.protocol_options = g_list_append(prpl_info.protocol_options, option);

	option = purple_account_option_bool_new(_("Use account proxy for SSL connections"), "proxy_ssl", FALSE);
	prpl_info.protocol_options = g_list_append(prpl_info.protocol_options, option);

#if 0
	option = purple_account_option_string_new(_("Chat room list URL"), "room_list", YAHOO_ROOMLIST_URL);
	prpl_info.protocol_options = g_list_append(prpl_info.protocol_options, option);

	option = purple_account_option_string_new(_("Yahoo Chat server"), "ycht-server", YAHOO_YCHT_HOST);
	prpl_info.protocol_options = g_list_append(prpl_info.protocol_options, option);

	option = purple_account_option_int_new(_("Yahoo Chat port"), "ycht-port", YAHOO_YCHT_PORT);
	prpl_info.protocol_options = g_list_append(prpl_info.protocol_options, option);
#endif

	my_protocol = plugin;
	yahoo_register_commands();
	yahoo_init_colorht();

	purple_signal_connect(purple_get_core(), "uri-handler", plugin,
		PURPLE_CALLBACK(yahoo_uri_handler), NULL);
}
Пример #7
0
static void
init_plugin(PurplePlugin *plugin)
{
        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"), "Home", '/');
		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(_("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);


        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
        sasl_client_init(NULL);
#endif
        jabber_register_commands();

        jabber_iq_init();
}
Пример #8
0
static void tgprpl_init (PurplePlugin *plugin) {
  PurpleAccountOption *opt;
  
  opt = purple_account_option_bool_new("Fallback SMS verification", "compat-verification", 0);
  prpl_info.protocol_options = g_list_append(prpl_info.protocol_options, opt);
  
  _telegram_protocol = plugin;
}
Пример #9
0
static void
init_plugin(PurplePlugin *plugin)
{
    purple_debug_warning("np","\n=== START LOG ==\n");
    
    PurpleAccountOption *option;

    option = purple_account_option_string_new(_("Server"), "server",
                                              NP_IM_SERVER);
	prpl_info.protocol_options = g_list_append(prpl_info.protocol_options,
											   option);
    
	option = purple_account_option_int_new(_("Port"), "port", NP_IM_PORT);
	prpl_info.protocol_options = g_list_append(prpl_info.protocol_options,
											   option);
    
	option = purple_account_option_string_new(_("HTTP Method Server"),
                                              "http_method_server", NP_HTTPCONN_SERVER);
	prpl_info.protocol_options = g_list_append(prpl_info.protocol_options,
											   option);
    // User-Agent
    option = purple_account_option_string_new(_("User-Agent"),
                                              "np_user_agent", NP_USER_AGENT);
	prpl_info.protocol_options = g_list_append(prpl_info.protocol_options,
											   option);
    
    // Device Id
    char *device_id =rand_guid();
    option = purple_account_option_string_new(_("Device-ID"),
                                              "deivce_id", device_id);
    g_free(device_id);
    
    option = purple_account_option_bool_new(_("Allow direct connections"),
                                            "direct_connect", TRUE);
	prpl_info.protocol_options = g_list_append(prpl_info.protocol_options,
											   option);
    
	option = purple_account_option_bool_new(_("Allow connecting from multiple locations"),
                                            "mpop", TRUE);
	prpl_info.protocol_options = g_list_append(prpl_info.protocol_options,
											   option);
    
    purple_prefs_remove("/plugins/prpl/np");

}
Пример #10
0
/*------------------------------------------------------------------------
 * Initialising the MXit plugin.
 *
 *  @param plugin	The plugin object
 */
static void init_plugin( PurplePlugin* plugin )
{
	PurpleAccountOption*	option;

	purple_debug_info( MXIT_PLUGIN_ID, "Loading MXit libPurple plugin...\n" );

	/* Configuration options */

	/* WAP server (reference: "libpurple/accountopt.h") */
	option = purple_account_option_string_new( _( "WAP Server" ), MXIT_CONFIG_WAPSERVER, DEFAULT_WAPSITE );
	proto_info.protocol_options = g_list_append( proto_info.protocol_options, option );

	option = purple_account_option_bool_new( _( "Connect via HTTP" ), MXIT_CONFIG_USE_HTTP, FALSE );
	proto_info.protocol_options = g_list_append( proto_info.protocol_options, option );

	option = purple_account_option_bool_new( _( "Enable splash-screen popup" ), MXIT_CONFIG_SPLASHPOPUP, FALSE );
	proto_info.protocol_options = g_list_append( proto_info.protocol_options, option );
}
Пример #11
0
static void
plugin_init(PurplePlugin *plugin)
{
	PurplePluginInfo *info = g_new0(PurplePluginInfo, 1);
	PurplePluginProtocolInfo *prpl_info = g_new0(PurplePluginProtocolInfo, 1);
#endif

#if PURPLE_VERSION_CHECK(3, 0, 0)
static void 
skypeweb_protocol_init(PurpleProtocol *prpl_info) 
{
	PurpleProtocol *info = prpl_info;
#endif
	PurpleAccountOption *option,  *typing_type1, *typing_type2;
	PurpleBuddyIconSpec icon_spec = {"jpeg", 0, 0, 96, 96, 0, PURPLE_ICON_SCALE_DISPLAY};

	//PurpleProtocol
	info->id = SKYPEWEB_PLUGIN_ID;
	info->name = "Skype (HTTP)";
	prpl_info->options = OPT_PROTO_CHAT_TOPIC | OPT_PROTO_INVITE_MESSAGE /*| OPT_PROTO_IM_IMAGE*/;
	option = purple_account_option_bool_new("", "", FALSE);
	typing_type1 = purple_account_option_bool_new(N_("Show 'Typing' status as system message in chat window."), "show-typing-as-text", FALSE);
	typing_type2 = purple_account_option_bool_new(N_("Show 'Typing' status with 'Voice' icon near buddy name."), "show-typing-as-icon", FALSE);

#if !PURPLE_VERSION_CHECK(3, 0, 0)
	prpl_info->protocol_options = g_list_append(prpl_info->protocol_options, option);
	prpl_info->protocol_options = g_list_append(prpl_info->protocol_options, typing_type1);
	prpl_info->protocol_options = g_list_append(prpl_info->protocol_options, typing_type2);
	prpl_info->icon_spec = icon_spec;
#else
	prpl_info->account_options = g_list_append(prpl_info->account_options, option);
	prpl_info->account_options = g_list_append(prpl_info->account_options, typing_type1);
	prpl_info->account_options = g_list_append(prpl_info->account_options, typing_type2);
	prpl_info->icon_spec = &icon_spec;
#endif
	
#if PURPLE_VERSION_CHECK(3, 0, 0)
}
Пример #12
0
static void
plugin_init(PurplePlugin *plugin)
{
	PurpleAccountOption *option;
	PurplePluginInfo *info = plugin->info;
	PurplePluginProtocolInfo *prpl_info = info->extra_info;
	//purple_signal_connect(purple_get_core(), "uri-handler", plugin, PURPLE_CALLBACK(mightytext_uri_handler), NULL);
	
	// option = purple_account_option_bool_new("Show calls", "show_calls", TRUE);
	// prpl_info->protocol_options = g_list_append(prpl_info->protocol_options, option);
	
	option = purple_account_option_bool_new("Only show 'mobile' contacts", "mobile_contacts_only", FALSE);
	prpl_info->protocol_options = g_list_append(prpl_info->protocol_options, option);
}
Пример #13
0
static void plainprpl_init(PurplePlugin *plugin)
{
	PurpleAccountOption *option;
	PurpleKeyValuePair *kvp;
	GList *list;

	kvp = g_new0(PurpleKeyValuePair, 1);
	kvp->key = g_strdup(_("IPv4"));
	kvp->value = g_strdup("ipv4");
	list = g_list_append(NULL, kvp);

	kvp = g_new0(PurpleKeyValuePair, 1);
	kvp->key = g_strdup(_("IPv6"));
	kvp->value = g_strdup("ipv6");
	list = g_list_append(list, kvp);

	option = purple_account_option_list_new(_("Protocol"), "listen_af", list);
	prpl_info.protocol_options = g_list_append(prpl_info.protocol_options, option);

	option = purple_account_option_string_new(_("Port"), "listen_port", PLAIN_DEFAULT_PORT_STR);
	prpl_info.protocol_options = g_list_append(prpl_info.protocol_options, option);

	option = purple_account_option_bool_new(_("Allow messages from unknown contacts."), "allow_unknown", FALSE);
	prpl_info.protocol_options = g_list_append(prpl_info.protocol_options, option);

	option = purple_account_option_string_new(_("On Login"), "on_login","");
	prpl_info.protocol_options = g_list_append(prpl_info.protocol_options, option);

	option = purple_account_option_string_new(_("On Logout"), "on_logout","");
	prpl_info.protocol_options = g_list_append(prpl_info.protocol_options, option);

	/* To lookup an IP address */
	option = purple_account_option_string_new(_("On Resolve"), "on_lookup", "");
	prpl_info.protocol_options = g_list_append(prpl_info.protocol_options, option);

#if 0
	/* When verification fails */
	option = purple_account_option_string_new(_("On Invalid"), "on_invalid", "");
	prpl_info.protocol_options = g_list_append(prpl_info.protocol_options, option);
#endif

#if PURPLE_MAJOR_VERSION == 2
	/*
	* Workaround to tell the OTR plugin our maximum message size.
	* There is not other way for current libpurple 2.x.
	*/
	otr_set_max_message_size( PLAINPRPL_ID, MAX_MESSAGE_SIZE );
#endif
}
Пример #14
0
static void plugin_init(PurplePlugin *plugin)
{
	PurpleAccountOption *option;
	PurplePluginInfo *info = plugin->info;
	PurplePluginProtocolInfo *prpl_info = info->extra_info;

	/* Add options to the advanced screen in the account settings */
	option = purple_account_option_bool_new(
		_("Show history in new conversations"),
		"facebook_show_history", TRUE);
	prpl_info->protocol_options = g_list_append(
		prpl_info->protocol_options, option);

	option = purple_account_option_bool_new(
		_("Use Facebook friend-lists as Pidgin groups"),
		"facebook_use_groups", TRUE);
	prpl_info->protocol_options = g_list_append(
		prpl_info->protocol_options, option);
	option = purple_account_option_bool_new(
		_("Hide myself in the Buddy List"),
		"facebook_hide_self", TRUE);
	prpl_info->protocol_options = g_list_append(
		prpl_info->protocol_options, option);

	option = purple_account_option_bool_new(
		_("Set Facebook status through Pidgin status"),
		"facebook_set_status_through_pidgin", FALSE);
	prpl_info->protocol_options = g_list_append(
		prpl_info->protocol_options, option);

	option = purple_account_option_bool_new(
		_("Show Facebook notifications as e-mails in Pidgin"),
		"facebook_get_notifications", TRUE);
	prpl_info->protocol_options = g_list_append(
		prpl_info->protocol_options, option);
	
	option = purple_account_option_string_new(
		_("Notifications RSS Feed URL"),
		"notifications_feed_url", "");
	prpl_info->protocol_options = g_list_append(
		prpl_info->protocol_options, option);

	option = purple_account_option_bool_new(
		_("Edit Facebook friends from Pidgin"),
		"facebook_manage_friends", FALSE);
	prpl_info->protocol_options = g_list_append(
		prpl_info->protocol_options, option);
}
Пример #15
0
static void plugin_init(PurplePlugin *plugin) {
    PurpleAccountUserSplit *split;
    PurpleAccountOption *option;
    
    split = purple_account_user_split_new("Character", "", ':');
    prpl_info.user_splits = g_list_append(prpl_info.user_splits, split);

/*    option = purple_account_option_bool_new("Sync Status", "sync_status", TRUE);
    prpl_info.protocol_options = g_list_append(prpl_info.protocol_options, option);

    option = purple_account_option_bool_new("Sync Status Message", "sync_status_message", TRUE);
    prpl_info.protocol_options = g_list_append(prpl_info.protocol_options, option);*/
    
    option = purple_account_option_string_new("Server Address", "server_address", "chat.f-list.net");
    prpl_info.protocol_options = g_list_append(prpl_info.protocol_options, option);

    option = purple_account_option_int_new("Server Port", "server_port", FLIST_PORT);
    prpl_info.protocol_options = g_list_append(prpl_info.protocol_options, option);
    
    option = purple_account_option_bool_new("Download Friends List", "sync_friends", TRUE);
    prpl_info.protocol_options = g_list_append(prpl_info.protocol_options, option);

    option = purple_account_option_bool_new("Download Bookmarks", "sync_bookmarks", FALSE);
    prpl_info.protocol_options = g_list_append(prpl_info.protocol_options, option);
    
    option = purple_account_option_bool_new("Debug Mode", "debug_mode", FALSE);
    prpl_info.protocol_options = g_list_append(prpl_info.protocol_options, option);

    gender_list = NULL;
    gender_list = g_slist_prepend(gender_list, "Male");
    gender_list = g_slist_prepend(gender_list, "Female");
    gender_list = g_slist_prepend(gender_list, "Transgender");
    gender_list = g_slist_prepend(gender_list, "Herm");
    gender_list = g_slist_prepend(gender_list, "Shemale");
    gender_list = g_slist_prepend(gender_list, "Male-Herm");
    gender_list = g_slist_prepend(gender_list, "C**t-boy");
    gender_list = g_slist_prepend(gender_list, "None");
    gender_list = g_slist_reverse(gender_list);
    
    str_to_channel_mode = g_hash_table_new(g_str_hash, g_str_equal);
    g_hash_table_insert(str_to_channel_mode, "both", GINT_TO_POINTER(CHANNEL_MODE_BOTH));
    g_hash_table_insert(str_to_channel_mode, "ads", GINT_TO_POINTER(CHANNEL_MODE_ADS_ONLY));
    g_hash_table_insert(str_to_channel_mode, "chat", GINT_TO_POINTER(CHANNEL_MODE_CHAT_ONLY));
    
    str_to_gender = g_hash_table_new(g_str_hash, g_str_equal);
    g_hash_table_insert(str_to_gender, "Male", GINT_TO_POINTER(FLIST_GENDER_MALE));
    g_hash_table_insert(str_to_gender, "Female", GINT_TO_POINTER(FLIST_GENDER_FEMALE));
    g_hash_table_insert(str_to_gender, "Transgender", GINT_TO_POINTER(FLIST_GENDER_TRANSGENDER));
    g_hash_table_insert(str_to_gender, "Herm", GINT_TO_POINTER(FLIST_GENDER_HERM));
    g_hash_table_insert(str_to_gender, "Shemale", GINT_TO_POINTER(FLIST_GENDER_SHEMALE));
    g_hash_table_insert(str_to_gender, "Male-Herm", GINT_TO_POINTER(FLIST_GENDER_MALEHERM));
    g_hash_table_insert(str_to_gender, "C**t-boy", GINT_TO_POINTER(FLIST_GENDER_CUNTBOY));
    g_hash_table_insert(str_to_gender, "None", GINT_TO_POINTER(FLIST_GENDER_NONE));

    gender_to_proper_str = g_hash_table_new(g_direct_hash, NULL);
    g_hash_table_insert(gender_to_proper_str, GINT_TO_POINTER(FLIST_GENDER_MALE), "Male");
    g_hash_table_insert(gender_to_proper_str, GINT_TO_POINTER(FLIST_GENDER_FEMALE), "Female");
    g_hash_table_insert(gender_to_proper_str, GINT_TO_POINTER(FLIST_GENDER_TRANSGENDER), "Transgender");
    g_hash_table_insert(gender_to_proper_str, GINT_TO_POINTER(FLIST_GENDER_HERM), "Herm");
    g_hash_table_insert(gender_to_proper_str, GINT_TO_POINTER(FLIST_GENDER_SHEMALE), "Shemale");
    g_hash_table_insert(gender_to_proper_str, GINT_TO_POINTER(FLIST_GENDER_MALEHERM), "Male-Herm");
    g_hash_table_insert(gender_to_proper_str, GINT_TO_POINTER(FLIST_GENDER_CUNTBOY), "C**t-boy");
    g_hash_table_insert(gender_to_proper_str, GINT_TO_POINTER(FLIST_GENDER_NONE), "None");
    
    status_list = NULL;
    status_list = g_slist_prepend(status_list, "online");
    status_list = g_slist_prepend(status_list, "looking");
    status_list = g_slist_prepend(status_list, "away");
    status_list = g_slist_prepend(status_list, "busy");
    status_list = g_slist_prepend(status_list, "dnd");
    status_list = g_slist_reverse(status_list);

    str_to_status = g_hash_table_new(g_str_hash, g_str_equal);
    g_hash_table_insert(str_to_status, "online", GINT_TO_POINTER(FLIST_STATUS_AVAILABLE));
    g_hash_table_insert(str_to_status, "looking", GINT_TO_POINTER(FLIST_STATUS_LOOKING));
    g_hash_table_insert(str_to_status, "busy", GINT_TO_POINTER(FLIST_STATUS_BUSY));
    g_hash_table_insert(str_to_status, "dnd", GINT_TO_POINTER(FLIST_STATUS_DND));
    g_hash_table_insert(str_to_status, "crown", GINT_TO_POINTER(FLIST_STATUS_CROWN));
    g_hash_table_insert(str_to_status, "idle", GINT_TO_POINTER(FLIST_STATUS_IDLE));
    g_hash_table_insert(str_to_status, "away", GINT_TO_POINTER(FLIST_STATUS_AWAY));
    g_hash_table_insert(str_to_status, "unknown", GINT_TO_POINTER(FLIST_STATUS_UNKNOWN));

    status_to_str = g_hash_table_new(g_direct_hash, NULL);
    g_hash_table_insert(status_to_str, GINT_TO_POINTER(FLIST_STATUS_AVAILABLE), "online");
    g_hash_table_insert(status_to_str, GINT_TO_POINTER(FLIST_STATUS_LOOKING), "looking");
    g_hash_table_insert(status_to_str, GINT_TO_POINTER(FLIST_STATUS_BUSY), "busy");
    g_hash_table_insert(status_to_str, GINT_TO_POINTER(FLIST_STATUS_DND), "dnd");
    g_hash_table_insert(status_to_str, GINT_TO_POINTER(FLIST_STATUS_CROWN), "crown");
    g_hash_table_insert(status_to_str, GINT_TO_POINTER(FLIST_STATUS_AWAY), "away");
    g_hash_table_insert(status_to_str, GINT_TO_POINTER(FLIST_STATUS_IDLE), "idle");
    g_hash_table_insert(status_to_str, GINT_TO_POINTER(FLIST_STATUS_OFFLINE), "offline");
    g_hash_table_insert(status_to_str, GINT_TO_POINTER(FLIST_STATUS_UNKNOWN), "unknown");

    status_to_proper_str = g_hash_table_new(g_direct_hash, NULL);
    g_hash_table_insert(status_to_proper_str, GINT_TO_POINTER(FLIST_STATUS_AVAILABLE), "Available");
    g_hash_table_insert(status_to_proper_str, GINT_TO_POINTER(FLIST_STATUS_LOOKING), "Looking");
    g_hash_table_insert(status_to_proper_str, GINT_TO_POINTER(FLIST_STATUS_BUSY), "Busy");
    g_hash_table_insert(status_to_proper_str, GINT_TO_POINTER(FLIST_STATUS_DND), "Do Not Disturb");
    g_hash_table_insert(status_to_proper_str, GINT_TO_POINTER(FLIST_STATUS_CROWN), "Crown");
    g_hash_table_insert(status_to_proper_str, GINT_TO_POINTER(FLIST_STATUS_AWAY), "Away");
    g_hash_table_insert(status_to_proper_str, GINT_TO_POINTER(FLIST_STATUS_IDLE), "Idle");
    g_hash_table_insert(status_to_proper_str, GINT_TO_POINTER(FLIST_STATUS_OFFLINE), "Offline");
    g_hash_table_insert(status_to_proper_str, GINT_TO_POINTER(FLIST_STATUS_UNKNOWN), "Unknown");

    friend_status_to_proper_str = g_hash_table_new(g_direct_hash, NULL);
    g_hash_table_insert(friend_status_to_proper_str, GINT_TO_POINTER(FLIST_NOT_FRIEND), "No");
    g_hash_table_insert(friend_status_to_proper_str, GINT_TO_POINTER(FLIST_MUTUAL_FRIEND), "Mutual");
    g_hash_table_insert(friend_status_to_proper_str, GINT_TO_POINTER(FLIST_PENDING_IN_FRIEND), "Pending (You)");
    g_hash_table_insert(friend_status_to_proper_str, GINT_TO_POINTER(FLIST_PENDING_OUT_FRIEND), "Pending (Buddy)");

    string_to_account = g_hash_table_new((GHashFunc) flist_str_hash, (GEqualFunc) flist_str_equal);
    account_to_string = g_hash_table_new((GHashFunc) flist_str_hash, (GEqualFunc) flist_str_equal);

    flist_callback_init();
    flist_init_commands();
    flist_bbcode_init();
    flist_web_requests_init();
    flist_ticket_init();
}
Пример #16
0
static void
init_plugin(PurplePlugin *plugin)
{
	PurpleAccountUserSplit *split;
	PurpleAccountOption *option;
	GList *encryption_values = NULL;

	/* 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"), "", '/');
	purple_account_user_split_set_reverse(split, FALSE);
	prpl_info.user_splits = g_list_append(prpl_info.user_splits, split);

#define ADD_VALUE(list, desc, v) { \
	PurpleKeyValuePair *kvp = g_new0(PurpleKeyValuePair, 1); \
	kvp->key = g_strdup((desc)); \
	kvp->value = g_strdup((v)); \
	list = g_list_prepend(list, kvp); \
}

	ADD_VALUE(encryption_values, _("Require encryption"), "require_tls");
	ADD_VALUE(encryption_values, _("Use encryption if available"), "opportunistic_tls");
	ADD_VALUE(encryption_values, _("Use old-style SSL"), "old_ssl");
#if 0
	ADD_VALUE(encryption_values, "None", "none");
#endif
	encryption_values = g_list_reverse(encryption_values);

#undef ADD_VALUE

	option = purple_account_option_list_new(_("Connection security"), "connection_security", encryption_values);
	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 */
						  JABBER_DEFAULT_FT_PROXIES);
	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;

	purple_prefs_remove("/plugins/prpl/jabber");

	purple_signal_connect(purple_get_core(), "uri-handler", plugin,
		PURPLE_CALLBACK(xmpp_uri_handler), NULL);
}
Пример #17
0
static GList   *get_protocol_options(const char *protocol_id)
{
    GList          *options = NULL;
    PurpleAccountOption *option;

    option = purple_account_option_bool_new(_("Enable HTTPS"),  /* text shown to user */
                                            TWITTER_PREF_USE_HTTPS, /* pref name */
                                            TWITTER_PREF_USE_HTTPS_DEFAULT);    /* default value */
    options = g_list_append(NULL, option);

    if (!strcmp(protocol_id, STATUSNET_PROTOCOL_ID)) {
        option = purple_account_option_bool_new(_("Enable OAuth (more secure, higher rate limit)"), TWITTER_PREF_USE_OAUTH, FALSE);
        options = g_list_append(options, option);
        option = purple_account_option_string_new(_("Custom Consumer Key"), TWITTER_PREF_CONSUMER_KEY, "");
        options = g_list_append(options, option);
        option = purple_account_option_string_new(_("Custom Consumer Secret"), TWITTER_PREF_CONSUMER_SECRET, "");
        options = g_list_append(options, option);
    }

    /* Default sending im to buddy is to dm */
    option = purple_account_option_bool_new(_("Default IM to buddy is a DM"), TWITTER_PREF_DEFAULT_DM, TWITTER_PREF_DEFAULT_DM_DEFAULT);
    options = g_list_append(options, option);

    /* Retrieve tweets history after login */
    option = purple_account_option_bool_new(_("Retrieve tweets history after login"), TWITTER_PREF_RETRIEVE_HISTORY, TWITTER_PREF_RETRIEVE_HISTORY_DEFAULT);
    options = g_list_append(options, option);

    /* Sync presence update to twitter */
    option = purple_account_option_bool_new(_("Sync availability status message to Twitter"), TWITTER_PREF_SYNC_STATUS, TWITTER_PREF_SYNC_STATUS_DEFAULT);
    options = g_list_append(options, option);

    /* Automatically generate a buddylist based on followers */
    option = purple_account_option_bool_new(_("Add following as friends (NOT recommended for large follower list)"), TWITTER_PREF_GET_FRIENDS, TWITTER_PREF_GET_FRIENDS_DEFAULT);
    options = g_list_append(options, option);

    /* If adding following as friends, what should be the default alias? */
    {
        static const gchar *alias_keys[] = {
            N_("<nickname> | <full name>"),
            N_("<nickname> only"),
            N_("<full name> only"),
            NULL
        };
        static const gchar *alias_values[] = {
            TWITTER_PREF_ALIAS_FORMAT_ALL,
            TWITTER_PREF_ALIAS_FORMAT_NICK,
            TWITTER_PREF_ALIAS_FORMAT_FULLNAME,
            NULL
        };
        GList          *alias_options = NULL;
        int             i;

        for (i = 0; alias_keys[i]; i++) {
            PurpleKeyValuePair *kvp = g_new0(PurpleKeyValuePair, 1);
            kvp->key = g_strdup(_(alias_keys[i]));
            kvp->value = g_strdup(alias_values[i]);
            alias_options = g_list_append(alias_options, kvp);
        }

        option = purple_account_option_list_new(_("Set default alias to:"), TWITTER_PREF_ALIAS_FORMAT, alias_options);
        options = g_list_append(options, option);
    }

    /* Add URL link to each tweet */
    option = purple_account_option_bool_new(_("Add URL link to each tweet"), TWITTER_PREF_ADD_URL_TO_TWEET, TWITTER_PREF_ADD_URL_TO_TWEET_DEFAULT);
    options = g_list_append(options, option);

    /* Idle cutoff time */
    option = purple_account_option_int_new(_("Buddy last tweet hours before set offline (0: Always online)"),   /* text shown to user */
                                           TWITTER_ONLINE_CUTOFF_TIME_HOURS,    /* pref name */
                                           TWITTER_ONLINE_CUTOFF_TIME_HOURS_DEFAULT);   /* default value */
    options = g_list_append(options, option);

    /* Max tweets to retrieve when retrieving timeline data */
    option = purple_account_option_int_new(_("Max historical timeline tweets to retrieve (0: infinite)"),   /* text shown to user */
                                           TWITTER_PREF_HOME_TIMELINE_MAX_TWEETS,   /* pref name */
                                           TWITTER_PREF_HOME_TIMELINE_MAX_TWEETS_DEFAULT);  /* default value */
    options = g_list_append(options, option);

    /* Timeline tweets refresh interval */
    option = purple_account_option_int_new(_("Refresh timeline every (min)"),   /* text shown to user */
                                           TWITTER_PREF_TIMELINE_TIMEOUT,   /* pref name */
                                           TWITTER_PREF_TIMELINE_TIMEOUT_DEFAULT);  /* default value */
    options = g_list_append(options, option);

    /* Mentions/replies tweets refresh interval */
    option = purple_account_option_int_new(_("Refresh replies every (min)"),    /* text shown to user */
                                           TWITTER_PREF_REPLIES_TIMEOUT,    /* pref name */
                                           TWITTER_PREF_REPLIES_TIMEOUT_DEFAULT);   /* default value */
    options = g_list_append(options, option);

    /* Dms refresh interval */
    option = purple_account_option_int_new(_("Refresh direct messages every (min)"),    /* text shown to user */
                                           TWITTER_PREF_DMS_TIMEOUT,    /* pref name */
                                           TWITTER_PREF_DMS_TIMEOUT_DEFAULT);   /* default value */
    options = g_list_append(options, option);

    if (!strcmp(protocol_id, TWITTER_PROTOCOL_ID)) {
        /* Lists tweets refresh interval */
        option = purple_account_option_int_new(_("Refresh lists every (min)"),  /* text shown to user */
                                               TWITTER_PREF_LIST_TIMEOUT,   /* pref name */
                                               TWITTER_PREF_LIST_TIMEOUT_DEFAULT);  /* default value */
        options = g_list_append(options, option);
    }

    /* Friendlist refresh interval */
    option = purple_account_option_int_new(_("Refresh friendlist every (min)"), /* text shown to user */
                                           TWITTER_PREF_USER_STATUS_TIMEOUT,    /* pref name */
                                           TWITTER_PREF_USER_STATUS_TIMEOUT_DEFAULT);   /* default value */
    options = g_list_append(options, option);

    /* Search results refresh interval */
    option = purple_account_option_int_new(_("Default refresh search results every (min)"), /* text shown to user */
                                           TWITTER_PREF_SEARCH_TIMEOUT, /* pref name */
                                           TWITTER_PREF_SEARCH_TIMEOUT_DEFAULT);    /* default value */
    options = g_list_append(options, option);

    if (!strcmp(protocol_id, STATUSNET_PROTOCOL_ID)) {
        option = purple_account_option_string_new(_("API Base URL"),    /* text shown to user */
                                                  TWITTER_PREF_API_BASE,    /* pref name */
                                                  STATUSNET_PREF_API_BASE_DEFAULT); /* default value */
        options = g_list_append(options, option);
    }

    return options;
}
Пример #18
0
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);
}
Пример #19
0
static void init_plugin(PurplePlugin *plugin)
{
	PurpleAccountOption *option;
	PurpleKeyValuePair *kvp;
	GList *server_list = NULL;
	GList *server_kv_list = NULL;
	GList *it;
	/* #ifdef DEBUG */
	GList *version_kv_list = NULL;
	/* #endif */

	server_list = server_list_build('A');

	purple_prefs_remove("/plugins/prpl/qq/serverlist");

	server_kv_list = NULL;
	kvp = g_new0(PurpleKeyValuePair, 1);
	kvp->key = g_strdup(_("Auto"));
	kvp->value = g_strdup("auto");
	server_kv_list = g_list_append(server_kv_list, kvp);

	it = server_list;
	while(it) {
		if (it->data != NULL && strlen(it->data) > 0) {
			kvp = g_new0(PurpleKeyValuePair, 1);
			kvp->key = g_strdup(it->data);
			kvp->value = g_strdup(it->data);
			server_kv_list = g_list_append(server_kv_list, kvp);
		}
		it = it->next;
	}

	g_list_free(server_list);

	option = purple_account_option_list_new(_("Select Server"), "server", server_kv_list);
	prpl_info.protocol_options = g_list_append(prpl_info.protocol_options, option);

	kvp = g_new0(PurpleKeyValuePair, 1);
	kvp->key = g_strdup(_("QQ2010"));
	kvp->value = g_strdup("qq2010");
	version_kv_list = g_list_append(version_kv_list, kvp);

	kvp = g_new0(PurpleKeyValuePair, 1);
	kvp->key = g_strdup(_("QQ2011"));
	kvp->value = g_strdup("qq2011");
	version_kv_list = g_list_append(version_kv_list, kvp);

	kvp = g_new0(PurpleKeyValuePair, 1);
	kvp->key = g_strdup(_("QQ2012"));
	kvp->value = g_strdup("qq2012");
	version_kv_list = g_list_append(version_kv_list, kvp);

	option = purple_account_option_list_new(_("Client Version"), "client_version", version_kv_list);
	prpl_info.protocol_options = g_list_append(prpl_info.protocol_options, option);

	option = purple_account_option_bool_new(_("Connect by TCP"), "use_tcp", TRUE);
	prpl_info.protocol_options = g_list_append(prpl_info.protocol_options, option);

	option = purple_account_option_bool_new(_("Show server notice"), "show_notice", TRUE);
	prpl_info.protocol_options = g_list_append(prpl_info.protocol_options, option);

	option = purple_account_option_bool_new(_("Show server news"), "show_news", TRUE);
	prpl_info.protocol_options = g_list_append(prpl_info.protocol_options, option);

	option = purple_account_option_bool_new(_("Show chat room when msg comes"), "show_chat", TRUE);
	prpl_info.protocol_options = g_list_append(prpl_info.protocol_options, option);

	option = purple_account_option_int_new(_("Keep alive interval (seconds)"), "keep_alive_interval", 60);
	prpl_info.protocol_options = g_list_append(prpl_info.protocol_options, option);

	option = purple_account_option_int_new(_("Update interval (seconds)"), "update_interval", 300);
	prpl_info.protocol_options = g_list_append(prpl_info.protocol_options, option);

	purple_prefs_add_none("/plugins/prpl/qq");
	purple_prefs_add_bool("/plugins/prpl/qq/show_status_by_icon", TRUE);
	purple_prefs_add_bool("/plugins/prpl/qq/show_fake_video", FALSE);
	purple_prefs_add_bool("/plugins/prpl/qq/auto_get_authorize_info", TRUE);
	purple_prefs_add_int("/plugins/prpl/qq/resend_interval", 4);
	purple_prefs_add_int("/plugins/prpl/qq/resend_times", 10);
}
Пример #20
0
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);
}