Mercurial > ~mikael > mcabber > hg
diff mcabber/src/hooks.c @ 1188:ef40688d87bd
Add option 'buddy_me_fulljid'
When a contacts sends "/me ", mcabber used to display "*user@server.net ",
which can take a lot of space. It now displays only "*user ", but the old
behaviour can be kept with the new option.
author | Mikael Berthe <mikael@lilotux.net> |
---|---|
date | Fri, 20 Apr 2007 18:02:38 +0200 |
parents | 9726c78a91f3 |
children | e802ec0c02d2 |
line wrap: on
line diff
--- a/mcabber/src/hooks.c Fri Apr 20 17:14:38 2007 +0200 +++ b/mcabber/src/hooks.c Fri Apr 20 18:02:38 2007 +0200 @@ -67,9 +67,16 @@ } } else { bmsg = g_strdup(msg); - if (!strncmp(msg, COMMAND_ME, strlen(COMMAND_ME))) - wmsg = mmsg = g_strdup_printf("*%s %s", bjid, msg+4); - else + if (!strncmp(msg, COMMAND_ME, strlen(COMMAND_ME))) { + gchar *shortid = g_strdup(bjid); + if (settings_opt_get_int("buddy_me_fulljid") == FALSE) { + gchar *p = strchr(shortid, '@'); // Truncate the jid + if (p) + *p = '\0'; + } + wmsg = mmsg = g_strdup_printf("*%s %s", shortid, msg+4); + g_free(shortid); + } else wmsg = (char*) msg; }