Skip to content

Commit

Permalink
fix: add default value for message state handling
Browse files Browse the repository at this point in the history
  • Loading branch information
trampi committed Mar 12, 2019
1 parent b02729f commit b52309a
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -75,9 +75,9 @@ export class MessageStatePlugin extends AbstractXmppPlugin {
for (const lastReadEntry of itemElement[0].getChild(wrapperNodeName).getChildren(nodeName)) {
const {lastRecipientReceived, lastRecipientSeen, lastSent, jid} = lastReadEntry.attrs;
results[jid] = {
lastRecipientSeen: new Date(+lastRecipientSeen),
lastRecipientReceived: new Date(+lastRecipientReceived),
lastSent: new Date(+lastSent),
lastRecipientSeen: new Date(+lastRecipientSeen || 0),
lastRecipientReceived: new Date(+lastRecipientReceived || 0),
lastSent: new Date(+lastSent || 0),
};
}
}
Expand Down

0 comments on commit b52309a

Please sign in to comment.