A few small bugfixes
This commit is contained in:
parent
cd9aee84f5
commit
05f905fd10
7 changed files with 52 additions and 44 deletions
|
@ -1932,26 +1932,6 @@ type WhatIsThis = typeof window.WhatIsThis;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
const hasRegisteredGV23Support = 'hasRegisteredGV23Support';
|
|
||||||
if (
|
|
||||||
!window.storage.get(hasRegisteredGV23Support) &&
|
|
||||||
window.textsecure.storage.user.getUuid()
|
|
||||||
) {
|
|
||||||
const server = window.WebAPI.connect({
|
|
||||||
username: USERNAME || OLD_USERNAME,
|
|
||||||
password: PASSWORD,
|
|
||||||
});
|
|
||||||
try {
|
|
||||||
await server.registerCapabilities({ 'gv2-3': true });
|
|
||||||
window.storage.put(hasRegisteredGV23Support, true);
|
|
||||||
} catch (error) {
|
|
||||||
window.log.error(
|
|
||||||
'Error: Unable to register support for GV2.',
|
|
||||||
error && error.stack ? error.stack : error
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
const deviceId = window.textsecure.storage.user.getDeviceId();
|
const deviceId = window.textsecure.storage.user.getDeviceId();
|
||||||
|
|
||||||
// If we didn't capture a UUID on registration, go get it from the server
|
// If we didn't capture a UUID on registration, go get it from the server
|
||||||
|
@ -1980,6 +1960,27 @@ type WhatIsThis = typeof window.WhatIsThis;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// We need to do this after fetching our UUID
|
||||||
|
const hasRegisteredGV23Support = 'hasRegisteredGV23Support';
|
||||||
|
if (
|
||||||
|
!window.storage.get(hasRegisteredGV23Support) &&
|
||||||
|
window.textsecure.storage.user.getUuid()
|
||||||
|
) {
|
||||||
|
const server = window.WebAPI.connect({
|
||||||
|
username: USERNAME || OLD_USERNAME,
|
||||||
|
password: PASSWORD,
|
||||||
|
});
|
||||||
|
try {
|
||||||
|
await server.registerCapabilities({ 'gv2-3': true });
|
||||||
|
window.storage.put(hasRegisteredGV23Support, true);
|
||||||
|
} catch (error) {
|
||||||
|
window.log.error(
|
||||||
|
'Error: Unable to register support for GV2.',
|
||||||
|
error && error.stack ? error.stack : error
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (firstRun === true && deviceId !== '1') {
|
if (firstRun === true && deviceId !== '1') {
|
||||||
const hasThemeSetting = Boolean(window.storage.get('theme-setting'));
|
const hasThemeSetting = Boolean(window.storage.get('theme-setting'));
|
||||||
if (
|
if (
|
||||||
|
|
|
@ -225,13 +225,14 @@ export class ConversationListItem extends React.PureComponent<Props> {
|
||||||
<span className="module-conversation-list-item__message__deleted-for-everyone">
|
<span className="module-conversation-list-item__message__deleted-for-everyone">
|
||||||
{i18n('message--deletedForEveryone')}
|
{i18n('message--deletedForEveryone')}
|
||||||
</span>
|
</span>
|
||||||
) : null}
|
) : (
|
||||||
<MessageBody
|
<MessageBody
|
||||||
text={text.split('\n')[0]}
|
text={text.split('\n')[0]}
|
||||||
disableJumbomoji
|
disableJumbomoji
|
||||||
disableLinks
|
disableLinks
|
||||||
i18n={i18n}
|
i18n={i18n}
|
||||||
/>
|
/>
|
||||||
|
)}
|
||||||
</>
|
</>
|
||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -2985,7 +2985,7 @@ export class ConversationModel extends window.Backbone.Model<
|
||||||
(previewMessage ? previewMessage.getMessagePropStatus() : null) || null,
|
(previewMessage ? previewMessage.getMessagePropStatus() : null) || null,
|
||||||
timestamp,
|
timestamp,
|
||||||
lastMessageDeletedForEveryone: previewMessage
|
lastMessageDeletedForEveryone: previewMessage
|
||||||
? previewMessage.deletedForEveryone
|
? previewMessage.get('deletedForEveryone')
|
||||||
: false,
|
: false,
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
|
@ -128,8 +128,6 @@ export class MessageModel extends window.Backbone.Model<MessageAttributesType> {
|
||||||
|
|
||||||
OUR_UUID?: string;
|
OUR_UUID?: string;
|
||||||
|
|
||||||
deletedForEveryone?: boolean;
|
|
||||||
|
|
||||||
isSelected?: boolean;
|
isSelected?: boolean;
|
||||||
|
|
||||||
hasExpired?: boolean;
|
hasExpired?: boolean;
|
||||||
|
@ -1076,6 +1074,12 @@ export class MessageModel extends window.Backbone.Model<MessageAttributesType> {
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (this.get('deletedForEveryone')) {
|
||||||
|
return {
|
||||||
|
text: window.i18n('message--deletedForEveryone'),
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
if (this.isProfileChange()) {
|
if (this.isProfileChange()) {
|
||||||
const change = this.get('profileChange');
|
const change = this.get('profileChange');
|
||||||
const changedId = this.get('changedId');
|
const changedId = this.get('changedId');
|
||||||
|
@ -1652,11 +1656,13 @@ export class MessageModel extends window.Backbone.Model<MessageAttributesType> {
|
||||||
}
|
}
|
||||||
|
|
||||||
getSourceDevice(): string | number | undefined {
|
getSourceDevice(): string | number | undefined {
|
||||||
|
const sourceDevice = this.get('sourceDevice');
|
||||||
|
|
||||||
if (this.isIncoming()) {
|
if (this.isIncoming()) {
|
||||||
return this.get('sourceDevice');
|
return sourceDevice;
|
||||||
}
|
}
|
||||||
|
|
||||||
return window.textsecure.storage.user.getDeviceId();
|
return sourceDevice || window.textsecure.storage.user.getDeviceId();
|
||||||
}
|
}
|
||||||
|
|
||||||
getSourceUuid(): string | undefined {
|
getSourceUuid(): string | undefined {
|
||||||
|
|
8
ts/textsecure.d.ts
vendored
8
ts/textsecure.d.ts
vendored
|
@ -1107,10 +1107,10 @@ export declare namespace SyncMessageClass {
|
||||||
}
|
}
|
||||||
|
|
||||||
class MessageRequestResponse {
|
class MessageRequestResponse {
|
||||||
threadE164?: string;
|
threadE164: string | null;
|
||||||
threadUuid?: string;
|
threadUuid: string | null;
|
||||||
groupId?: ProtoBinaryType;
|
groupId: ProtoBinaryType | null;
|
||||||
type?: number;
|
type: number | null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -55,7 +55,7 @@ declare global {
|
||||||
eventType?: string | number;
|
eventType?: string | number;
|
||||||
groupDetails?: any;
|
groupDetails?: any;
|
||||||
groupId?: string;
|
groupId?: string;
|
||||||
messageRequestResponseType?: number;
|
messageRequestResponseType?: number | null;
|
||||||
proto?: any;
|
proto?: any;
|
||||||
read?: any;
|
read?: any;
|
||||||
reason?: any;
|
reason?: any;
|
||||||
|
@ -65,8 +65,8 @@ declare global {
|
||||||
source?: any;
|
source?: any;
|
||||||
sourceUuid?: any;
|
sourceUuid?: any;
|
||||||
stickerPacks?: any;
|
stickerPacks?: any;
|
||||||
threadE164?: string;
|
threadE164?: string | null;
|
||||||
threadUuid?: string;
|
threadUuid?: string | null;
|
||||||
storageServiceKey?: ArrayBuffer;
|
storageServiceKey?: ArrayBuffer;
|
||||||
timestamp?: any;
|
timestamp?: any;
|
||||||
typing?: any;
|
typing?: any;
|
||||||
|
@ -195,9 +195,6 @@ class MessageReceiverInner extends EventTarget {
|
||||||
maxSize: 30,
|
maxSize: 30,
|
||||||
processBatch: this.cacheRemoveBatch.bind(this),
|
processBatch: this.cacheRemoveBatch.bind(this),
|
||||||
});
|
});
|
||||||
|
|
||||||
// We always process our cache before any websocket message
|
|
||||||
this.pendingQueue.add(async () => this.queueAllCached());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static stringToArrayBuffer = (string: string): ArrayBuffer =>
|
static stringToArrayBuffer = (string: string): ArrayBuffer =>
|
||||||
|
@ -217,6 +214,9 @@ class MessageReceiverInner extends EventTarget {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// We always process our cache before processing a new websocket message
|
||||||
|
this.pendingQueue.add(async () => this.queueAllCached());
|
||||||
|
|
||||||
this.count = 0;
|
this.count = 0;
|
||||||
if (this.hasConnected) {
|
if (this.hasConnected) {
|
||||||
const ev = new Event('reconnect');
|
const ev = new Event('reconnect');
|
||||||
|
|
|
@ -1232,8 +1232,8 @@ export default class MessageSender {
|
||||||
const syncMessage = this.createSyncMessage();
|
const syncMessage = this.createSyncMessage();
|
||||||
|
|
||||||
const response = new window.textsecure.protobuf.SyncMessage.MessageRequestResponse();
|
const response = new window.textsecure.protobuf.SyncMessage.MessageRequestResponse();
|
||||||
response.threadE164 = responseArgs.threadE164;
|
response.threadE164 = responseArgs.threadE164 || null;
|
||||||
response.threadUuid = responseArgs.threadUuid;
|
response.threadUuid = responseArgs.threadUuid || null;
|
||||||
response.groupId = responseArgs.groupId || null;
|
response.groupId = responseArgs.groupId || null;
|
||||||
response.type = responseArgs.type;
|
response.type = responseArgs.type;
|
||||||
syncMessage.messageRequestResponse = response;
|
syncMessage.messageRequestResponse = response;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue