]> granicus.if.org Git - ejabberd/commitdiff
Process messages of unknown type consistently
authorHolger Weiss <holger@zedat.fu-berlin.de>
Sun, 24 Apr 2016 23:13:41 +0000 (01:13 +0200)
committerHolger Weiss <holger@zedat.fu-berlin.de>
Sun, 24 Apr 2016 23:13:41 +0000 (01:13 +0200)
If an incoming message sent to an unavailable resource has an unknown
type, handle it like messages of type "normal" (as mandated by RFC 6121,
section 5.2.2).  The same is already done for messages of unknown type
sent to the bare JID of an offline user.

src/ejabberd_sm.erl

index 9a93e6d97b3e6fc983ddca6e6ab44ffc499f01a6..1fb26a6a958d9a6c0ade9d7b11bfdf085ca751ad 100644 (file)
@@ -518,16 +518,16 @@ do_route(From, To, #xmlel{} = Packet) ->
                  <<"message">> ->
                      case fxml:get_attr_s(<<"type">>, Attrs) of
                        <<"chat">> -> route_message(From, To, Packet, chat);
-                       <<"normal">> -> route_message(From, To, Packet, normal);
-                       <<"">> -> route_message(From, To, Packet, normal);
                        <<"headline">> -> ok;
                        <<"error">> -> ok;
-                       _ ->
+                       <<"groupchat">> ->
                            ErrTxt = <<"User session not found">>,
                            Err = jlib:make_error_reply(
                                    Packet,
                                    ?ERRT_SERVICE_UNAVAILABLE(Lang, ErrTxt)),
-                           ejabberd_router:route(To, From, Err)
+                           ejabberd_router:route(To, From, Err);
+                       _ ->
+                           route_message(From, To, Packet, normal)
                      end;
                  <<"iq">> ->
                      case fxml:get_attr_s(<<"type">>, Attrs) of