--- a/mcabber/src/commands.c Mon Apr 20 19:58:06 2009 +0200
+++ b/mcabber/src/commands.c Wed Jul 29 03:13:04 2009 +0400
@@ -1817,7 +1817,8 @@
const char *bjid;
char *buffer;
GSList *resources, *p_res;
- enum { style_normal = 0, style_detail, style_short, style_quiet } style = 0;
+ enum { style_normal = 0, style_detail, style_short,
+ style_quiet, style_compact } style = 0;
if (*arg) {
if (!strcasecmp(arg, "--short"))
@@ -1826,6 +1827,8 @@
style = style_quiet;
else if (!strcasecmp(arg, "--detail"))
style = style_detail;
+ else if (!strcasecmp(arg, "--compact"))
+ style = style_compact;
else {
scr_LogPrint(LPRINT_NORMAL, "Unrecognized parameter!");
return;
@@ -1855,7 +1858,22 @@
(char*)p_res->data,
rst_msg ? " -- " : "", rst_msg ? rst_msg : "");
scr_WriteIncomingMessage(bjid, buffer, 0, HBB_PREFIX_INFO, 0);
- } else {
+ } else if (style == style_compact) {
+ enum imrole role = buddy_getrole(bud, p_res->data);
+ enum imaffiliation affil = buddy_getaffil(bud, p_res->data);
+
+ snprintf(buffer, 4095, "[%c] %s (", imstatus2char[rstatus],
+ (char*)p_res->data);
+
+ if (affil != affil_none) {
+ strcat(buffer, straffil[affil]);
+ strcat(buffer, "/");
+ }
+ strcat(buffer, strrole[role]);
+ strcat(buffer, ")");
+
+ scr_WriteIncomingMessage(bjid, buffer, 0, HBB_PREFIX_INFO, 0);
+ } else {
// (Style "normal", "detail" or "quiet")
snprintf(buffer, 4095, "[%c] %s", imstatus2char[rstatus],
(char*)p_res->data);