changeset 19714:43a8cd1f708c

Remove the *_USE_ATTENTION_API markers everywhere.
author Richard Laager <rlaager@wiktel.com>
date Mon, 10 Sep 2007 20:51:59 +0000
parents eabc8a32b1e4
children 77673386d31d
files libpurple/protocols/msn/msn.c libpurple/protocols/msn/msn.h libpurple/protocols/msn/switchboard.c libpurple/protocols/myspace/myspace.c libpurple/protocols/myspace/myspace.h libpurple/protocols/myspace/zap.c libpurple/protocols/yahoo/yahoo.c libpurple/protocols/yahoo/yahoo.h
diffstat 8 files changed, 2 insertions(+), 107 deletions(-) [+]
line wrap: on
line diff
--- a/libpurple/protocols/msn/msn.c	Mon Sep 10 20:29:29 2007 +0000
+++ b/libpurple/protocols/msn/msn.c	Mon Sep 10 20:51:59 2007 +0000
@@ -119,7 +119,6 @@
 	return TRUE;
 }
 
-#ifdef MSN_USE_ATTENTION_API
 static GList *
 msn_attention_types(PurpleAccount *account)
 {
@@ -136,7 +135,6 @@
 
 	return list;
 }
-#endif
 
 
 static PurpleCmdRet
@@ -148,14 +146,7 @@
 
 	username = purple_conversation_get_name(conv);
 
-#ifdef MSN_USE_ATTENTION_API
 	serv_send_attention(gc, username, MSN_NUDGE);
-#else
-	if (!msn_send_attention(gc, username, MSN_NUDGE))
-		return PURPLE_CMD_RET_FAILED;
-
-	purple_conversation_write(conv, NULL, _("You have just sent a Nudge!"), PURPLE_MESSAGE_SYSTEM, time(NULL));
-#endif
 
 	return PURPLE_CMD_RET_OK;
 }
@@ -2139,15 +2130,10 @@
 	NULL,					/* send_raw */
 	NULL,					/* roomlist_room_serialize */
 	NULL,					/* unregister_user */
-
-#ifdef MSN_USE_ATTENTION_API
 	msn_send_attention,                     /* send_attention */
 	msn_attention_types,                    /* attention_types */
-#else
+
 	/* padding */
-	NULL,
-	NULL,
-#endif
 	NULL
 };
 
--- a/libpurple/protocols/msn/msn.h	Mon Sep 10 20:29:29 2007 +0000
+++ b/libpurple/protocols/msn/msn.h	Mon Sep 10 20:51:59 2007 +0000
@@ -82,8 +82,6 @@
 /* Index into attention_types */
 #define MSN_NUDGE 0
 
-#define MSN_USE_ATTENTION_API
-
 typedef enum
 {
 	MSN_LIST_FL_OP = 0x01,
--- a/libpurple/protocols/msn/switchboard.c	Mon Sep 10 20:29:29 2007 +0000
+++ b/libpurple/protocols/msn/switchboard.c	Mon Sep 10 20:51:59 2007 +0000
@@ -963,12 +963,7 @@
 	else
 		username = g_markup_escape_text(user, -1);
 
-#ifdef MSN_USE_ATTENTION_API
 	serv_got_attention(account->gc, buddy->name, MSN_NUDGE);
-#else
-	str = g_strdup_printf(_("%s just sent you a Nudge!"), username);
-	msn_switchboard_report_user(swboard, PURPLE_MESSAGE_SYSTEM|PURPLE_MESSAGE_NOTIFY, str);
-#endif
 	g_free(username);
 	g_free(str);
 }
--- a/libpurple/protocols/myspace/myspace.c	Mon Sep 10 20:29:29 2007 +0000
+++ b/libpurple/protocols/myspace/myspace.c	Mon Sep 10 20:51:59 2007 +0000
@@ -2925,13 +2925,8 @@
 	msim_send_really_raw,  /* send_raw */
 	NULL,                  /* roomlist_room_serialize */
 	NULL,                  /* unregister_user */
