diff mcabber/src/commands.c @ 1355:9716cf8a0726

Add on_server flag Add a flag to the roster data, TRUE if the roster item is known by the server. The command /info displays a message if the item is local.
author Mikael Berthe <mikael@lilotux.net>
date Sat, 10 Nov 2007 23:15:16 +0100
parents 61a54e172010
children 7794d76ca90e
line wrap: on
line diff
--- a/mcabber/src/commands.c	Sat Nov 10 23:15:05 2007 +0100
+++ b/mcabber/src/commands.c	Sat Nov 10 23:15:16 2007 +0100
@@ -1486,7 +1486,7 @@
 {
   gpointer bud;
   const char *bjid, *name;
-  guint type;
+  guint type, on_srv;
   char *buffer;
   enum subscr esub;
 
@@ -1498,6 +1498,7 @@
   name   = buddy_getname(bud);
   type   = buddy_gettype(bud);
   esub   = buddy_getsubscription(bud);
+  on_srv = buddy_getonserverflag(bud);
 
   buffer = g_new(char, 4096);
 
@@ -1522,6 +1523,11 @@
     snprintf(buffer, 127, "Type: %s", bstr);
     scr_WriteIncomingMessage(bjid, buffer, 0, HBB_PREFIX_INFO, 0);
 
+    if (!on_srv) {
+      scr_WriteIncomingMessage(bjid, "(Local item, not on the server)",
+                               0, HBB_PREFIX_INFO, 0);
+    }
+
     if (esub == sub_both)     bstr = "both";
     else if (esub & sub_from) bstr = "from";
     else if (esub & sub_to)   bstr = "to";
@@ -1587,7 +1593,7 @@
       g_free(p_res->data);
     }
     g_slist_free(resources);
-  } else {
+  } else {  /* Item has no jid */
     if (name) scr_LogPrint(LPRINT_NORMAL, "Name: %s", name);
     scr_LogPrint(LPRINT_NORMAL, "Type: %s",
                  type == ROSTER_TYPE_GROUP ? "group" :