]> granicus.if.org Git - ejabberd/commitdiff
Return error when blocking last activity request
authorHolger Weiss <holger@zedat.fu-berlin.de>
Mon, 25 Apr 2016 07:33:47 +0000 (09:33 +0200)
committerHolger Weiss <holger@zedat.fu-berlin.de>
Mon, 25 Apr 2016 07:33:47 +0000 (09:33 +0200)
As per XEP-0016 and XEP-0191, return a service-unavailable error when an
incoming last activity query was blocked by a privacy list (just as we
do for other IQ requests).

src/ejabberd_c2s.erl

index e75cb0abd108e37be3279965a9bad7b3bd8c4c7a..10657c45da8f17c687a988379bd1144acbeca4a3 100644 (file)
@@ -1563,6 +1563,12 @@ handle_info({route, From, To,
                                                         {true, Attrs,
                                                          StateData};
                                                     deny ->
+                                                        Err =
+                                                            jlib:make_error_reply(Packet,
+                                                                                  ?ERR_SERVICE_UNAVAILABLE),
+                                                        ejabberd_router:route(To,
+                                                                              From,
+                                                                              Err),
                                                         {false, Attrs,
                                                          StateData}
                                                   end;