-#ifdef MSIM_USE_ATTENTION_API
 	msim_send_attention,   /* send_attention */
 	msim_attention_types,  /* attention_types */
-#else
-	NULL,               /* _purple_reserved2 */
-	NULL,               /* _purple_reserved3 */
-#endif
 	NULL                /* _purple_reserved4 */
 };
 
--- a/libpurple/protocols/myspace/myspace.h	Mon Sep 10 20:29:29 2007 +0000
+++ b/libpurple/protocols/myspace/myspace.h	Mon Sep 10 20:51:59 2007 +0000
@@ -73,10 +73,6 @@
  * you want to actually use the plugin! */
 /*#define MSIM_SELF_TEST            */
 
-/* Use the attention API for zaps? */
-/* Can't have until >=2.2.0, since is a new API. */
-#define MSIM_USE_ATTENTION_API
-
 /* Constants */
 
 /* Maximum length of a password that is acceptable. This is the limit
@@ -180,22 +176,7 @@
 #define MSIM_CONTACT_LIST_IMPORT_ALL_FRIENDS	1
 #define MSIM_CONTACT_LIST_IMPORT_TOP_FRIENDS	2
 
-#ifdef MSIM_USE_ATTENTION_API
 #define MsimAttentionType PurpleAttentionType
-#else
-/* Different kinds of attention alerts. Not yet in libpurple, so define 
- * our own structure here. */
-typedef struct _MsimAttentionType MsimAttentionType;
-
-/** A type of "attention" message (zap, nudge, buzz, etc. depending on the
- * protocol) that can be sent and received. */
-struct _MsimAttentionType {
-	const gchar *name;	 	        /**< Shown before sending. */
-	const gchar *incoming_description;	/**< Shown when sent. */
-	const gchar *outgoing_description;	/**< Shown when received. */
-	const gchar *icon_name;
-};
-#endif
 
 /* Functions */
 gboolean msim_load(PurplePlugin *plugin);
--- a/libpurple/protocols/myspace/zap.c	Mon Sep 10 20:29:29 2007 +0000
+++ b/libpurple/protocols/myspace/zap.c	Mon Sep 10 20:51:59 2007 +0000
@@ -92,19 +92,11 @@
 {
 	gchar *zap_string;
 	gboolean rc;
-#ifndef MSIM_USE_ATTENTION_API
-	GList *types;
-	MsimAttentionType *attn;
-	gchar *zap_description;
-#endif
 
 	g_return_val_if_fail(session != NULL, FALSE);
 	g_return_val_if_fail(username != NULL, FALSE);
 
 
-#ifdef MSIM_USE_ATTENTION_API
-	/* serv_send_attention(session->gc, username, code); */
-#else
 	types = msim_attention_types(session->account);
 
 	attn = g_list_nth_data(types, code);
@@ -120,7 +112,6 @@
 			PURPLE_MESSAGE_SEND | PURPLE_MESSAGE_SYSTEM, time(NULL));
 
 	g_free(zap_description);
-#endif
 
 	/* Construct and send the actual zap command. */
 	zap_string = g_strdup_printf("!!!ZAP_SEND!!!=RTE_BTN_ZAPS_%d", code);
@@ -165,11 +156,7 @@
 
 	zap = GPOINTER_TO_INT(zap_num_ptr);
 
-#ifdef MSIM_USE_ATTENTION_API
 	serv_send_attention(session->gc, buddy->name, zap);
-#else
-	g_return_if_fail(msim_send_zap(session, buddy->name, zap));
-#endif
 }
 
 /** Return menu, if any, for a buddy list node. */
