From: Holger Weiss Date: Wed, 26 Sep 2018 19:00:52 +0000 (+0200) Subject: mod_avatar: Reduce log level for too large avatars X-Git-Tag: 18.12~93 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=e3a03394c71cb95da2f08d120a7cc640463501c9;p=ejabberd mod_avatar: Reduce log level for too large avatars Log a warning rather than an error when publishing an avatar fails due to its size exceeding the ?MAX_PAYLOAD_SIZE for PubSub items. --- diff --git a/src/mod_avatar.erl b/src/mod_avatar.erl index cab74bd8b..d5f24e75d 100644 --- a/src/mod_avatar.erl +++ b/src/mod_avatar.erl @@ -302,6 +302,10 @@ publish_avatar(#iq{from = JID} = IQ, Meta, MimeType, Data, ItemID) -> [jid:encode(JID), StanzaErr]), {stop, StanzaErr} end; + {error, #stanza_error{reason = 'not-acceptable'} = StanzaErr} -> + ?WARNING_MSG("Failed to publish avatar data for ~s: ~p", + [jid:encode(JID), StanzaErr]), + {stop, StanzaErr}; {error, StanzaErr} -> ?ERROR_MSG("Failed to publish avatar data for ~s: ~p", [jid:encode(JID), StanzaErr]),