/soc/2013/ankitkv/gobjectification: 637155f87448: Refactored the...

Ankit Vani a at nevitus.org
Thu Aug 29 15:29:06 EDT 2013


Changeset: 637155f87448f0bb4fb52a1552e81c1d9b1db606
Author:	 Ankit Vani <a at nevitus.org>
Date:	 2013-08-30 00:58 +0530
Branch:	 soc.2013.gobjectification.plugins
URL: https://hg.pidgin.im/soc/2013/ankitkv/gobjectification/rev/637155f87448

Description:

Refactored the protocols to use purple_buddy_icon_spec_new()

diffstat:

 libpurple/protocol.h                    |  1 +
 libpurple/protocols/bonjour/bonjour.c   |  6 +++---
 libpurple/protocols/gg/gg.c             |  7 ++++---
 libpurple/protocols/jabber/jabber.c     |  7 ++++---
 libpurple/protocols/msn/msn.c           |  5 +++--
 libpurple/protocols/mxit/mxit.c         |  5 ++---
 libpurple/protocols/null/nullprotocol.c |  5 ++---
 libpurple/protocols/oscar/oscar.c       |  8 ++++----
 libpurple/protocols/silc/silc.c         |  6 +++---
 libpurple/protocols/yahoo/libyahoo.c    |  6 +++---
 10 files changed, 29 insertions(+), 27 deletions(-)

diffs (168 lines):

diff --git a/libpurple/protocol.h b/libpurple/protocol.h
--- a/libpurple/protocol.h
+++ b/libpurple/protocol.h
@@ -50,6 +50,7 @@ typedef struct _PurpleProtocolInterface 
 #include "conversations.h"
 #include "ft.h"
 #include "imgstore.h"
