Ignore expireTimer on session reset messages

This commit is contained in:
lilia 2016-10-05 22:32:40 +09:00
parent 4ee2652367
commit d3a2f5c838

View file

@ -394,15 +394,18 @@
} else if (dataMessage.expireTimer) { } else if (dataMessage.expireTimer) {
message.set({expireTimer: dataMessage.expireTimer}); message.set({expireTimer: dataMessage.expireTimer});
} }
if (dataMessage.expireTimer) {
if (dataMessage.expireTimer !== conversation.get('expireTimer')) { if (!message.isEndSession()) {
conversation.addExpirationTimerUpdate( if (dataMessage.expireTimer) {
dataMessage.expireTimer, source, if (dataMessage.expireTimer !== conversation.get('expireTimer')) {
message.get('received_at')); conversation.addExpirationTimerUpdate(
dataMessage.expireTimer, source,
message.get('received_at'));
}
} else if (conversation.get('expireTimer')) {
conversation.addExpirationTimerUpdate(0, source,
message.get('received_at'));
} }
} else if (conversation.get('expireTimer')) {
conversation.addExpirationTimerUpdate(0, source,
message.get('received_at'));
} }
var conversation_timestamp = conversation.get('timestamp'); var conversation_timestamp = conversation.get('timestamp');