Mercurial > ~mikael > mcabber > hg
comparison mcabber/src/jabglue.c @ 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 | fc30221b952d |
children | 90ff94f0fbbb |
comparison
equal
deleted
inserted
replaced
955:6be62425dc38 | 956:819396bebdf5 |
---|---|
820 | 820 |
821 static void gotmessage(char *type, const char *from, const char *body, | 821 static void gotmessage(char *type, const char *from, const char *body, |
822 const char *enc, time_t timestamp) | 822 const char *enc, time_t timestamp) |
823 { | 823 { |
824 char *jid; | 824 char *jid; |
825 const char *rname; | 825 const char *rname, *s; |
826 | 826 |
827 jid = jidtodisp(from); | 827 jid = jidtodisp(from); |
828 | 828 |
829 rname = strchr(from, '/'); | 829 rname = strchr(from, '/'); |
830 if (rname) rname++; | 830 if (rname) rname++; |
862 return; | 862 return; |
863 } | 863 } |
864 | 864 |
865 // We don't call the message_in hook if 'block_unsubscribed' is true and | 865 // We don't call the message_in hook if 'block_unsubscribed' is true and |
866 // this is a regular message from an unsubscribed user. | 866 // this is a regular message from an unsubscribed user. |
867 // System messages (from our server) are allowed. | |
867 if (!settings_opt_get_int("block_unsubscribed") || | 868 if (!settings_opt_get_int("block_unsubscribed") || |
868 (roster_getsubscription(jid) & sub_from) || | 869 (roster_getsubscription(jid) & sub_from) || |
869 (type && strcmp(type, "chat"))) { | 870 (type && strcmp(type, "chat")) || |
871 ((s = settings_opt_get("server")) != NULL && !strcasecmp(jid, s))) { | |
870 hk_message_in(jid, rname, timestamp, body, type); | 872 hk_message_in(jid, rname, timestamp, body, type); |
871 } else { | 873 } else { |
872 scr_LogPrint(LPRINT_LOGNORM, "Blocked a message from <%s>", jid); | 874 scr_LogPrint(LPRINT_LOGNORM, "Blocked a message from <%s>", jid); |
873 } | 875 } |
874 g_free(jid); | 876 g_free(jid); |