+#include "media.h"
 #include "roomlist.h"
 #include "status.h"
 #include "whiteboard.h"
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
@@ -640,9 +640,9 @@ bonjour_protocol_base_init(BonjourProtoc
 	proto_class->id        = BONJOUR_ID;
 	proto_class->name      = BONJOUR_NAME;
 	proto_class->options   = OPT_PROTO_NO_PASSWORD;
-	proto_class->icon_spec = (PurpleBuddyIconSpec) {"png,gif,jpeg",
-	                                                0, 0, 96, 96, 65535,
-	                                                PURPLE_ICON_SCALE_DISPLAY};
+	proto_class->icon_spec = purple_buddy_icon_spec_new("png,gif,jpeg",
+	                                                 0, 0, 96, 96, 65535,
+	                                                 PURPLE_ICON_SCALE_DISPLAY);
 
 	initialize_default_account_values();
 
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
@@ -1412,9 +1412,10 @@ ggp_protocol_base_init(GaduGaduProtocolC
 	proto_class->name      = GGP_NAME;
 	proto_class->options   = OPT_PROTO_REGISTER_NOSCREENNAME |
 	                         OPT_PROTO_IM_IMAGE;
-	proto_class->icon_spec = (PurpleBuddyIconSpec) {"png", 1, 1, 200, 200, 0,
-	                                                PURPLE_ICON_SCALE_DISPLAY |
-	                                                PURPLE_ICON_SCALE_SEND};
+	proto_class->icon_spec = purple_buddy_icon_spec_new("png",
+	                                                 1, 1, 200, 200, 0,
+	                                                 PURPLE_ICON_SCALE_DISPLAY |
+	                                                 PURPLE_ICON_SCALE_SEND);
 
 	purple_prefs_add_none("/plugins/prpl/gg");
 
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
@@ -4072,9 +4072,10 @@ jabber_protocol_base_init(JabberProtocol
 #endif
 	                         OPT_PROTO_SLASH_COMMANDS_NATIVE;
 
-	proto_class->icon_spec = (PurpleBuddyIconSpec) {"png", 32, 32, 96, 96, 0,
-	                                                PURPLE_ICON_SCALE_SEND |
-	                                                PURPLE_ICON_SCALE_DISPLAY};
+	proto_class->icon_spec = purple_buddy_icon_spec_new("png",
+	                                                 32, 32, 96, 96, 0,
+	                                                 PURPLE_ICON_SCALE_SEND |
+	                                                 PURPLE_ICON_SCALE_DISPLAY);
 }
 
 static void
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
@@ -2883,8 +2883,9 @@ msn_protocol_base_init(MSNProtocolClass 
 	proto_class->id        = MSN_ID;
 	proto_class->name      = MSN_NAME;
 	proto_class->options   = OPT_PROTO_MAIL_CHECK | OPT_PROTO_INVITE_MESSAGE;
-	proto_class->icon_spec = (PurpleBuddyIconSpec) {"png,gif", 0, 0, 96, 96, 0,
-	                                                PURPLE_ICON_SCALE_SEND};
+	proto_class->icon_spec = purple_buddy_icon_spec_new("png,gif",
+	                                                    0, 0, 96, 96, 0,
+	                                                    PURPLE_ICON_SCALE_SEND);
 
 	option = purple_account_option_string_new(_("Server"), "server",
 											MSN_SERVER);
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
@@ -735,14 +735,13 @@ mxit_protocol_base_init( MXitProtocolCla
 	                         OPT_PROTO_UNIQUE_CHATNAME | OPT_PROTO_IM_IMAGE |
 	                         OPT_PROTO_INVITE_MESSAGE |
 	                         OPT_PROTO_AUTHORIZATION_DENIED_MESSAGE;
-	proto_class->icon_spec = (PurpleBuddyIconSpec)
-	{
+	proto_class->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 */
 
diff --git a/libpurple/protocols/null/nullprotocol.c b/libpurple/protocols/null/nullprotocol.c
--- a/libpurple/protocols/null/nullprotocol.c
+++ b/libpurple/protocols/null/nullprotocol.c
@@ -1061,8 +1061,7 @@ null_protocol_base_init(NullProtocolClas
   proto_class->id        = NULL_ID;
   proto_class->name      = NULL_NAME;
   proto_class->options   = OPT_PROTO_NO_PASSWORD | OPT_PROTO_CHAT_TOPIC;
-  proto_class->icon_spec = (PurpleBuddyIconSpec)
-  {
+  proto_class->icon_spec = purple_buddy_icon_spec_new(
       "png,jpg,gif",                   /* format */
       0,                               /* min_width */
       0,                               /* min_height */
@@ -1070,7 +1069,7 @@ null_protocol_base_init(NullProtocolClas
       128,                             /* max_height */
       10000,                           /* max_filesize */
       PURPLE_ICON_SCALE_DISPLAY,       /* scale_rules */
-  };
+  );
 
   /* see accountopt.h for information about user splits and protocol options */
   split = purple_account_user_split_new(
diff --git a/libpurple/protocols/oscar/oscar.c b/libpurple/protocols/oscar/oscar.c
--- a/libpurple/protocols/oscar/oscar.c
+++ b/libpurple/protocols/oscar/oscar.c
@@ -5559,10 +5559,10 @@ oscar_protocol_base_init(OscarProtocolCl
 	                         OPT_PROTO_INVITE_MESSAGE |
 	                         OPT_PROTO_AUTHORIZATION_DENIED_MESSAGE;
 
-	proto_class->icon_spec = (PurpleBuddyIconSpec) {"gif,jpeg,bmp,ico",
-	                                                0, 0, 64, 64, 7168,
-	                                                PURPLE_ICON_SCALE_SEND |
-	                                                PURPLE_ICON_SCALE_DISPLAY};
+	proto_class->icon_spec = purple_buddy_icon_spec_new("gif,jpeg,bmp,ico",
+	                                                 0, 0, 64, 64, 7168,
+	                                                 PURPLE_ICON_SCALE_SEND |
+	                                                 PURPLE_ICON_SCALE_DISPLAY);
 
 	option = purple_account_option_int_new(_("Port"), "port", OSCAR_DEFAULT_LOGIN_PORT);
 	proto_class->protocol_options = g_list_append(proto_class->protocol_options, option);
diff --git a/libpurple/protocols/silc/silc.c b/libpurple/protocols/silc/silc.c
--- a/libpurple/protocols/silc/silc.c
+++ b/libpurple/protocols/silc/silc.c
@@ -2077,9 +2077,9 @@ silcpurple_protocol_base_init(SILCProtoc
 	proto_class->options   = OPT_PROTO_CHAT_TOPIC | OPT_PROTO_UNIQUE_CHATNAME |
 	                         OPT_PROTO_PASSWORD_OPTIONAL | OPT_PROTO_IM_IMAGE |
 	                         OPT_PROTO_SLASH_COMMANDS_NATIVE;
-	proto_class->icon_spec = (PurpleBuddyIconSpec) {"jpeg,gif,png,bmp",
-	                                                0, 0, 96, 96, 0,
-	                                                PURPLE_ICON_SCALE_DISPLAY};
+	proto_class->icon_spec = purple_buddy_icon_spec_new("jpeg,gif,png,bmp",
+	                                                 0, 0, 96, 96, 0,
+	                                                 PURPLE_ICON_SCALE_DISPLAY);
 
 	proto_class->whiteboard_protocol_ops = &silcpurple_wb_ops;
 
diff --git a/libpurple/protocols/yahoo/libyahoo.c b/libpurple/protocols/yahoo/libyahoo.c
--- a/libpurple/protocols/yahoo/libyahoo.c
+++ b/libpurple/protocols/yahoo/libyahoo.c
@@ -197,9 +197,9 @@ yahoo_protocol_base_init(YahooProtocolCl
 	proto_class->name      = YAHOO_NAME;
 	proto_class->options   = OPT_PROTO_MAIL_CHECK | OPT_PROTO_CHAT_TOPIC |
 	                         OPT_PROTO_AUTHORIZATION_DENIED_MESSAGE;
-	proto_class->icon_spec = (PurpleBuddyIconSpec) {"png,gif,jpeg",
-	                                                96, 96, 96, 96, 0,
-	                                                PURPLE_ICON_SCALE_SEND};
+	proto_class->icon_spec = purple_buddy_icon_spec_new("png,gif,jpeg",
+	                                                    96, 96, 96, 96, 0,
+	                                                    PURPLE_ICON_SCALE_SEND);
 
 	proto_class->whiteboard_protocol_ops = &yahoo_whiteboard_protocol_ops;
 



More information about the Commits mailing list