soc.2009.telepathy.playground: dc4856c9: Experiment loading 2 plugins from the sa...
sttwister at soc.pidgin.im
sttwister at soc.pidgin.im
Wed Apr 22 16:05:44 EDT 2009
-----------------------------------------------------------------
Revision: dc4856c9408bcd0893c111ed5024388ea989116b
Ancestor: 9f2df692f65cef28256c0dd673877a6509ed5704
Author: sttwister at soc.pidgin.im
Date: 2009-04-22T19:59:20
Branch: im.pidgin.soc.2009.telepathy.playground
URL: http://d.pidgin.im/viewmtn/revision/info/dc4856c9408bcd0893c111ed5024388ea989116b
Modified files:
libpurple/protocols/telepathy/telepathy.c
ChangeLog:
Experiment loading 2 plugins from the same prpl
-------------- next part --------------
============================================================
--- libpurple/protocols/telepathy/telepathy.c d56cd589eee2f61f17a5b22834855ab4a104448b
+++ libpurple/protocols/telepathy/telepathy.c c946281d338ea26ef6276720b66bb0598b648342
@@ -130,6 +130,122 @@ telepathy_destroy(PurplePlugin *plugin)
purple_debug_info("telepathy", "Shutting down\n");
}
+static PurplePluginProtocolInfo telepathy_prpl_info2 =
+{
+ OPT_PROTO_CHAT_TOPIC, /* options */
+ NULL, /* user_splits, initialized in nullprpl_init() */
+ NULL, /* protocol_options, initialized in nullprpl_init() */
+ { /* icon_spec, a PurpleBuddyIconSpec */
+ "png,jpg,gif", /* format */
+ 0, /* min_width */
+ 0, /* min_height */
+ 128, /* max_width */
+ 128, /* max_height */
+ 10000, /* max_filesize */
+ PURPLE_ICON_SCALE_DISPLAY, /* scale_rules */
+ },
+ telepathy_list_icon, /* list_icon */
+ NULL, /* list_emblem */
+ NULL, /* status_text */
+ NULL, /* tooltip_text */
+ telepathy_status_types, /* status_types */
+ NULL, /* blist_node_menu */
+ NULL, /* chat_info */
+ NULL, /* chat_info_defaults */
+ telepathy_login, /* login */
+ telepathy_close, /* close */
+ NULL, /* send_im */
+ NULL, /* set_info */
+ NULL, /* send_typing */
+ NULL, /* get_info */
+ NULL, /* set_status */
+ NULL, /* set_idle */
+ NULL, /* change_passwd */
+ NULL, /* add_buddy */
+ NULL, /* add_buddies */
+ NULL, /* remove_buddy */
+ NULL, /* remove_buddies */
+ NULL, /* add_permit */
+ NULL, /* add_deny */
+ NULL, /* rem_permit */
+ NULL, /* rem_deny */
+ NULL, /* set_permit_deny */
+ NULL, /* join_chat */
+ NULL, /* reject_chat */
+ NULL, /* get_chat_name */
+ NULL, /* chat_invite */
+ NULL, /* chat_leave */
+ NULL, /* chat_whisper */
+ NULL, /* chat_send */
+ NULL, /* keepalive */
+ NULL, /* register_user */
+ NULL, /* get_cb_info */
+ NULL, /* get_cb_away */
+ NULL, /* alias_buddy */
+ NULL, /* group_buddy */
+ NULL, /* rename_group */
+ NULL, /* buddy_free */
+ NULL, /* convo_closed */
+ NULL, /* normalize */
+ NULL, /* set_buddy_icon */
+ NULL, /* remove_group */
+ NULL, /* get_cb_real_name */
+ NULL, /* set_chat_topic */
+ NULL, /* find_blist_chat */
+ NULL, /* roomlist_get_list */
+ NULL, /* roomlist_cancel */
+ NULL, /* roomlist_expand_category */
+ NULL, /* can_receive_file */
+ NULL, /* send_file */
+ NULL, /* new_xfer */
+ NULL, /* offline_message */
+ NULL, /* whiteboard_prpl_ops */
+ NULL, /* send_raw */
+ NULL, /* roomlist_room_serialize */
+ NULL, /* unregister_user */
+ NULL, /* send_attention */
+ NULL, /* attention_types */
+ sizeof(PurplePluginProtocolInfo), /* struct_size */
+ NULL, /* get_account_text_table */
+ NULL, /* initiate_media */
+ NULL, /* get_media_caps */
+};
+
+static PurplePluginInfo telepathy_info2 =
+{
+ PURPLE_PLUGIN_MAGIC,
+ PURPLE_MAJOR_VERSION,
+ PURPLE_MINOR_VERSION,
+ PURPLE_PLUGIN_PROTOCOL,
+ NULL,
+ 0,
+ NULL,
+ PURPLE_PRIORITY_DEFAULT,
+
+ "prpl-sttwister-telepathy2",
+ "Telepathy2",
+ TELEPATHY_DISPLAY_VERSION,
+
+ N_("Telepathy Protocol Plugin Number 2"),
+ N_("Telepathy Protocol Plugin Number 2"),
+ "Felix Kerekes <sttwister [at] yahoo [dot] com>",
+ "http://google.com",
+
+ telepathy_plugin_load,
+ NULL,
+ telepathy_destroy,
+
+ NULL,
+ &telepathy_prpl_info2,
+ NULL,
+
+ telepathy_actions,
+
+ NULL,
+ NULL,
+ NULL,
+ NULL
+};
static PurplePluginProtocolInfo telepathy_prpl_info =
{
OPT_PROTO_CHAT_TOPIC, /* options */
@@ -258,4 +374,29 @@ telepathy_init(PurplePlugin *plugin)
telepathy_prpl_info.protocol_options = g_list_append(telepathy_prpl_info.protocol_options, option);
}
+/*
PURPLE_INIT_PLUGIN(telepathy, telepathy_init, telepathy_info)
+*/
+
+/* TODO: Fix the purple_plugin_unload crash. */
+G_MODULE_EXPORT gboolean purple_init_plugin(PurplePlugin *plugin);
+G_MODULE_EXPORT gboolean purple_init_plugin(PurplePlugin *plugin)
+{
+ PurplePlugin *plugin2;
+
+ /* first plugin */
+ purple_debug_info("telepathy", "Registering first plugin\n");
+ plugin->info = &(telepathy_info);
+ telepathy_init((plugin));
+ if (!purple_plugin_register(plugin))
+ return FALSE;
+
+ /* second plugin */
+ purple_debug_info("telepathy", "Registering second plugin\n");
+ plugin2 = purple_plugin_new(TRUE, NULL);
+ plugin2->info = &(telepathy_info2);
+ telepathy_init((plugin2));
+ purple_plugin_load((plugin2));
+ return purple_plugin_register(plugin2);
+}
+
More information about the Commits
mailing list