/pidgin/main: ad2b7d9cc0c3: Remove dead send_whisper feature

Tomasz Wasilczyk twasilczyk at pidgin.im
Thu May 22 13:37:35 EDT 2014


Changeset: ad2b7d9cc0c362e472746a3a055f882c687ff93e
Author:	 Tomasz Wasilczyk <twasilczyk at pidgin.im>
Date:	 2014-05-22 16:07 +0200
Branch:	 default
URL: https://hg.pidgin.im/pidgin/main/rev/ad2b7d9cc0c3

Description:

Remove dead send_whisper feature

diffstat:

 libpurple/protocols/bonjour/bonjour.c    |   1 -
 libpurple/protocols/gg/gg.c              |   3 +-
 libpurple/protocols/irc/irc.c            |   1 -
 libpurple/protocols/jabber/libfacebook.c |   1 -
 libpurple/protocols/jabber/libgtalk.c    |   1 -
 libpurple/protocols/jabber/libxmpp.c     |   1 -
 libpurple/protocols/msn/msn.c            |   1 -
 libpurple/protocols/mxit/mxit.c          |   1 -
 libpurple/protocols/novell/novell.c      |   1 -
 libpurple/protocols/null/nullprpl.c      |  76 --------------------------------
 libpurple/protocols/oscar/libaim.c       |   1 -
 libpurple/protocols/oscar/libicq.c       |   1 -
 libpurple/protocols/sametime/sametime.c  |  10 ----
 libpurple/protocols/silc/silc.c          |   1 -
 libpurple/protocols/simple/simple.c      |   1 -
 libpurple/protocols/yahoo/libyahoo.c     |   1 -
 libpurple/protocols/yahoo/libyahoojp.c   |   1 -
 libpurple/protocols/zephyr/zephyr.c      |   1 -
 libpurple/prpl.h                         |  10 ----
 libpurple/server.c                       |  14 -----
 libpurple/server.h                       |   1 -
 21 files changed, 1 insertions(+), 128 deletions(-)

