aboutsummaryrefslogtreecommitdiffstats
path: root/libempathy-gtk
diff options
context:
space:
mode:
authorWill Thompson <will.thompson@collabora.co.uk>2009-08-28 20:18:44 +0800
committerWill Thompson <will.thompson@collabora.co.uk>2009-08-28 20:18:46 +0800
commit9488760608fb66ac49951fb39741d524cf009c02 (patch)
treee0e2ee642e84c54c733660a657640637cf8999b1 /libempathy-gtk
parentb81c0c48ad7bf68583c08e38f8a2a90c7c7dce4b (diff)
parentc2cbd1de858c0a8a994358fc717054ce32c8b895 (diff)
downloadgsoc2013-empathy-9488760608fb66ac49951fb39741d524cf009c02.tar
gsoc2013-empathy-9488760608fb66ac49951fb39741d524cf009c02.tar.gz
gsoc2013-empathy-9488760608fb66ac49951fb39741d524cf009c02.tar.bz2
gsoc2013-empathy-9488760608fb66ac49951fb39741d524cf009c02.tar.lz
gsoc2013-empathy-9488760608fb66ac49951fb39741d524cf009c02.tar.xz
gsoc2013-empathy-9488760608fb66ac49951fb39741d524cf009c02.tar.zst
gsoc2013-empathy-9488760608fb66ac49951fb39741d524cf009c02.zip
Merge branch 'do-say-me-think'
Reviewed-by: Guillaume Desmottes <guillaume.desmottes@collabora.co.uk>
Diffstat (limited to 'libempathy-gtk')
-rw-r--r--libempathy-gtk/empathy-chat.c32
1 files changed, 9 insertions, 23 deletions
diff --git a/libempathy-gtk/empathy-chat.c b/libempathy-gtk/empathy-chat.c
index 9096beeae..a979c9e76 100644
--- a/libempathy-gtk/empathy-chat.c
+++ b/libempathy-gtk/empathy-chat.c
@@ -391,34 +391,20 @@ chat_send (EmpathyChat *chat,
chat_sent_message_add (chat, msg);
- if (g_str_has_prefix (msg, "/clear")) {
+ if (strcmp (msg, "/clear") == 0) {
empathy_chat_view_clear (chat->view);
return;
}
- /* Blacklist messages begining by '/', except for "/me" and "/say"
- * because they are handled in EmpathyMessage */
- if (msg[0] == '/' &&
- !g_str_has_prefix (msg, "/me") &&
- !g_str_has_prefix (msg, "/say")) {
- /* Also allow messages with two slashes before the first space,
- * so it is possible to send an /unix/path */
- int slash_count = 0, i;
- for (i = 0; msg[i] && msg[i] != ' ' && slash_count < 2; i++) {
- if (msg[i] == '/')
- slash_count++;
- }
- if (slash_count == 1) {
- empathy_chat_view_append_event (chat->view,
- _("Unsupported command"));
- return;
- }
- }
+ message = empathy_message_new_from_entry (msg);
- /* We can send the message */
- message = empathy_message_new (msg);
- empathy_tp_chat_send (priv->tp_chat, message);
- g_object_unref (message);
+ if (message == NULL) {
+ empathy_chat_view_append_event (chat->view,
+ _("Unsupported command"));
+ } else {
+ empathy_tp_chat_send (priv->tp_chat, message);
+ g_object_unref (message);
+ }
}
static void