]> granicus.if.org Git - ejabberd/commitdiff
Don't add body element to MUC subject messages
authorHolger Weiss <holger@zedat.fu-berlin.de>
Thu, 4 Jun 2015 07:55:38 +0000 (09:55 +0200)
committerHolger Weiss <holger@zedat.fu-berlin.de>
Thu, 4 Jun 2015 07:55:38 +0000 (09:55 +0200)
src/mod_muc_room.erl

index c52b4e320d540e120e38b3405dc3b5e789769de3..f28fe00413d3a7ac5e195f2c32ccc96e026b573a 100644 (file)
@@ -1883,7 +1883,7 @@ add_new_user(From, Nick,
                Shift = count_stanza_shift(Nick, Els, NewState),
                case send_history(From, Shift, NewState) of
                  true -> ok;
-                 _ -> send_subject(From, Lang, StateData)
+                 _ -> send_subject(From, StateData)
                end,
                case NewState#state.just_created of
                  true -> NewState#state{just_created = false};
@@ -2502,25 +2502,15 @@ send_history(JID, Shift, StateData) ->
                lists:nthtail(Shift,
                              lqueue_to_list(StateData#state.history))).
 
-send_subject(JID, Lang, StateData) ->
-    case StateData#state.subject_author of
-      <<"">> -> ok;
-      Nick ->
-         Subject = StateData#state.subject,
-         Packet = #xmlel{name = <<"message">>,
-                         attrs = [{<<"type">>, <<"groupchat">>}],
-                         children =
-                             [#xmlel{name = <<"subject">>, attrs = [],
-                                     children = [{xmlcdata, Subject}]},
-                              #xmlel{name = <<"body">>, attrs = [],
-                                     children =
-                                         [{xmlcdata,
-                                           <<Nick/binary,
-                                             (translate:translate(Lang,
-                                                                  <<" has set the subject to: ">>))/binary,
-                                             Subject/binary>>}]}]},
-         ejabberd_router:route(StateData#state.jid, JID, Packet)
-    end.
+send_subject(_JID, #state{subject_author = <<"">>}) -> ok;
+send_subject(JID, StateData) ->
+    Subject = StateData#state.subject,
+    Packet = #xmlel{name = <<"message">>,
+                   attrs = [{<<"type">>, <<"groupchat">>}],
+                   children =
+                       [#xmlel{name = <<"subject">>, attrs = [],
+                               children = [{xmlcdata, Subject}]}]},
+    ejabberd_router:route(StateData#state.jid, JID, Packet).
 
 check_subject(Packet) ->
     case xml:get_subtag(Packet, <<"subject">>) of