comparison finch/gntconv.c @ 23363:54aaea893a89

Send '//message' as '/message', instead of looking for a 'message' command.
author Sadrul Habib Chowdhury <imadil@gmail.com>
date Sat, 14 Jun 2008 02:03:26 +0000
parents ea341703b1d3
children a2c625152c52
comparison
equal deleted inserted replaced
23362:d1eee441bf25 23363:54aaea893a89
139 139
140 static void 140 static void
141 entry_key_pressed(GntWidget *w, FinchConv *ggconv) 141 entry_key_pressed(GntWidget *w, FinchConv *ggconv)
142 { 142 {
143 const char *text = gnt_entry_get_text(GNT_ENTRY(ggconv->entry)); 143 const char *text = gnt_entry_get_text(GNT_ENTRY(ggconv->entry));
144 if (*text == '/') 144 if (*text == '/' && *(text + 1) != '/')
145 { 145 {
146 PurpleConversation *conv = ggconv->active_conv; 146 PurpleConversation *conv = ggconv->active_conv;
147 PurpleCmdStatus status; 147 PurpleCmdStatus status;
148 const char *cmdline = text + 1; 148 const char *cmdline = text + 1;
149 char *error = NULL, *escape; 149 char *error = NULL, *escape;
189 purple_conversation_write(ggconv->active_conv, "", _("Message was not sent, because you are not signed on."), 189 purple_conversation_write(ggconv->active_conv, "", _("Message was not sent, because you are not signed on."),
190 PURPLE_MESSAGE_ERROR | PURPLE_MESSAGE_NO_LOG, time(NULL)); 190 PURPLE_MESSAGE_ERROR | PURPLE_MESSAGE_NO_LOG, time(NULL));
191 } 191 }
192 else 192 else
193 { 193 {
194 char *escape = g_markup_escape_text(text, -1); 194 char *escape = g_markup_escape_text((*text == '/' ? text + 1 : text), -1);
195 char *apos = purple_strreplace(escape, "&apos;", "'"); 195 char *apos = purple_strreplace(escape, "&apos;", "'");
196 g_free(escape); 196 g_free(escape);
197 escape = apos; 197 escape = apos;
198 switch (purple_conversation_get_type(ggconv->active_conv)) 198 switch (purple_conversation_get_type(ggconv->active_conv))
199 { 199 {