aboutsummaryrefslogtreecommitdiffstats
path: root/libempathy-gtk/empathy-chat.c
diff options
context:
space:
mode:
authorFrédéric Péters <fpeters@0d.be>2009-07-28 16:36:47 +0800
committerGuillaume Desmottes <guillaume.desmottes@collabora.co.uk>2009-08-07 22:16:29 +0800
commita90f1f5cb840c43a60a5da2e5d6daa884ba8dd2c (patch)
tree5257dfd9e3e68678f4d0101f0ad6a2c7562cef64 /libempathy-gtk/empathy-chat.c
parent09c7ee275295bcfc31c9ee76d8ef235c73821621 (diff)
downloadgsoc2013-empathy-a90f1f5cb840c43a60a5da2e5d6daa884ba8dd2c.tar
gsoc2013-empathy-a90f1f5cb840c43a60a5da2e5d6daa884ba8dd2c.tar.gz
gsoc2013-empathy-a90f1f5cb840c43a60a5da2e5d6daa884ba8dd2c.tar.bz2
gsoc2013-empathy-a90f1f5cb840c43a60a5da2e5d6daa884ba8dd2c.tar.lz
gsoc2013-empathy-a90f1f5cb840c43a60a5da2e5d6daa884ba8dd2c.tar.xz
gsoc2013-empathy-a90f1f5cb840c43a60a5da2e5d6daa884ba8dd2c.tar.zst
gsoc2013-empathy-a90f1f5cb840c43a60a5da2e5d6daa884ba8dd2c.zip
Let messages with two slashes without spaces in between pass
This makes it possible to send /unix/path (GNOME bug 589335)
Diffstat (limited to 'libempathy-gtk/empathy-chat.c')
-rw-r--r--libempathy-gtk/empathy-chat.c15
1 files changed, 12 insertions, 3 deletions
diff --git a/libempathy-gtk/empathy-chat.c b/libempathy-gtk/empathy-chat.c
index a8ca745e2..bdd2e4c17 100644
--- a/libempathy-gtk/empathy-chat.c
+++ b/libempathy-gtk/empathy-chat.c
@@ -400,9 +400,18 @@ chat_send (EmpathyChat *chat,
if (msg[0] == '/' &&
!g_str_has_prefix (msg, "/me") &&
!g_str_has_prefix (msg, "/say")) {
- empathy_chat_view_append_event (chat->view,
- _("Unsupported command"));
- return;
+ /* 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;
+ }
}
/* We can send the message */