changeset 956:819396bebdf5

Do not block system messages when block_unsubscribed is set
author Mikael Berthe <mikael@lilotux.net>
date Sat, 02 Sep 2006 14:54:46 +0200
parents 6be62425dc38
children 82aaa7afbd03
files mcabber/src/jabglue.c
diffstat 1 files changed, 4 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/mcabber/src/jabglue.c	Sat Sep 02 14:54:12 2006 +0200
+++ b/mcabber/src/jabglue.c	Sat Sep 02 14:54:46 2006 +0200
@@ -822,7 +822,7 @@
                        const char *enc, time_t timestamp)
 {
   char *jid;
-  const char *rname;
+  const char *rname, *s;
 
   jid = jidtodisp(from);
 
@@ -864,9 +864,11 @@
 
   // We don't call the message_in hook if 'block_unsubscribed' is true and
   // this is a regular message from an unsubscribed user.
+  // System messages (from our server) are allowed.
   if (!settings_opt_get_int("block_unsubscribed") ||
       (roster_getsubscription(jid) & sub_from) ||
-      (type && strcmp(type, "chat"))) {
+      (type && strcmp(type, "chat")) ||
+      ((s = settings_opt_get("server")) != NULL && !strcasecmp(jid, s))) {
     hk_message_in(jid, rname, timestamp, body, type);
   } else {
     scr_LogPrint(LPRINT_LOGNORM, "Blocked a message from <%s>", jid);