/soc/2013/ankitkv/gobjectification: eaa5f2f9c1d5: Refactored sim...
Ankit Vani
a at nevitus.org
Sun Aug 11 20:29:30 EDT 2013
Changeset: eaa5f2f9c1d5d12efb415729f487c9747909db9a
Author: Ankit Vani <a at nevitus.org>
Date: 2013-08-12 05:51 +0530
Branch: soc.2013.gobjectification.plugins
URL: https://hg.pidgin.im/soc/2013/ankitkv/gobjectification/rev/eaa5f2f9c1d5
Description:
Refactored simple to use the new plugin API
diffstat:
libpurple/protocols/sametime/sametime.c | 2 +-
libpurple/protocols/simple/simple.c | 67 ++++++++++++++------------------
2 files changed, 31 insertions(+), 38 deletions(-)
diffs (108 lines):
diff --git a/libpurple/protocols/sametime/sametime.c b/libpurple/protocols/sametime/sametime.c
--- a/libpurple/protocols/sametime/sametime.c
+++ b/libpurple/protocols/sametime/sametime.c
@@ -5705,7 +5705,7 @@ plugin_query(GError **error)
"preferences-frame", mw_plugin_get_plugin_pref_frame,
NULL
);
-};
+}
static gboolean plugin_load(PurplePlugin *plugin, GError **error) {
diff --git a/libpurple/protocols/simple/simple.c b/libpurple/protocols/simple/simple.c
--- a/libpurple/protocols/simple/simple.c
+++ b/libpurple/protocols/simple/simple.c
@@ -2048,11 +2048,14 @@ static void simple_close(PurpleConnectio
static PurplePluginProtocolInfo prpl_info =
{
+ "prpl-simple", /* id */
+ "SIMPLE", /* name */
sizeof(PurplePluginProtocolInfo), /* struct_size */
0,
NULL, /* user_splits */
NULL, /* protocol_options */
NO_BUDDY_ICONS, /* icon_spec */
+ NULL, /* get_actions */
simple_list_icon, /* list_icon */
NULL, /* list_emblems */
NULL, /* status_text */
@@ -2121,43 +2124,24 @@ static PurplePluginProtocolInfo prpl_inf
NULL /* get_public_alias */
};
+static PurplePluginInfo *
+plugin_query(GError **error)
+{
+ return purple_plugin_info_new(
+ "id", "prpl-simple",
+ "name", "SIMPLE",
+ "version", DISPLAY_VERSION,
+ "category", N_("Protocol"),
+ "summary", N_("SIP/SIMPLE Protocol Plugin"),
+ "description", N_("The SIP/SIMPLE Protocol Plugin"),
+ "author", "Thomas Butter <butter at uni-mannheim.de>",
+ "website", PURPLE_WEBSITE,
+ "abi-version", PURPLE_ABI_VERSION,
+ NULL
+ );
+}
-static PurplePluginInfo info =
-{
- PURPLE_PLUGIN_MAGIC,
- PURPLE_MAJOR_VERSION,
- PURPLE_MINOR_VERSION,
- PURPLE_PLUGIN_PROTOCOL, /**< type */
- NULL, /**< ui_requirement */
- 0, /**< flags */
- NULL, /**< dependencies */
- PURPLE_PRIORITY_DEFAULT, /**< priority */
-
- "prpl-simple", /**< id */
- "SIMPLE", /**< name */
- DISPLAY_VERSION, /**< version */
- N_("SIP/SIMPLE Protocol Plugin"), /** summary */
- N_("The SIP/SIMPLE Protocol Plugin"), /** description */
- "Thomas Butter <butter at uni-mannheim.de>", /**< author */
- PURPLE_WEBSITE, /**< homepage */
-
- NULL, /**< load */
- NULL, /**< unload */
- NULL, /**< destroy */
-
- NULL, /**< ui_info */
- &prpl_info, /**< extra_info */
- NULL,
- NULL,
-
- /* padding */
- NULL,
- NULL,
- NULL,
- NULL
-};
-
-static void _init_plugin(PurplePlugin *plugin)
+static gboolean plugin_load(PurplePlugin *plugin, GError **error)
{
PurpleAccountUserSplit *split;
PurpleAccountOption *option;
@@ -2181,6 +2165,15 @@ static void _init_plugin(PurplePlugin *p
prpl_info.protocol_options = g_list_append(prpl_info.protocol_options, option);
option = purple_account_option_string_new(_("Auth Domain"), "authdomain", "");
prpl_info.protocol_options = g_list_append(prpl_info.protocol_options, option);
+
+ purple_protocols_add(&prpl_info);
+ return TRUE;
}
-PURPLE_INIT_PLUGIN(simple, _init_plugin, info);
+static gboolean plugin_unload(PurplePlugin *plugin, GError **error)
+{
+ purple_protocols_remove(&prpl_info);
+ return TRUE;
+}
+
+PURPLE_PLUGIN_INIT(simple, plugin_query, plugin_load, plugin_unload);
More information about the Commits
mailing list