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