diffs (truncated from 362 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
@@ -528,7 +528,6 @@ static PurplePluginProtocolInfo prpl_inf
 	NULL,                                                    /* get_chat_name */
 	NULL,                                                    /* chat_invite */
 	NULL,                                                    /* chat_leave */
-	NULL,                                                    /* chat_whisper */
 	NULL,                                                    /* chat_send */
 	NULL,                                                    /* keepalive */
 	NULL,                                                    /* register_user */
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
@@ -1019,10 +1019,9 @@ static PurplePluginProtocolInfo prpl_inf
 	ggp_chat_get_name,		/* get_chat_name */
 	ggp_chat_invite,		/* chat_invite */
 	ggp_chat_leave,			/* chat_leave */
-	NULL,				/* chat_whisper */
 	ggp_chat_send,			/* chat_send */
 #else
-	NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+	NULL, NULL, NULL, NULL, NULL, NULL,
 #endif
 	ggp_keepalive,			/* keepalive */
 	NULL,				/* register_user */
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
@@ -969,7 +969,6 @@ static PurplePluginProtocolInfo prpl_inf
 	irc_get_chat_name,	/* get_chat_name */
 	irc_chat_invite,	/* chat_invite */
 	irc_chat_leave,		/* chat_leave */
-	NULL,					/* chat_whisper */
 	irc_chat_send,		/* chat_send */
 	irc_keepalive,		/* keepalive */
 	NULL,					/* register_user */
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
@@ -116,7 +116,6 @@ static PurplePluginProtocolInfo prpl_inf
 	NULL,							/* get_chat_name */
 	NULL,							/* chat_invite */
 	NULL,							/* chat_leave */
-	NULL,							/* chat_whisper */
 	NULL,							/* chat_send */
 	jabber_keepalive,				/* keepalive */
 	NULL,							/* register_user */
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
@@ -99,7 +99,6 @@ static PurplePluginProtocolInfo prpl_inf
 	jabber_get_chat_name,			/* get_chat_name */
 	jabber_chat_invite,				/* chat_invite */
 	jabber_chat_leave,				/* chat_leave */
-	NULL,							/* chat_whisper */
 	jabber_message_send_chat,		/* chat_send */
 	jabber_keepalive,				/* keepalive */
 	NULL,							/* register_user */
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
@@ -93,7 +93,6 @@ static PurplePluginProtocolInfo prpl_inf
 	jabber_get_chat_name,			/* get_chat_name */
 	jabber_chat_invite,				/* chat_invite */
 	jabber_chat_leave,				/* chat_leave */
-	NULL,							/* chat_whisper */
 	jabber_message_send_chat,		/* chat_send */
 	jabber_keepalive,				/* keepalive */
 	jabber_register_account,		/* register_user */
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
@@ -2918,7 +2918,6 @@ static PurplePluginProtocolInfo prpl_inf
 	NULL,                               /* get_chat_name */
 	msn_chat_invite,                    /* chat_invite */
 	msn_chat_leave,                     /* chat_leave */
-	NULL,                               /* chat_whisper */
 	msn_chat_send,                      /* chat_send */
 	msn_keepalive,                      /* keepalive */
 	NULL,                               /* register_user */
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
@@ -765,7 +765,6 @@ static PurplePluginProtocolInfo proto_in
 	mxit_chat_name,			/* get_chat_name			[multimx.c] */
 	mxit_chat_invite,		/* chat_invite				[multimx.c] */
 	mxit_chat_leave,		/* chat_leave				[multimx.c] */
-	NULL,					/* chat_whisper */
 	mxit_chat_send,			/* chat_send				[multimx.c] */
 	mxit_keepalive,			/* keepalive */
 	mxit_register,			/* register_user */
diff --git a/libpurple/protocols/novell/novell.c b/libpurple/protocols/novell/novell.c
--- a/libpurple/protocols/novell/novell.c
+++ b/libpurple/protocols/novell/novell.c
@@ -3541,7 +3541,6 @@ static PurplePluginProtocolInfo prpl_inf
 	NULL,					/* get_chat_name */
 	novell_chat_invite,			/* chat_invite */
 	novell_chat_leave,			/* chat_leave */
-	NULL,						/* chat_whisper */
 	novell_chat_send,			/* chat_send */
 	novell_keepalive,			/* keepalive */
 	NULL,						/* register_user */
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
@@ -781,71 +781,6 @@ static void nullprpl_chat_leave(PurpleCo
   foreach_gc_in_chat(left_chat_room, gc, id, NULL);
 }
 
-static PurpleCmdRet send_whisper(PurpleConversation *conv, const gchar *cmd,
-                                 gchar **args, gchar **error, void *userdata) {
-  const char *to_username;
-  const char *message;
-  const char *from_username;
-  PurpleChatUser *chat_user;
-  PurpleConnection *to;
-
-  /* parse args */
-  to_username = args[0];
-  message = args[1];
-
-  if (!to_username || !*to_username) {
-    *error = g_strdup(_("Whisper is missing recipient."));
-    return PURPLE_CMD_RET_FAILED;
-  } else if (!message || !*message) {
-    *error = g_strdup(_("Whisper is missing message."));
-    return PURPLE_CMD_RET_FAILED;
-  }
-
-  from_username = purple_account_get_username(purple_conversation_get_account(conv));
-  purple_debug_info("nullprpl", "%s whispers to %s in chat room %s: %s\n",
-                    from_username, to_username,
-                    purple_conversation_get_name(conv), message);
-
-  chat_user = purple_chat_conversation_find_user(PURPLE_CHAT_CONVERSATION(conv), to_username);
-  to = get_nullprpl_gc(to_username);
-
-  if (!chat_user) {
-    /* this will be freed by the caller */
-    *error = g_strdup_printf(_("%s is not logged in."), to_username);
-    return PURPLE_CMD_RET_FAILED;
-  } else if (!to) {
-    *error = g_strdup_printf(_("%s is not in this chat room."), to_username);
-    return PURPLE_CMD_RET_FAILED;
-  } else {
-    /* write the whisper in the sender's chat window  */
-    char *message_to = g_strdup_printf("%s (to %s)", message, to_username);
-    purple_conversation_write_message(conv, from_username, message_to,
-                                      PURPLE_MESSAGE_SEND | PURPLE_MESSAGE_WHISPER,
-                                      time(NULL));
-    g_free(message_to);
-
-    /* send the whisper */
-    purple_serv_chat_whisper(to, purple_chat_conversation_get_id(PURPLE_CHAT_CONVERSATION(conv)),
-                      from_username, message);
-
-    return PURPLE_CMD_RET_OK;
-  }
-}
-
-static void nullprpl_chat_whisper(PurpleConnection *gc, int id, const char *who,
-                                  const char *message) {
-  const char *username = purple_account_get_username(purple_connection_get_account(gc));
-  PurpleChatConversation *chat = purple_conversations_find_chat(gc, id);
-  purple_debug_info("nullprpl",
-                    "%s receives whisper from %s in chat room %s: %s\n",
-                    username, who, purple_conversation_get_name(PURPLE_CONVERSATION(chat)),
-                    message);
-
-  /* receive whisper on recipient's account */
-  purple_serv_got_chat_in(gc, id, who, PURPLE_MESSAGE_RECV | PURPLE_MESSAGE_WHISPER,
-                   message, time(NULL));
-}
-
 static void receive_chat_message(PurpleChatConversation *from, PurpleChatConversation *to,
                                  int id, const char *room, gpointer userdata) {
   const char *message = (const char *)userdata;
@@ -1115,7 +1050,6 @@ static PurplePluginProtocolInfo prpl_inf
   nullprpl_get_chat_name,              /* get_chat_name */
   nullprpl_chat_invite,                /* chat_invite */
   nullprpl_chat_leave,                 /* chat_leave */
-  nullprpl_chat_whisper,               /* chat_whisper */
   nullprpl_chat_send,                  /* chat_send */
   NULL,                                /* keepalive */
   nullprpl_register_user,              /* register_user */
@@ -1170,16 +1104,6 @@ static void nullprpl_init(PurplePlugin *
   prpl_info.user_splits = g_list_append(NULL, split);
   prpl_info.protocol_options = g_list_append(NULL, option);
 
-  /* register whisper chat command, /msg */
-  purple_cmd_register("msg",
-                    "ws",                  /* args: recipient and message */
-                    PURPLE_CMD_P_DEFAULT,  /* priority */
-                    PURPLE_CMD_FLAG_CHAT,
-                    "prpl-null",
-                    send_whisper,
-                    "msg <username> <message>: send a private message, aka a whisper",
-                    NULL);                 /* userdata */
-
   /* get ready to store offline messages */
   goffline_messages = g_hash_table_new_full(g_str_hash,  /* hash fn */
                                             g_str_equal, /* key comparison fn */
diff --git a/libpurple/protocols/oscar/libaim.c b/libpurple/protocols/oscar/libaim.c
--- a/libpurple/protocols/oscar/libaim.c
+++ b/libpurple/protocols/oscar/libaim.c
@@ -65,7 +65,6 @@ static PurplePluginProtocolInfo prpl_inf
 	oscar_get_chat_name,	/* get_chat_name */
 	oscar_chat_invite,		/* chat_invite */
 	oscar_chat_leave,		/* chat_leave */
-	NULL,					/* chat_whisper */
 	oscar_send_chat,		/* chat_send */
 	oscar_keepalive,		/* keepalive */
 	NULL,					/* register_user */
diff --git a/libpurple/protocols/oscar/libicq.c b/libpurple/protocols/oscar/libicq.c
--- a/libpurple/protocols/oscar/libicq.c
+++ b/libpurple/protocols/oscar/libicq.c
@@ -81,7 +81,6 @@ static PurplePluginProtocolInfo prpl_inf
 	oscar_get_chat_name,	/* get_chat_name */
 	oscar_chat_invite,		/* chat_invite */
 	oscar_chat_leave,		/* chat_leave */
-	NULL,					/* chat_whisper */
 	oscar_send_chat,		/* chat_send */
 	oscar_keepalive,		/* keepalive */
 	NULL,					/* register_user */
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
@@ -4770,15 +4770,6 @@ static void mw_prpl_chat_leave(PurpleCon
 }
 
 
-static void mw_prpl_chat_whisper(PurpleConnection *gc,
-				 int id,
-				 const char *who,
-				 const char *message) {
-
-  mw_prpl_send_im(gc, purple_message_new(who, message, 0));
-}
-
-
 static int mw_prpl_chat_send(PurpleConnection *gc, int id, PurpleMessage *pmsg)
 {
   struct mwPurplePluginData *pd;
@@ -5097,7 +5088,6 @@ static PurplePluginProtocolInfo mw_prpl_
   mw_prpl_get_chat_name,
   mw_prpl_chat_invite,
   mw_prpl_chat_leave,
-  mw_prpl_chat_whisper,
   mw_prpl_chat_send,
   mw_prpl_keepalive,
   NULL,
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
@@ -2104,7 +2104,6 @@ static PurplePluginProtocolInfo prpl_inf
 	silcpurple_get_chat_name,		/* get_chat_name */
 	silcpurple_chat_invite,			/* chat_invite */
 	silcpurple_chat_leave,			/* chat_leave */
-	NULL,					/* chat_whisper */
 	silcpurple_chat_send,			/* chat_send */
 	silcpurple_keepalive,			/* keepalive */
 	NULL,					/* register_user */
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
@@ -2085,7 +2085,6 @@ static PurplePluginProtocolInfo prpl_inf
 	NULL,					/* get_chat_name */
 	NULL,					/* chat_invite */
 	NULL,					/* chat_leave */
-	NULL,					/* chat_whisper */
 	NULL,					/* chat_send */
 	simple_keep_alive,		/* keepalive */
 	NULL,					/* register_user */
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
@@ -230,7 +230,6 @@ static PurplePluginProtocolInfo prpl_inf
 	yahoo_get_chat_name,
 	yahoo_c_invite,
 	yahoo_c_leave,
-	NULL, /* chat whisper */
 	yahoo_c_send,
 	yahoo_keepalive,
 	NULL, /* register_user */
diff --git a/libpurple/protocols/yahoo/libyahoojp.c b/libpurple/protocols/yahoo/libyahoojp.c
--- a/libpurple/protocols/yahoo/libyahoojp.c
+++ b/libpurple/protocols/yahoo/libyahoojp.c
@@ -126,7 +126,6 @@ static PurplePluginProtocolInfo prpl_inf
 	yahoo_get_chat_name,
 	yahoo_c_invite,
 	yahoo_c_leave,
-	NULL, /* chat whisper */
 	yahoo_c_send,
 	yahoo_keepalive,
 	NULL, /* register_user */
diff --git a/libpurple/protocols/zephyr/zephyr.c b/libpurple/protocols/zephyr/zephyr.c
--- a/libpurple/protocols/zephyr/zephyr.c
+++ b/libpurple/protocols/zephyr/zephyr.c
@@ -2923,7 +2923,6 @@ static PurplePluginProtocolInfo prpl_inf



More information about the Commits mailing list