changeset 1020:60c94b697f61

Show in /info when the contact has an annotation
author Mikael Berthe <mikael@lilotux.net>
date Wed, 15 Nov 2006 22:36:35 +0100
parents 9d5f6e0ea7b3
children 97f862e44d5d
files mcabber/src/commands.c
diffstat 1 files changed, 14 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/mcabber/src/commands.c	Wed Nov 15 22:24:20 2006 +0100
+++ b/mcabber/src/commands.c	Wed Nov 15 22:36:35 2006 +0100
@@ -1290,6 +1290,20 @@
                  (type == ROSTER_TYPE_SPECIAL ? "special" : "unknown"));
   }
   g_free(buffer);
+
+  // Tell the user if this item has an annotation.
+  if (type == ROSTER_TYPE_USER ||
+      type == ROSTER_TYPE_ROOM ||
+      type == ROSTER_TYPE_AGENT) {
+    struct annotation *note = jb_get_storage_rosternotes(jid);
+    if (note) {
+      // We do not display the note, we just tell the user.
+      g_free(note->text);
+      g_free(note);
+      scr_WriteIncomingMessage(jid, "(This item has an annotation)", 0,
+                               HBB_PREFIX_INFO);
+    }
+  }
 }
 
 // room_names() is a variation of do_info(), for chatrooms only