diff mcabber/src/jabglue.c @ 1484:7b36b91a4388

New UI message flag (O) when OTR is used When PGP is used, the flag is still '~'. When OTR is used (and PGP is not), the encryption flag is 'O'.
author Mikael Berthe <mikael@lilotux.net>
date Sun, 20 Apr 2008 14:30:25 +0200
parents 77afd831f8f7
children 1ae5fb9b04ca
line wrap: on
line diff
--- a/mcabber/src/jabglue.c	Sun Apr 20 11:45:01 2008 +0200
+++ b/mcabber/src/jabglue.c	Sun Apr 20 14:30:25 2008 +0200
@@ -641,9 +641,8 @@
         return;
       }
     }
-    if (otr_msg && encrypted) {
-      *encrypted = 1;
-    }
+    if (otr_msg && encrypted)
+      *encrypted = ENCRYPTED_OTR;
   }
 #endif
 
@@ -693,7 +692,7 @@
     xmlnode_put_attrib(y, "xmlns", NS_ENCRYPTED);
     xmlnode_insert_cdata(y, enc, (unsigned) -1);
     if (encrypted)
-      *encrypted = 1;
+      *encrypted = ENCRYPTED_PGP;
     g_free(enc);
   }
 
@@ -1841,6 +1840,15 @@
       (type && strcmp(type, "chat")) ||
       ((s = settings_opt_get("server")) != NULL && !strcasecmp(bjid, s))) {
     gchar *fullbody = NULL;
+    guint encrypted;
+
+    if (decrypted_pgp)
+      encrypted = ENCRYPTED_PGP;
+    else if (otr_msg)
+      encrypted = ENCRYPTED_OTR;
+    else
+      encrypted = 0;
+
     if (subject) {
       if (body)
         fullbody = g_strdup_printf("[%s]\n%s", subject, body);
@@ -1848,8 +1856,7 @@
         fullbody = g_strdup_printf("[%s]\n", subject);
       body = fullbody;
     }
-    hk_message_in(bjid, rname, timestamp, body, type,
-                  ((decrypted_pgp || otr_msg) ? TRUE : FALSE));
+    hk_message_in(bjid, rname, timestamp, body, type, encrypted);
     g_free(fullbody);
   } else {
     scr_LogPrint(LPRINT_LOGNORM, "Blocked a message from <%s>", bjid);