/soc/2013/ankitkv/gobjectification: faa5b053f310: Replaced purpl...

Ankit Vani a at nevitus.org
Thu Aug 1 17:50:18 EDT 2013


Changeset: faa5b053f310d4a85db2ec801701a9dfecdfca16
Author:	 Ankit Vani <a at nevitus.org>
Date:	 2013-08-02 03:19 +0530
Branch:	 soc.2013.gobjectification
URL: https://hg.pidgin.im/soc/2013/ankitkv/gobjectification/rev/faa5b053f310

Description:

Replaced purple_conversation_helper_present_error() with simpler purple_conversation_present_error()

diffstat:

 libpurple/conversation.c                      |  6 +++---
 libpurple/conversation.h                      |  2 +-
 libpurple/plugins/perl/common/Conversation.xs |  2 +-
 libpurple/protocols/msn/msn.c                 |  2 +-
 libpurple/protocols/myspace/myspace.c         |  2 +-
 libpurple/protocols/null/nullprpl.c           |  2 +-
 libpurple/protocols/oscar/family_icbm.c       |  2 +-
 libpurple/protocols/oscar/oscar.c             |  8 ++++----
 libpurple/protocols/oscar/userinfo.c          |  2 +-
 libpurple/protocols/sametime/sametime.c       |  2 +-
 libpurple/protocols/yahoo/libymsg.c           |  2 +-
 11 files changed, 16 insertions(+), 16 deletions(-)

diffs (177 lines):

