Message.idForLogging: Ensure that it works for outgoing

This commit is contained in:
Scott Nonnenberg 2020-06-11 17:00:40 -07:00
parent f04812eb5d
commit b290a27173

View file

@ -967,9 +967,11 @@
// General
idForLogging() {
return `${this.get('source')}.${this.get('sourceDevice')} ${this.get(
'sent_at'
)}`;
const source = this.getSource();
const device = this.getSourceDevice();
const timestamp = this.get('sent_at');
return `${source}.${device} ${timestamp}`;
},
defaults() {
return {
@ -1161,6 +1163,13 @@
return this.OUR_NUMBER;
},
getSourceDevice() {
if (this.isIncoming()) {
return this.get('sourceDevice');
}
return window.textsecure.storage.user.getDeviceId();
},
getSourceUuid() {
if (this.isIncoming()) {
return this.get('sourceUuid');