Show incomplete subscriptions in the roster
authorMikael Berthe <mikael@lilotux.net>
Tue, 25 Apr 2006 07:13:43 +0200
changeset 824 37ef269330f0
parent 823 19c615fd071e
child 825 3ecfaa6111e2
Show incomplete subscriptions in the roster When the "from" subscription is missing, curly braces are used. When the "to" subscription is missing, the status is replaced by '?'. Thanks to pmw for the suggestion.
mcabber/src/screen.c
--- a/mcabber/src/screen.c	Tue Apr 25 07:05:50 2006 +0200
+++ b/mcabber/src/screen.c	Tue Apr 25 07:13:43 2006 +0200
@@ -1050,7 +1050,20 @@
         sep = "---";
       snprintf(rline, Roster_Width, " %c%s %s", pending, sep, name);
     } else {
-      snprintf(rline, Roster_Width, " %c[%c] %s", pending, status, name);
+      char sepleft  = '[';
+      char sepright = ']';
+      if (btype & ROSTER_TYPE_USER) {
+        guint subtype = buddy_getsubscription(BUDDATA(buddy));
+        if (!(subtype & sub_to))
+          status = '?';
+        if (!(subtype & sub_from)) {
+          sepleft  = '{';
+          sepright = '}';
+        }
+      }
+
+      snprintf(rline, Roster_Width,
+               " %c%c%c%c %s", pending, sepleft, status, sepright, name);
     }
 
     rline_locale = from_utf8(rline);