diff --git a/libpurple/conversation.c b/libpurple/conversation.c
--- a/libpurple/conversation.c
+++ b/libpurple/conversation.c
@@ -166,7 +166,7 @@ common_send(PurpleConversation *conv, co
 		if (err == -E2BIG) {
 			msg = _("Unable to send message: The message is too large.");
 
-			if (!purple_conversation_helper_present_error(who, account, msg)) {
+			if (!purple_conversation_present_error(who, account, msg)) {
 				char *msg2 = g_strdup_printf(_("Unable to send message to %s."), who);
 				purple_notify_error(gc, NULL, msg2, _("The message is too large."));
 				g_free(msg2);
@@ -179,7 +179,7 @@ common_send(PurpleConversation *conv, co
 		else {
 			msg = _("Unable to send message.");
 
-			if (!purple_conversation_helper_present_error(who, account, msg)) {
+			if (!purple_conversation_present_error(who, account, msg)) {
 				char *msg2 = g_strdup_printf(_("Unable to send message to %s."), who);
 				purple_notify_error(gc, NULL, msg2, NULL);
 				g_free(msg2);
@@ -639,7 +639,7 @@ purple_conversation_update(PurpleConvers
 					 "conversation-updated", conv, type);
 }
 
-gboolean purple_conversation_helper_present_error(const char *who, PurpleAccount *account, const char *what)
+gboolean purple_conversation_present_error(const char *who, PurpleAccount *account, const char *what)
 {
 	PurpleConversation *conv;
 
diff --git a/libpurple/conversation.h b/libpurple/conversation.h
--- a/libpurple/conversation.h
+++ b/libpurple/conversation.h
@@ -639,7 +639,7 @@ gboolean purple_conversation_do_command(
  * @param what    The error
  * @return        TRUE if the error was presented, else FALSE
  */
-gboolean purple_conversation_helper_present_error(const char *who, PurpleAccount *account, const char *what);
+gboolean purple_conversation_present_error(const char *who, PurpleAccount *account, const char *what);
 
 /*@}*/
 
diff --git a/libpurple/plugins/perl/common/Conversation.xs b/libpurple/plugins/perl/common/Conversation.xs
--- a/libpurple/plugins/perl/common/Conversation.xs
+++ b/libpurple/plugins/perl/common/Conversation.xs
@@ -310,7 +310,7 @@ MODULE = Purple::Conversation  PACKAGE =
 PROTOTYPES: ENABLE
 
 gboolean
-purple_conversation_helper_present_error(who, account, what)
+purple_conversation_present_error(who, account, what)
 	const char *who
 	Purple::Account account
 	const char *what
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
@@ -1786,7 +1786,7 @@ msn_add_buddy(PurpleConnection *pc, Purp
 	if (!msn_email_is_valid(bname)) {
 		gchar *buf;
 		buf = g_strdup_printf(_("Unable to add the buddy %s because the username is invalid.  Usernames must be valid email addresses."), bname);
-		if (!purple_conversation_helper_present_error(bname, account, buf))
+		if (!purple_conversation_present_error(bname, account, buf))
 			purple_notify_error(pc, NULL, _("Unable to Add"), buf);
 		g_free(buf);
 
diff --git a/libpurple/protocols/myspace/myspace.c b/libpurple/protocols/myspace/myspace.c
--- a/libpurple/protocols/myspace/myspace.c
+++ b/libpurple/protocols/myspace/myspace.c
@@ -132,7 +132,7 @@ msim_postprocess_outgoing_cb(MsimSession
 		gchar *msg;
 
 		msg = g_strdup_printf(_("No such user: %s"), username);
-		if (!purple_conversation_helper_present_error(username, session->account, msg)) {
+		if (!purple_conversation_present_error(username, session->account, msg)) {
 			purple_notify_error(NULL, NULL, _("User lookup"), msg);
 		}
 
diff --git a/libpurple/protocols/null/nullprpl.c b/libpurple/protocols/null/nullprpl.c
--- a/libpurple/protocols/null/nullprpl.c
+++ b/libpurple/protocols/null/nullprpl.c
@@ -429,7 +429,7 @@ static int nullprpl_send_im(PurpleConnec
     purple_debug_info("nullprpl",
                       "discarding; %s is blocked by %s's privacy settings\n",
                       from_username, who);
-    purple_conversation_helper_present_error(who, purple_connection_get_account(gc), msg);
+    purple_conversation_present_error(who, purple_connection_get_account(gc), msg);
     g_free(msg);
     return 0;
   }
diff --git a/libpurple/protocols/oscar/family_icbm.c b/libpurple/protocols/oscar/family_icbm.c
--- a/libpurple/protocols/oscar/family_icbm.c
+++ b/libpurple/protocols/oscar/family_icbm.c
@@ -174,7 +174,7 @@ error(OscarData *od, FlapConnection *con
 	else
 		buf = g_strdup_printf(_("Unable to send message: %s"), reason_str);
 
-	if (!purple_conversation_helper_present_error(bn, purple_connection_get_account(gc), buf)) {
+	if (!purple_conversation_present_error(bn, purple_connection_get_account(gc), buf)) {
 		g_free(buf);
 		if (errcode != 0 && errcode < errcodereasonlen)
 			buf = g_strdup_printf(_("Unable to send message to %s: %s (%s)"),
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
@@ -2034,7 +2034,7 @@ static int purple_parse_misses(OscarData
 			break;
 	}
 
-	if (!purple_conversation_helper_present_error(userinfo->bn, account, buf))
+	if (!purple_conversation_present_error(userinfo->bn, account, buf))
 		purple_notify_error(od->gc, NULL, buf, NULL);
 	g_free(buf);
 
@@ -3498,7 +3498,7 @@ oscar_add_buddy(PurpleConnection *gc, Pu
 	if (!oscar_util_valid_name(bname)) {
 		gchar *buf;
 		buf = g_strdup_printf(_("Unable to add the buddy %s because the username is invalid.  Usernames must be a valid email address, or start with a letter and contain only letters, numbers and spaces, or contain only numbers."), bname);
-		if (!purple_conversation_helper_present_error(bname, account, buf))
+		if (!purple_conversation_present_error(bname, account, buf))
 			purple_notify_error(gc, NULL, _("Unable to Add"), buf);
 		g_free(buf);
 
@@ -3964,7 +3964,7 @@ static int purple_ssi_parseack(OscarData
 			case 0x000c: { /* you are over the limit, the cheat is to the limit, come on fhqwhgads */
 				gchar *buf;
 				buf = g_strdup_printf(_("Unable to add the buddy %s because you have too many buddies in your buddy list.  Please remove one and try again."), (retval->name ? retval->name : _("(no name)")));
-				if ((retval->name != NULL) && !purple_conversation_helper_present_error(retval->name, purple_connection_get_account(gc), buf))
+				if ((retval->name != NULL) && !purple_conversation_present_error(retval->name, purple_connection_get_account(gc), buf))
 					purple_notify_error(gc, NULL, _("Unable to Add"), buf);
 				g_free(buf);
 			} break;
@@ -3979,7 +3979,7 @@ static int purple_ssi_parseack(OscarData
 				purple_debug_error("oscar", "ssi: Action 0x%04hx was unsuccessful with error 0x%04hx\n", retval->action, retval->ack);
 				buf = g_strdup_printf(_("Unable to add the buddy %s for an unknown reason."),
 						(retval->name ? retval->name : _("(no name)")));
-				if ((retval->name != NULL) && !purple_conversation_helper_present_error(retval->name, purple_connection_get_account(gc), buf))
+				if ((retval->name != NULL) && !purple_conversation_present_error(retval->name, purple_connection_get_account(gc), buf))
 					purple_notify_error(gc, NULL, _("Unable to Add"), buf);
 				g_free(buf);
 			} break;
diff --git a/libpurple/protocols/oscar/userinfo.c b/libpurple/protocols/oscar/userinfo.c
--- a/libpurple/protocols/oscar/userinfo.c
+++ b/libpurple/protocols/oscar/userinfo.c
@@ -369,7 +369,7 @@ oscar_user_info_display_error(OscarData 
 	purple_notify_user_info_add_pair_plaintext(user_info, NULL, buf);
 	purple_notify_userinfo(od->gc, buddy, user_info, NULL, NULL);
 	purple_notify_user_info_destroy(user_info);
-	purple_conversation_helper_present_error(buddy, purple_connection_get_account(od->gc), buf);
+	purple_conversation_present_error(buddy, purple_connection_get_account(od->gc), buf);
 	g_free(buf);
 }
 
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
@@ -2470,7 +2470,7 @@ static void convo_error(struct mwConvers
   text = g_strconcat(_("Unable to send message: "), tmp, NULL);
 
   im = convo_get_im(conv);
-  if(im && !purple_conversation_helper_present_error(idb->user,
+  if(im && !purple_conversation_present_error(idb->user,
   		purple_conversation_get_account(PURPLE_CONVERSATION(im)), text)) {
 
     g_free(text);
diff --git a/libpurple/protocols/yahoo/libymsg.c b/libpurple/protocols/yahoo/libymsg.c
--- a/libpurple/protocols/yahoo/libymsg.c
+++ b/libpurple/protocols/yahoo/libymsg.c
@@ -2313,7 +2313,7 @@ static void yahoo_process_addbuddy(Purpl
 	decoded_group = yahoo_string_decode(gc, group, FALSE);
 	buf = g_strdup_printf(_("Unable to add buddy %s to group %s to the server list on account %s."),
 				who, decoded_group, purple_connection_get_display_name(gc));
-	if (!purple_conversation_helper_present_error(who, purple_connection_get_account(gc), buf))
+	if (!purple_conversation_present_error(who, purple_connection_get_account(gc), buf))
 		purple_notify_error(gc, NULL, _("Unable to add buddy to server list"), buf);
 	g_free(buf);
 	g_free(decoded_group);



More information about the Commits mailing list