comparison mcabber/src/jabglue.c @ 819:c2d7d9dd4193

New option 'block_unsubscribed'
author Mikael Berthe <mikael@lilotux.net>
date Sat, 22 Apr 2006 10:50:54 +0200
parents 55cd45481a07
children 19c615fd071e
comparison
equal deleted inserted replaced
818:55cd45481a07 819:c2d7d9dd4193
783 783
784 jid = jidtodisp(from); 784 jid = jidtodisp(from);
785 785
786 rname = strchr(from, '/'); 786 rname = strchr(from, '/');
787 if (rname) rname++; 787 if (rname) rname++;
788 hk_message_in(jid, rname, timestamp, body, type); 788
789 // We don't call the message_in hook if 'block_unsubscribed' is true and
790 // this is a regular message from an unsubscribed user.
791 if (!settings_opt_get_int("block_unsubscribed") ||
792 (roster_getsubscription(jid) & sub_from) ||
793 (type && strcmp(type, "chat"))) {
794 hk_message_in(jid, rname, timestamp, body, type);
795 } else {
796 scr_LogPrint(LPRINT_LOGNORM, "Blocked a message from <%s>", jid);
797 }
789 g_free(jid); 798 g_free(jid);
790 } 799 }
791 800
792 static const char *defaulterrormsg(int code) 801 static const char *defaulterrormsg(int code)
793 { 802 {