/soc/2013/ankitkv/gobjectification: 5f6dcd83e8c1: Seperate plugi...

Ankit Vani a at nevitus.org
Sun Sep 1 06:39:18 EDT 2013


Changeset: 5f6dcd83e8c17f5479a1d7e7aa48c9b0232ee62f
Author:	 Ankit Vani <a at nevitus.org>
Date:	 2013-09-01 15:57 +0530
Branch:	 soc.2013.gobjectification.plugins
URL: https://hg.pidgin.im/soc/2013/ankitkv/gobjectification/rev/5f6dcd83e8c1

Description:

Seperate plugin and protocol IDs. Protocol ID example: "msn". Plugin ID example: "protocol-msn".

diffstat:

 libpurple/protocols/bonjour/bonjour.c    |   8 ++++----
 libpurple/protocols/bonjour/bonjour.h    |   3 ---
 libpurple/protocols/gg/gg.c              |   8 ++++----
 libpurple/protocols/gg/gg.h              |   3 ---
 libpurple/protocols/irc/irc.c            |   8 ++++----
 libpurple/protocols/irc/irc.h            |   3 ---
 libpurple/protocols/jabber/jabber.c      |   4 ++--
 libpurple/protocols/jabber/jabber.h      |   3 ---
 libpurple/protocols/jabber/libfacebook.c |  10 +++++-----
 libpurple/protocols/jabber/libfacebook.h |   3 ---
 libpurple/protocols/jabber/libgtalk.c    |  10 +++++-----
 libpurple/protocols/jabber/libgtalk.h    |   3 ---
 libpurple/protocols/jabber/libxmpp.c     |   4 ++--
 libpurple/protocols/msn/msn.c            |   8 ++++----
 libpurple/protocols/msn/msn.h            |   4 +---
 libpurple/protocols/mxit/mxit.c          |   4 ++--
 libpurple/protocols/mxit/mxit.h          |   9 +++++++--
 libpurple/protocols/myspace/myspace.c    |   8 ++++----
 libpurple/protocols/myspace/myspace.h    |   3 ---
 libpurple/protocols/novell/novell.c      |   8 ++++----
 libpurple/protocols/novell/novell.h      |   3 ---
 libpurple/protocols/null/nullprotocol.c  |  18 +++++++++---------
 libpurple/protocols/null/nullprotocol.h  |   3 ---
 libpurple/protocols/oscar/libaim.c       |   8 ++++----
 libpurple/protocols/oscar/libicq.c       |  10 +++++-----
 libpurple/protocols/oscar/libicq.h       |   3 ---
 libpurple/protocols/oscar/oscar.h        |   3 ---
 libpurple/protocols/sametime/sametime.c  |  14 +++++++++-----
 libpurple/protocols/silc/silc.c          |  10 +++++-----
 libpurple/protocols/silc/silcpurple.h    |   3 ---
 libpurple/protocols/simple/simple.c      |   8 ++++----
 libpurple/protocols/simple/simple.h      |   3 ---
 libpurple/protocols/yahoo/libyahoo.c     |  10 +++++-----
 libpurple/protocols/yahoo/libyahoo.h     |   3 ---
 libpurple/protocols/yahoo/libyahoojp.c   |  10 +++++-----
 libpurple/protocols/yahoo/libyahoojp.h   |   3 ---
 libpurple/protocols/zephyr/zephyr.c      |   8 ++++----
 libpurple/protocols/zephyr/zephyr.h      |   3 ---
 38 files changed, 98 insertions(+), 139 deletions(-)

diffs (truncated from 820 to 300 lines):