@@ -221,21 +208,6 @@
 {
 	gchar *msg_text, *username;
 	gint zap;
-#ifndef MSIM_USE_ATTENTION_API
-	const gchar *zap_past_tense[10];
-	gchar *zap_text;
-
-	zap_past_tense[0] = _("zapped");
-	zap_past_tense[1] = _("whacked");
-	zap_past_tense[2] = _("torched");
-	zap_past_tense[3] = _("smooched");
-	zap_past_tense[4] = _("hugged");
-	zap_past_tense[5] = _("bslapped");
-	zap_past_tense[6] = _("goosed");
-	zap_past_tense[7] = _("hi-fived");
-	zap_past_tense[8] = _("punk'd");
-	zap_past_tense[9] = _("raspberried");
-#endif
 
 	msg_text = msim_msg_get_string(msg, "msg");
 	username = msim_msg_get_string(msg, "_username");
@@ -247,14 +219,7 @@
 
 	zap = CLAMP(zap, 0, 9);
 
-#ifdef MSIM_USE_ATTENTION_API
 	serv_got_attention(session->gc, username, zap);
-#else
-	zap_text = g_strdup_printf(_("*** You have been %s! ***"), zap_past_tense[zap]);
-	serv_got_im(session->gc, username, zap_text, 
-			PURPLE_MESSAGE_RECV | PURPLE_MESSAGE_SYSTEM, time(NULL));
-	g_free(zap_text);
-#endif
 
 	g_free(msg_text);
 	g_free(username);
--- a/libpurple/protocols/yahoo/yahoo.c	Mon Sep 10 20:29:29 2007 +0000
+++ b/libpurple/protocols/yahoo/yahoo.c	Mon Sep 10 20:51:59 2007 +0000
@@ -909,13 +909,8 @@
 			else
 				username = g_markup_escape_text(im->from, -1);
 
-#ifdef YAHOO_USE_ATTENTION_API
 			serv_got_attention(gc, username, YAHOO_BUZZ);
-#else
-			str = g_strdup_printf(_("%s just sent you a Buzz!"), username);
-
-			purple_conversation_write(c, NULL, str, PURPLE_MESSAGE_SYSTEM|PURPLE_MESSAGE_NOTIFY, im->time);
-#endif
+
 			g_free(username);
 			g_free(str);
 			g_free(m);
@@ -4037,22 +4032,11 @@
 static PurpleCmdRet
 yahoopurple_cmd_buzz(PurpleConversation *c, const gchar *cmd, gchar **args, gchar **error, void *data) {
 	PurpleAccount *account = purple_conversation_get_account(c);
-#ifndef YAHOO_USE_ATTENTION_API
-	const char *username = purple_account_get_username(account);
-#endif
 
 	if (*args && args[0])
 		return PURPLE_CMD_RET_FAILED;
 
-#ifdef YAHOO_USE_ATTENTION_API
 	serv_send_attention(account->gc, c->name, YAHOO_BUZZ);
-#else
-
-	purple_debug(PURPLE_DEBUG_INFO, "yahoo",
-	           "Sending <ding> on account %s to buddy %s.\n", username, c->name);
-	purple_conv_im_send(PURPLE_CONV_IM(c), "<ding>");
-	purple_conversation_write(c, NULL, _("You have just sent a Buzz!"), PURPLE_MESSAGE_SYSTEM, time(NULL));
-#endif
 
 	return PURPLE_CMD_RET_OK;
 }
@@ -4347,13 +4331,8 @@
 	NULL, /* roomlist_room_serialize */
 	NULL, /* unregister_user */
 
-#ifdef YAHOO_USE_ATTENTION_API
 	yahoo_send_attention,
 	yahoo_attention_types,
-#else
-	NULL,
-	NULL,
-#endif
 
 	/* padding */
 	NULL
--- a/libpurple/protocols/yahoo/yahoo.h	Mon Sep 10 20:29:29 2007 +0000
+++ b/libpurple/protocols/yahoo/yahoo.h	Mon Sep 10 20:51:59 2007 +0000
@@ -67,12 +67,8 @@
 #define YAHOO_STATUS_TYPE_INVISIBLE "invisible"
 #define YAHOO_STATUS_TYPE_MOBILE "mobile"
 
-#define YAHOO_USE_ATTENTION_API
-
-#ifdef YAHOO_USE_ATTENTION_API
 /* Index into attention types list. */
 #define YAHOO_BUZZ 0
-#endif
 
 enum yahoo_status {
 	YAHOO_STATUS_AVAILABLE = 0,