]> granicus.if.org Git - ejabberd/commitdiff
Don't return error for blocked MUC PMs
authorHolger Weiss <holger@zedat.fu-berlin.de>
Sun, 24 Jul 2016 18:55:11 +0000 (20:55 +0200)
committerHolger Weiss <holger@zedat.fu-berlin.de>
Sun, 24 Jul 2016 18:55:11 +0000 (20:55 +0200)
If a message stanza is blocked as per XEP-0016 or XEP-0191 and the
stanza is marked as a private MUC message, don't return an error.  This
makes sure users won't be kicked from MUC rooms when blocking other
participants.

src/ejabberd_c2s.erl

index 74ce74d62dfe26d12bdcf654e1a71441c3886fe4..0ffca7179e0de56c985ebc0b0d19018612f434c9 100644 (file)
@@ -1632,11 +1632,18 @@ handle_info({route, From, To,
                                                    <<"groupchat">> -> ok;
                                                    <<"headline">> -> ok;
                                                    _ ->
-                                                       Err =
-                                                           jlib:make_error_reply(Packet,
-                                                                                 ?ERR_SERVICE_UNAVAILABLE),
-                                                       ejabberd_router:route(To, From,
-                                                                             Err)
+                                                      case fxml:get_subtag_with_xmlns(Packet,
+                                                                                      <<"x">>,
+                                                                                      ?NS_MUC_USER)
+                                                          of
+                                                        false ->
+                                                            Err =
+                                                                jlib:make_error_reply(Packet,
+                                                                                      ?ERR_SERVICE_UNAVAILABLE),
+                                                            ejabberd_router:route(To, From,
+                                                                                  Err);
+                                                        _ -> ok
+                                                      end
                                                end,
                                                {false, Attrs, StateData}
                                       end;