]> granicus.if.org Git - ejabberd/commitdiff
When occupant changes nick, include status 110 in stanzas sent to him
authorBadlop <badlop@process-one.net>
Fri, 14 Feb 2014 15:22:14 +0000 (16:22 +0100)
committerBadlop <badlop@process-one.net>
Fri, 14 Feb 2014 15:22:14 +0000 (16:22 +0100)
src/mod_muc_room.erl

index b1c5c92ff354b36a4f7e68ce2e94436d359e72ee..1ef90b1eb628ca7ec359340dbefc7ced7ea1f3a7 100644 (file)
@@ -2334,6 +2334,14 @@ send_nick_changing(JID, OldNick, StateData,
                                             [{<<"affiliation">>, SAffiliation},
                                              {<<"role">>, SRole}]
                                       end,
+                         Status110 = case JID == Info#user.jid of
+                                       true ->
+                                           [#xmlel{name = <<"status">>,
+                                                   attrs = [{<<"code">>, <<"110">>}]
+                                                                      }];
+                                       false ->
+                                           []
+                                   end,
                          Packet1 = #xmlel{name = <<"presence">>,
                                           attrs =
                                               [{<<"type">>,
@@ -2356,7 +2364,7 @@ send_nick_changing(JID, OldNick, StateData,
                                                                       [{<<"code">>,
                                                                         <<"303">>}],
                                                                   children =
-                                                                      []}]}]},
+                                                                      []}|Status110]}]},
                          Packet2 = xml:append_subtags(Presence,
                                                       [#xmlel{name = <<"x">>,
                                                               attrs =
@@ -2371,7 +2379,7 @@ send_nick_changing(JID, OldNick, StateData,
                                                                               ItemAttrs2,
                                                                           children
                                                                               =
-                                                                              []}]}]),
+                                                                              []}|Status110]}]),
                          if SendOldUnavailable ->
                                 ejabberd_router:route(jlib:jid_replace_resource(StateData#state.jid,
                                                                        OldNick),