diff --git a/libpurple/protocols/bonjour/bonjour.c b/libpurple/protocols/bonjour/bonjour.c
--- a/libpurple/protocols/bonjour/bonjour.c
+++ b/libpurple/protocols/bonjour/bonjour.c
@@ -635,8 +635,8 @@ bonjour_protocol_base_init(BonjourProtoc
 	PurpleProtocolClass *proto_class = PURPLE_PROTOCOL_CLASS(klass);
 	PurpleAccountOption *option;
 
-	proto_class->id        = BONJOUR_ID;
-	proto_class->name      = BONJOUR_NAME;
+	proto_class->id        = "bonjour";
+	proto_class->name      = "Bonjour";
 	proto_class->options   = OPT_PROTO_NO_PASSWORD;
 	proto_class->icon_spec = purple_buddy_icon_spec_new("png,gif,jpeg",
 	                                                 0, 0, 96, 96, 65535,
@@ -701,8 +701,8 @@ static PurplePluginInfo *
 plugin_query(GError **error)
 {
 	return purple_plugin_info_new(
-		"id",           BONJOUR_ID,
-		"name",         BONJOUR_NAME,
+		"id",           "protocol-bonjour",
+		"name",         "Bonjour Protocol",
 		"version",      DISPLAY_VERSION,
 		"category",     N_("Protocol"),
 		"summary",      N_("Bonjour Protocol Plugin"),
diff --git a/libpurple/protocols/bonjour/bonjour.h b/libpurple/protocols/bonjour/bonjour.h
--- a/libpurple/protocols/bonjour/bonjour.h
+++ b/libpurple/protocols/bonjour/bonjour.h
@@ -36,9 +36,6 @@
 #define BONJOUR_PROTOCOL_NAME "bonjour"
 #define BONJOUR_ICON_NAME "bonjour"
 
-#define BONJOUR_ID     "bonjour"
-#define BONJOUR_NAME   "Bonjour"
-
 #define BONJOUR_STATUS_ID_OFFLINE   "offline"
 #define BONJOUR_STATUS_ID_AVAILABLE "available"
 #define BONJOUR_STATUS_ID_AWAY      "away"
diff --git a/libpurple/protocols/gg/gg.c b/libpurple/protocols/gg/gg.c
--- a/libpurple/protocols/gg/gg.c
+++ b/libpurple/protocols/gg/gg.c
@@ -1408,8 +1408,8 @@ ggp_protocol_base_init(GaduGaduProtocolC
 	PurpleAccountOption *ggp_server_option;
 	GList *encryption_options = NULL;
 
-	proto_class->id        = GGP_ID;
-	proto_class->name      = GGP_NAME;
+	proto_class->id        = "gg";
+	proto_class->name      = "Gadu-Gadu";
 	proto_class->options   = OPT_PROTO_REGISTER_NOSCREENNAME |
 	                         OPT_PROTO_IM_IMAGE;
 	proto_class->icon_spec = purple_buddy_icon_spec_new("png",
@@ -1503,8 +1503,8 @@ static PurplePluginInfo *
 plugin_query(GError **error)
 {
 	return purple_plugin_info_new(
-		"id",           GGP_ID,
-		"name",         GGP_NAME,
+		"id",           "protocol-gg",
+		"name",         "Gadu-Gadu Protocol",
 		"version",      DISPLAY_VERSION,
 		"category",     N_("Protocol"),
 		"summary",      N_("Gadu-Gadu Protocol Plugin"),
diff --git a/libpurple/protocols/gg/gg.h b/libpurple/protocols/gg/gg.h
--- a/libpurple/protocols/gg/gg.h
+++ b/libpurple/protocols/gg/gg.h
@@ -40,9 +40,6 @@
 
 #define GGP_UIN_LEN_MAX 10
 
-#define GGP_ID     "gg"
-#define GGP_NAME   "Gadu-Gadu"
-
 #define GGP_TYPE_PROTOCOL             (ggp_protocol_get_type())
 #define GGP_PROTOCOL(obj)             (G_TYPE_CHECK_INSTANCE_CAST((obj), GGP_TYPE_PROTOCOL, GaduGaduProtocol))
 #define GGP_PROTOCOL_CLASS(klass)     (G_TYPE_CHECK_CLASS_CAST((klass), GGP_TYPE_PROTOCOL, GaduGaduProtocolClass))
diff --git a/libpurple/protocols/irc/irc.c b/libpurple/protocols/irc/irc.c
--- a/libpurple/protocols/irc/irc.c
+++ b/libpurple/protocols/irc/irc.c
@@ -930,8 +930,8 @@ irc_protocol_base_init(IRCProtocolClass 
 	PurpleAccountUserSplit *split;
 	PurpleAccountOption *option;
 
-	proto_class->id        = IRC_ID;
-	proto_class->name      = IRC_NAME;
+	proto_class->id        = "irc";
+	proto_class->name      = "IRC";
 	proto_class->options   = OPT_PROTO_CHAT_TOPIC | OPT_PROTO_PASSWORD_OPTIONAL
 	                         | OPT_PROTO_SLASH_COMMANDS_NATIVE;
 
@@ -1023,8 +1023,8 @@ static PurplePluginInfo *
 plugin_query(GError **error)
 {
 	return purple_plugin_info_new(
-		"id",           IRC_ID,
-		"name",         IRC_NAME,
+		"id",           "protocol-irc",
+		"name",         "IRC Protocol",
 		"version",      DISPLAY_VERSION,
 		"category",     N_("Protocol"),
 		"summary",      N_("IRC Protocol Plugin"),
diff --git a/libpurple/protocols/irc/irc.h b/libpurple/protocols/irc/irc.h
--- a/libpurple/protocols/irc/irc.h
+++ b/libpurple/protocols/irc/irc.h
@@ -34,9 +34,6 @@
 #include "roomlist.h"
 #include "sslconn.h"
 
-#define IRC_ID     "irc"
-#define IRC_NAME   "IRC"
-
 #define IRC_TYPE_PROTOCOL             (irc_protocol_get_type())
 #define IRC_PROTOCOL(obj)             (G_TYPE_CHECK_INSTANCE_CAST((obj), IRC_TYPE_PROTOCOL, IRCProtocol))
 #define IRC_PROTOCOL_CLASS(klass)     (G_TYPE_CHECK_CLASS_CAST((klass), IRC_TYPE_PROTOCOL, IRCProtocolClass))
diff --git a/libpurple/protocols/jabber/jabber.c b/libpurple/protocols/jabber/jabber.c
--- a/libpurple/protocols/jabber/jabber.c
+++ b/libpurple/protocols/jabber/jabber.c
@@ -4065,8 +4065,8 @@ jabber_protocol_base_init(JabberProtocol
 {
 	PurpleProtocolClass *proto_class = PURPLE_PROTOCOL_CLASS(klass);
 
-	proto_class->id        = JABBER_ID;
-	proto_class->name      = JABBER_NAME;
+	proto_class->id        = "jabber";
+	proto_class->name      = "XMPP";
 	proto_class->options   = OPT_PROTO_CHAT_TOPIC | OPT_PROTO_UNIQUE_CHATNAME |
 	                         OPT_PROTO_MAIL_CHECK |
 #ifdef HAVE_CYRUS_SASL
diff --git a/libpurple/protocols/jabber/jabber.h b/libpurple/protocols/jabber/jabber.h
--- a/libpurple/protocols/jabber/jabber.h
+++ b/libpurple/protocols/jabber/jabber.h
@@ -82,9 +82,6 @@ typedef struct _JabberStream JabberStrea
 
 #define CAPS0115_NODE "https://pidgin.im/"
 
-#define JABBER_ID    "jabber"
-#define JABBER_NAME  "XMPP"
-
 #define JABBER_TYPE_PROTOCOL             (jabber_protocol_get_type())
 #define JABBER_PROTOCOL(obj)             (G_TYPE_CHECK_INSTANCE_CAST((obj), JABBER_TYPE_PROTOCOL, JabberProtocol))
 #define JABBER_PROTOCOL_CLASS(klass)     (G_TYPE_CHECK_CLASS_CAST((klass), JABBER_TYPE_PROTOCOL, JabberProtocolClass))
diff --git a/libpurple/protocols/jabber/libfacebook.c b/libpurple/protocols/jabber/libfacebook.c
--- a/libpurple/protocols/jabber/libfacebook.c
+++ b/libpurple/protocols/jabber/libfacebook.c
@@ -112,8 +112,8 @@ facebook_protocol_base_init(FacebookProt
 	PurpleAccountOption *option;
 	GList *encryption_values = NULL;
 
-	proto_class->id        = FACEBOOK_ID;
-	proto_class->name      = FACEBOOK_NAME;
+	proto_class->id        = "facebook-xmpp";
+	proto_class->name      = "Facebook (XMPP)";
 
 	/* Translators: 'domain' is used here in the context of Internet domains, e.g. pidgin.im */
 	split = purple_account_user_split_new(_("Domain"), "chat.facebook.com", '@');
@@ -204,15 +204,15 @@ static PurplePluginInfo *
 plugin_query(GError **error)
 {
 	return purple_plugin_info_new(
-		"id",            FACEBOOK_ID,
-		"name",          FACEBOOK_NAME,
+		"id",            "protocol-facebook-",
+		"name",          "Facebook XMPP Protocol",
 		"version",       DISPLAY_VERSION,
 		"category",      N_("Protocol"),
 		"summary",       N_("Facebook XMPP Protocol Plugin"),
 		"description",   N_("Facebook XMPP Protocol Plugin"),
 		"website",       PURPLE_WEBSITE,
 		"abi-version",   PURPLE_ABI_VERSION,
-		"dependencies",  JABBER_ID,
+		"dependencies",  "protocol-xmpp",
 		"flags",         GPLUGIN_PLUGIN_INFO_FLAGS_INTERNAL |
 		                 GPLUGIN_PLUGIN_INFO_FLAGS_LOAD_ON_QUERY,
 		NULL
diff --git a/libpurple/protocols/jabber/libfacebook.h b/libpurple/protocols/jabber/libfacebook.h
--- a/libpurple/protocols/jabber/libfacebook.h
+++ b/libpurple/protocols/jabber/libfacebook.h
@@ -24,9 +24,6 @@
 
 #include "jabber.h"
 
-#define FACEBOOK_ID     "facebook-xmpp"
-#define FACEBOOK_NAME   "Facebook (XMPP)"
-
 #define FACEBOOK_TYPE_PROTOCOL             (facebook_protocol_get_type())
 #define FACEBOOK_PROTOCOL(obj)             (G_TYPE_CHECK_INSTANCE_CAST((obj), FACEBOOK_TYPE_PROTOCOL, FacebookProtocol))
 #define FACEBOOK_PROTOCOL_CLASS(klass)     (G_TYPE_CHECK_CLASS_CAST((klass), FACEBOOK_TYPE_PROTOCOL, FacebookProtocolClass))
diff --git a/libpurple/protocols/jabber/libgtalk.c b/libpurple/protocols/jabber/libgtalk.c
--- a/libpurple/protocols/jabber/libgtalk.c
+++ b/libpurple/protocols/jabber/libgtalk.c
@@ -112,8 +112,8 @@ gtalk_protocol_base_init(GTalkProtocolCl
 	PurpleAccountOption *option;
 	GList *encryption_values = NULL;
 
-	proto_class->id        = GTALK_ID;
-	proto_class->name      = GTALK_NAME;
+	proto_class->id        = "gtalk";
+	proto_class->name      = "Google Talk (XMPP)";
 
 	/* Translators: 'domain' is used here in the context of Internet domains, e.g. pidgin.im */
 	split = purple_account_user_split_new(_("Domain"), "gmail.com", '@');
@@ -197,15 +197,15 @@ static PurplePluginInfo *
 plugin_query(GError **error)
 {
 	return purple_plugin_info_new(
-		"id",            GTALK_ID,
-		"name",          GTALK_NAME,
+		"id",            "protocol-gtalk",
+		"name",          "Google Talk Protocol",
 		"version",       DISPLAY_VERSION,
 		"category",      N_("Protocol"),
 		"summary",       N_("Google Talk Protocol Plugin"),
 		"description",   N_("Google Talk Protocol Plugin"),
 		"website",       PURPLE_WEBSITE,
 		"abi-version",   PURPLE_ABI_VERSION,
-		"dependencies",  JABBER_ID,
+		"dependencies",  "protocol-xmpp",
 		"flags",         GPLUGIN_PLUGIN_INFO_FLAGS_INTERNAL |
 		                 GPLUGIN_PLUGIN_INFO_FLAGS_LOAD_ON_QUERY,
 		NULL
diff --git a/libpurple/protocols/jabber/libgtalk.h b/libpurple/protocols/jabber/libgtalk.h
--- a/libpurple/protocols/jabber/libgtalk.h
+++ b/libpurple/protocols/jabber/libgtalk.h
@@ -24,9 +24,6 @@
 
 #include "jabber.h"
 
-#define GTALK_ID     "gtalk"
-#define GTALK_NAME   "Google Talk (XMPP)"
-
 #define GTALK_TYPE_PROTOCOL             (gtalk_protocol_get_type())
 #define GTALK_PROTOCOL(obj)             (G_TYPE_CHECK_INSTANCE_CAST((obj), GTALK_TYPE_PROTOCOL, GTalkProtocol))
 #define GTALK_PROTOCOL_CLASS(klass)     (G_TYPE_CHECK_CLASS_CAST((klass), GTALK_TYPE_PROTOCOL, GTalkProtocolClass))
diff --git a/libpurple/protocols/jabber/libxmpp.c b/libpurple/protocols/jabber/libxmpp.c
--- a/libpurple/protocols/jabber/libxmpp.c
+++ b/libpurple/protocols/jabber/libxmpp.c
@@ -181,8 +181,8 @@ static PurplePluginInfo *
 plugin_query(GError **error)
 {
 	return purple_plugin_info_new(
-		"id",           JABBER_ID,
-		"name",         JABBER_NAME,
+		"id",           "protocol-xmpp",
+		"name",         "XMPP Protocol",
 		"version",      DISPLAY_VERSION,
 		"category",     N_("Protocol"),
 		"summary",      N_("XMPP Protocol Plugin"),
diff --git a/libpurple/protocols/msn/msn.c b/libpurple/protocols/msn/msn.c
--- a/libpurple/protocols/msn/msn.c
+++ b/libpurple/protocols/msn/msn.c
@@ -2880,8 +2880,8 @@ msn_protocol_base_init(MSNProtocolClass 
 	PurpleProtocolClass *proto_class = PURPLE_PROTOCOL_CLASS(klass);
 	PurpleAccountOption *option;
 
-	proto_class->id        = MSN_ID;
-	proto_class->name      = MSN_NAME;
+	proto_class->id        = "msn";
+	proto_class->name      = "MSN";
 	proto_class->options   = OPT_PROTO_MAIL_CHECK | OPT_PROTO_INVITE_MESSAGE;
 	proto_class->icon_spec = purple_buddy_icon_spec_new("png,gif",
 	                                                    0, 0, 96, 96, 0,
@@ -2990,8 +2990,8 @@ static PurplePluginInfo *
 plugin_query(GError **error)
 {
 	return purple_plugin_info_new(
-		"id",           MSN_ID,
-		"name",         MSN_NAME,
+		"id",           "protocol-msn",
+		"name",         "MSN Protocol",
 		"version",      DISPLAY_VERSION,
 		"category",     N_("Protocol"),
 		"summary",      N_("Windows Live Messenger Protocol Plugin"),
diff --git a/libpurple/protocols/msn/msn.h b/libpurple/protocols/msn/msn.h
--- a/libpurple/protocols/msn/msn.h
+++ b/libpurple/protocols/msn/msn.h
@@ -118,9 +118,7 @@ typedef enum
 
 #define MSN_BUF_LEN 8192
 
-#define MSN_ID     "msn"
-#define MSN_NAME   "MSN"
-#define MSN_DOMAIN (g_quark_from_static_string(MSN_ID))
+#define MSN_DOMAIN (g_quark_from_static_string("msn"))
 
 /* Windows Live Messenger Server*/
 #define MSN_SERVER "messenger.hotmail.com"
diff --git a/libpurple/protocols/mxit/mxit.c b/libpurple/protocols/mxit/mxit.c
--- a/libpurple/protocols/mxit/mxit.c
+++ b/libpurple/protocols/mxit/mxit.c
@@ -729,8 +729,8 @@ mxit_protocol_base_init( MXitProtocolCla
 	PurpleProtocolClass *proto_class = PURPLE_PROTOCOL_CLASS(klass);
 	PurpleAccountOption *option;
 
-	proto_class->id        = MXIT_PLUGIN_ID;
-	proto_class->name      = MXIT_PLUGIN_NAME;
+	proto_class->id        = MXIT_PROTOCOL_ID;
+	proto_class->name      = MXIT_PROTOCOL_NAME;
 	proto_class->options   = OPT_PROTO_REGISTER_NOSCREENNAME |
 	                         OPT_PROTO_UNIQUE_CHATNAME | OPT_PROTO_IM_IMAGE |
 	                         OPT_PROTO_INVITE_MESSAGE |



More information about the Commits mailing list