[empathy] Because we like whales



commit 3dd675c21527cabb74cd9b4301ea82324e0f17b6
Author: Xavier Claessens <xclaesse gmail com>
Date:   Fri Sep 9 12:29:35 2011 +0200

    Because we like whales

 libempathy-gtk/empathy-chat.c |   45 +++++++++++++++++++++++++++++++++++++++-
 1 files changed, 43 insertions(+), 2 deletions(-)
---
diff --git a/libempathy-gtk/empathy-chat.c b/libempathy-gtk/empathy-chat.c
index 032dd24..b9313a9 100644
--- a/libempathy-gtk/empathy-chat.c
+++ b/libempathy-gtk/empathy-chat.c
@@ -1012,6 +1012,34 @@ chat_command_whois (EmpathyChat *chat,
 		whois_got_contact_cb, NULL, NULL, G_OBJECT (chat));
 }
 
+static void
+chat_command_whale (EmpathyChat *chat,
+		    GStrv        strv)
+{
+	EmpathyChatPriv *priv = GET_PRIV (chat);
+	TpMessage *message;
+
+	message = tp_client_message_new_text (TP_CHANNEL_TEXT_MESSAGE_TYPE_NORMAL,
+		"\n\n\n"
+		"â_______________â");
+	empathy_tp_chat_send (priv->tp_chat, message);
+	g_object_unref (message);
+}
+
+static void
+chat_command_babywhale (EmpathyChat *chat,
+			GStrv        strv)
+{
+	EmpathyChatPriv *priv = GET_PRIV (chat);
+	TpMessage *message;
+
+	message = tp_client_message_new_text (TP_CHANNEL_TEXT_MESSAGE_TYPE_NORMAL,
+		"\n"
+		"â_____â");
+	empathy_tp_chat_send (priv->tp_chat, message);
+	g_object_unref (message);
+}
+
 static void chat_command_help (EmpathyChat *chat, GStrv strv);
 
 typedef void (*ChatCommandFunc) (EmpathyChat *chat, GStrv strv);
@@ -1066,6 +1094,9 @@ static ChatCommandItem commands[] = {
 	{"help", 1, 2, chat_command_help, NULL,
 	 N_("/help [<command>]: show all supported commands. "
 	    "If <command> is defined, show its usage.")},
+
+	{"whale", 1, 1, chat_command_whale, NULL, NULL},
+	{"babywhale", 1, 1, chat_command_babywhale, NULL, NULL},
 };
 
 static void
@@ -1074,6 +1105,10 @@ chat_command_show_help (EmpathyChat     *chat,
 {
 	gchar *str;
 
+	if (item->help == NULL) {
+		return;
+	}
+
 	str = g_strdup_printf (_("Usage: %s"), _(item->help));
 	empathy_chat_view_append_event (chat->view, str);
 	g_free (str);
@@ -1094,8 +1129,11 @@ chat_command_help (EmpathyChat *chat,
 					continue;
 				}
 			}
-		    empathy_chat_view_append_event (chat->view,
-			    _(commands[i].help));
+			if (commands[i].help == NULL) {
+				continue;
+			}
+			empathy_chat_view_append_event (chat->view,
+				_(commands[i].help));
 		}
 		return;
 	}
@@ -1107,6 +1145,9 @@ chat_command_help (EmpathyChat *chat,
 					break;
 				}
 			}
+			if (commands[i].help == NULL) {
+				break;
+			}
 			chat_command_show_help (chat, &commands[i]);
 			return;
 		}



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]