diff mcabber/src/screen.c @ 848:a9161d2dc414

Introduce special buffer stuff Update roster and commands: add support for a new "special" kind of buffer. A special buffer "[status]" is automatically created at startup.
author Mikael Berthe <mikael@lilotux.net>
date Mon, 08 May 2006 23:45:58 +0200
parents 915a7f17474a
children 42c43a88d823
line wrap: on
line diff
--- a/mcabber/src/screen.c	Mon May 08 22:38:30 2006 +0200
+++ b/mcabber/src/screen.c	Mon May 08 23:45:58 2006 +0200
@@ -833,7 +833,7 @@
 // Set forceupdate to TRUE if doupdate() must be called.
 void scr_UpdateChatStatus(int forceupdate)
 {
-  unsigned short btype, isgrp, ismuc;
+  unsigned short btype, isgrp, ismuc, isspe;
   const char *fullname;
   const char *msg = NULL;
   char status;
@@ -862,10 +862,14 @@
 
   isgrp = btype & ROSTER_TYPE_GROUP;
   ismuc = btype & ROSTER_TYPE_ROOM;
+  isspe = btype  & ROSTER_TYPE_SPECIAL;
 
-  if (isgrp) {
+  if (isgrp || isspe) {
     buf_locale = from_utf8(fullname);
-    mvwprintw(chatstatusWnd, 0, 5, "Group: %s", buf_locale);
+    if (isgrp)
+      mvwprintw(chatstatusWnd, 0, 5, "Group: %s", buf_locale);
+    else
+      mvwprintw(chatstatusWnd, 0, 5, "Special buffer: %s", buf_locale);
     g_free(buf_locale);
     if (forceupdate) {
       update_panels();
@@ -985,7 +989,7 @@
   rOffset = offset;
 
   for (i=0; i<maxy && buddy; buddy = g_list_next(buddy)) {
-    unsigned short bflags, btype, ismsg, isgrp, ismuc, ishid;
+    unsigned short bflags, btype, ismsg, isgrp, ismuc, ishid, isspe;
     gchar *rline_locale;
 
     bflags = buddy_getflags(BUDDATA(buddy));
@@ -995,6 +999,7 @@
     ishid = bflags & ROSTER_FLAG_HIDE;
     isgrp = btype  & ROSTER_TYPE_GROUP;
     ismuc = btype  & ROSTER_TYPE_ROOM;
+    isspe = btype  & ROSTER_TYPE_SPECIAL;
 
     if (rOffset > 0) {
       rOffset--;
@@ -1049,6 +1054,8 @@
       else
         sep = "---";
       snprintf(rline, Roster_Width, " %c%s %s", pending, sep, name);
+    } else if (isspe) {
+      snprintf(rline, Roster_Width, " %c%s", pending, name);
     } else {
       char sepleft  = '[';
       char sepright = ']';