MUC: Restore last message from state, not room config (missing change from cbb05b454c13)
authorKim Alvefur <zash@zash.se>
Sat, 30 Apr 2016 17:25:06 +0200
changeset 7419 c33a1d6da016
parent 7418 cbb05b454c13
child 7420 4c8ee8175f5e
MUC: Restore last message from state, not room config (missing change from cbb05b454c13)
plugins/muc/muc.lib.lua
--- a/plugins/muc/muc.lib.lua	Fri Apr 29 17:04:05 2016 +0200
+++ b/plugins/muc/muc.lib.lua	Sat Apr 30 17:25:06 2016 +0200
@@ -1343,10 +1343,10 @@
 	local room_jid = frozen._jid;
 	local room = _M.new_room(room_jid, frozen._data);
 
-	if frozen._last_message and frozen._last_message_at then
+	if state and state._last_message and state._last_message_at then
 		room._history = {
-			{ stanza = st.deserialize(frozen._last_message),
-			  timestamp = frozen._last_message_at, },
+			{ stanza = st.deserialize(state._last_message),
+			  timestamp = state._last_message_at, },
 		};
 	end