[Pidgin] #8169: [patch] Show command that triggered the 'Unknown command' error

Pidgin trac at pidgin.im
Sun Jan 18 23:28:03 EST 2009


#8169: [patch] Show command that triggered the 'Unknown command' error
-------------------+--------------------------------------------------------
Reporter:  koider  |        Type:  patch       
  Status:  new     |   Component:  pidgin (gtk)
 Version:  2.5.4   |    Keywords:              
-------------------+--------------------------------------------------------
 Hello,

 this has annoyed me for some time: I often type a long message that starts
 with a '/' (like a path followed by some comments), of course the message
 isn't a command so I receive the 'Unknown command' error.
 This is expected, but I'd rather not type my message again...

 So, here's a simple patch that changes 'Unknown command.' to "Unknown
 command: command that failed"
 That way it can easily be pasted.


 {{{
 --- pidgin/gtkconv.c    2008-07-01 20:46:19.000000000 -0400
 +++ pidgin/gtkconv.c-new        2009-01-18 21:51:28.000000000 -0500
 @@ -475,6 +475,7 @@
                                         if ((prpl_info != NULL) &&
 (prpl_info->options & OPT_PROTO_SLASH_COMMANDS_NATIVE)) {
                                                 char *firstspace;
                                                 char *slash;
 +                                               char *buf;

                                                 firstspace =
 strchr(cmdline, ' ');
                                                 if (firstspace != NULL) {
 @@ -484,7 +485,9 @@
                                                 }

                                                 if (slash == NULL) {
 -
 purple_conversation_write(conv, "", _("Unknown command."),
 PURPLE_MESSAGE_NO_LOG, time(NULL));
 +                                                       buf =
 g_strdup_printf("Unknown command: %s", cmd);
 +
 purple_conversation_write(conv, "", buf, PURPLE_MESSAGE_NO_LOG,
 time(NULL));
 +                                                       g_free(buf);
                                                         retval = TRUE;
                                                 }
                                         }
 }}}

-- 
Ticket URL: <http://developer.pidgin.im/ticket/8169>
Pidgin <http://pidgin.im>
Pidgin


More information about the Tracker mailing list