]> granicus.if.org Git - ejabberd/commitdiff
Correct error responses of forbidden offline last activity queries
authorAndreas Köhler <andreas.koehler@1und1.de>
Fri, 5 Nov 2010 01:38:15 +0000 (02:38 +0100)
committerBadlop <badlop@process-one.net>
Wed, 10 Nov 2010 14:39:55 +0000 (15:39 +0100)
According to XEP-0012 Last Activity, the server must return iq errors
with forbidden instead of not-allowed.

Fixes problem 1 of EJAB-1158.

src/mod_last.erl
src/mod_last_odbc.erl

index c2a79fb2a0ee7ec71107b09f36208b35509397f6..d343f18e4064777fa27af84d27c8d9de7b3284f8 100644 (file)
@@ -132,11 +132,11 @@ process_sm_iq(From, To, #iq{type = Type, sub_el = SubEl} = IQ) ->
                            get_last(IQ, SubEl, User, Server);
                        deny ->
                            IQ#iq{type = error,
-                                 sub_el = [SubEl, ?ERR_NOT_ALLOWED]}
+                                 sub_el = [SubEl, ?ERR_FORBIDDEN]}
                    end;
                true ->
                    IQ#iq{type = error,
-                         sub_el = [SubEl, ?ERR_NOT_ALLOWED]}
+                         sub_el = [SubEl, ?ERR_FORBIDDEN]}
            end
     end.
 
index b22da5ffd1a97bccb3f415c178731cb4d4df705d..202508bb385f682cf3c30e7eb4cfdbd6c73d8d56 100644 (file)
@@ -124,11 +124,11 @@ process_sm_iq(From, To, #iq{type = Type, sub_el = SubEl} = IQ) ->
                            get_last(IQ, SubEl, User, Server);
                        deny ->
                            IQ#iq{type = error,
-                                 sub_el = [SubEl, ?ERR_NOT_ALLOWED]}
+                                 sub_el = [SubEl, ?ERR_FORBIDDEN]}
                    end;
                true ->
                    IQ#iq{type = error,
-                         sub_el = [SubEl, ?ERR_NOT_ALLOWED]}
+                         sub_el = [SubEl, ?ERR_FORBIDDEN]}
            end
     end.