aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorXavier Claessens <xclaesse@gmail.com>2011-09-09 18:29:35 +0800
committerXavier Claessens <xclaesse@gmail.com>2011-09-09 19:02:13 +0800
commit3dd675c21527cabb74cd9b4301ea82324e0f17b6 (patch)
tree889ea74a6c16c8150656607a20bbd36cc1bdd991
parent56f569b22192230080eb6c20d0d5474fa7e47086 (diff)
downloadgsoc2013-empathy-3dd675c21527cabb74cd9b4301ea82324e0f17b6.tar
gsoc2013-empathy-3dd675c21527cabb74cd9b4301ea82324e0f17b6.tar.gz
gsoc2013-empathy-3dd675c21527cabb74cd9b4301ea82324e0f17b6.tar.bz2
gsoc2013-empathy-3dd675c21527cabb74cd9b4301ea82324e0f17b6.tar.lz
gsoc2013-empathy-3dd675c21527cabb74cd9b4301ea82324e0f17b6.tar.xz
gsoc2013-empathy-3dd675c21527cabb74cd9b4301ea82324e0f17b6.tar.zst
gsoc2013-empathy-3dd675c21527cabb74cd9b4301ea82324e0f17b6.zip
Because we like whales
-rw-r--r--libempathy-gtk/empathy-chat.c45
1 files changed, 43 insertions, 2 deletions
diff --git a/libempathy-gtk/empathy-chat.c b/libempathy-gtk/empathy-chat.c
index 032dd2464..b9313a9e3 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;
}