]> granicus.if.org Git - ejabberd/commitdiff
* src/mod_muc/mod_muc_room.erl: Bugfix: local message stanza may
authorBadlop <badlop@process-one.net>
Mon, 11 Feb 2008 12:15:34 +0000 (12:15 +0000)
committerBadlop <badlop@process-one.net>
Mon, 11 Feb 2008 12:15:34 +0000 (12:15 +0000)
not have an attribute From (EJAB-515)

SVN Revision: 1180

ChangeLog
src/mod_muc/mod_muc_room.erl

index acccae26952c0aad2f1b1a7335ac6cb7eda8ba47..069d49e14d958c05abdc1e9a1f4e65d05f729342 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2008-02-11  Badlop  <badlop@process-one.net>
+
+       * src/mod_muc/mod_muc_room.erl: Bugfix: local message stanza may
+       not have an attribute From (EJAB-515)
+
 2008-02-08  Badlop  <badlop@process-one.net>
 
        * src/mod_muc/mod_muc_room.erl: Include the error condition in the
index 9a36e77a7e2d2bff9c6584b11de9a1d8556d93a6..6e61180c09008aeb5e0de30b72547e5dca549139 100644 (file)
@@ -1037,7 +1037,7 @@ get_error_condition(Packet) ->
        case catch get_error_condition2(Packet) of
             {condition, ErrorCondition} ->
                ErrorCondition;
-            {'EXIT', Error} ->
+            {'EXIT', _} ->
                "badformed error stanza"
        end.
 get_error_condition2(Packet) ->
@@ -3104,7 +3104,7 @@ check_invitation(From, Els, Lang, StateData) ->
 handle_roommessage_from_nonparticipant(Packet, Lang, StateData, From) ->
     case catch check_decline_invitation(Packet) of
        {true, Decline_data} ->
-           send_decline_invitation(Decline_data, StateData#state.jid);
+           send_decline_invitation(Decline_data, StateData#state.jid, From);
        _ ->
            send_error_only_occupants(Packet, Lang, StateData#state.jid, From)
     end.
@@ -3114,18 +3114,18 @@ handle_roommessage_from_nonparticipant(Packet, Lang, StateData, From) ->
 %% This function must be catched, 
 %% because it crashes when the packet is not a decline message.
 check_decline_invitation(Packet) ->
-    {xmlelement, "message", PAttrs, _} = Packet,
+    {xmlelement, "message", _, _} = Packet,
     XEl = xml:get_subtag(Packet, "x"),
     ?NS_MUC_USER = xml:get_tag_attr_s("xmlns", XEl),
     DEl = xml:get_subtag(XEl, "decline"),
-    {value, FromString} = xml:get_attr("from", PAttrs),
     ToString = xml:get_tag_attr_s("to", DEl),
     ToJID = jlib:string_to_jid(ToString),
-    {true, {Packet, XEl, DEl, FromString, ToJID}}.
+    {true, {Packet, XEl, DEl, ToJID}}.
 
 %% Send the decline to the inviter user.
 %% The original stanza must be slightly modified.
-send_decline_invitation({Packet, XEl, DEl, FromString, ToJID}, RoomJID) ->
+send_decline_invitation({Packet, XEl, DEl, ToJID}, RoomJID, FromJID) ->
+    FromString = jlib:jid_to_string(FromJID),
     {xmlelement, "decline", DAttrs, DEls} = DEl,
     DAttrs2 = lists:keydelete("to", 1, DAttrs),
     DAttrs3 = [{"from", FromString} | DAttrs2],