Mercurial > prosody-hg
comparison plugins/muc/muc.lib.lua @ 8519:e7808f8d7d11
MUC: Prevent traceback in case of no history items to serialize (fixes #1083)
| author | Kim Alvefur <zash@zash.se> |
|---|---|
| date | Thu, 15 Feb 2018 02:54:52 +0100 |
| parents | c50101b527bf |
| children | f1a46eef9df1 |
comparison
equal
deleted
inserted
replaced
| 8518:0de0018bdf91 | 8519:e7808f8d7d11 |
|---|---|
| 1376 for jid, presence in occupant:each_session() do | 1376 for jid, presence in occupant:each_session() do |
| 1377 state[jid] = st.preserialize(presence); | 1377 state[jid] = st.preserialize(presence); |
| 1378 end | 1378 end |
| 1379 end | 1379 end |
| 1380 local history = self._history; | 1380 local history = self._history; |
| 1381 if history then | 1381 if history and history[1] ~= nil then |
| 1382 state._last_message = st.preserialize(history[#history].stanza); | 1382 state._last_message = st.preserialize(history[#history].stanza); |
| 1383 state._last_message_at = history[#history].timestamp; | 1383 state._last_message_at = history[#history].timestamp; |
| 1384 end | 1384 end |
| 1385 end | 1385 end |
| 1386 return frozen, state; | 1386 return frozen, state; |
