Ticket #830: otr.patch

File otr.patch, 937 bytes (added by architekt[at]coding4coffee.org, at 2011-09-09T17:40:10Z)

The patch for otr.c

  • otr.c

    === modified file 'otr.c'
     
    409409                                else
    410410                                        color=5;   /* red */
    411411
    412                                 if(newmsg[0] == ',') {
    413                                         /* could be a problem with the color code */
    414                                         /* insert a space between color spec and message */
     412                                /* keep "/me " uncolored at the beginning */
     413                                if (g_strncasecmp(newmsg, "/me ", 4) == 0) {
     414                                        if (newmsg[4] != '\0' && newmsg[4] == ',') {
     415                                                /* could be a problem with the color code */
     416                                                /* insert a space between color spec and message */
     417                                                colormsg = g_strdup_printf("/me \x03%.2d %s\x0F",
     418                                                                color, newmsg + 4);
     419                                        } else {
     420                                                colormsg = g_strdup_printf("/me \x03%.2d%s\x0F",
     421                                                                color, newmsg + 4);
     422                                        }
     423                                } else if (newmsg[0] == ',') {
    415424                                        colormsg = g_strdup_printf("\x03%.2d %s\x0F", color, newmsg);
    416425                                } else {
    417426                                        colormsg = g_strdup_printf("\x03%.2d%s\x0F", color, newmsg);