From a90f1f5cb840c43a60a5da2e5d6daa884ba8dd2c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20P=C3=A9ters?= Date: Tue, 28 Jul 2009 10:36:47 +0200 Subject: Let messages with two slashes without spaces in between pass This makes it possible to send /unix/path (GNOME bug 589335) --- libempathy-gtk/empathy-chat.c | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) (limited to 'libempathy-gtk/empathy-chat.c') 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 */ -- cgit v1.2.3 From b22a4ae1998207e136d4e1c85e10cf159d82d8bc Mon Sep 17 00:00:00 2001 From: Guillaume Desmottes Date: Thu, 20 Aug 2009 10:49:25 +0100 Subject: empathy-chat: reformat 2 strings to allow translaters to reverse the order of the args if needed (#587803) --- libempathy-gtk/empathy-chat.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'libempathy-gtk/empathy-chat.c') diff --git a/libempathy-gtk/empathy-chat.c b/libempathy-gtk/empathy-chat.c index bdd2e4c17..9fa51fb85 100644 --- a/libempathy-gtk/empathy-chat.c +++ b/libempathy-gtk/empathy-chat.c @@ -1191,7 +1191,10 @@ build_part_message (guint reason, break; case TP_CHANNEL_GROUP_CHANGE_REASON_KICKED: if (actor_name != NULL) { - g_string_append_printf (s, _("%s was kicked by %s"), + /* translators: reverse the order of these arguments + * if the kicked should come before the kicker in your locale. + */ + g_string_append_printf (s, _("%1$s was kicked by %2$s"), name, actor_name); } else { g_string_append_printf (s, _("%s was kicked"), name); @@ -1199,7 +1202,10 @@ build_part_message (guint reason, break; case TP_CHANNEL_GROUP_CHANGE_REASON_BANNED: if (actor_name != NULL) { - g_string_append_printf (s, _("%s was banned by %s"), + /* translators: reverse the order of these arguments + * if the banned should come before the banner in your locale. + */ + g_string_append_printf (s, _("%1$s was banned by %2$s"), name, actor_name); } else { g_string_append_printf (s, _("%s was banned"), name); -- cgit v1.2.3