|
|
|
@ -167,6 +167,9 @@
|
|
|
|
|
|
|
|
|
|
// Online status handling
|
|
|
|
|
this.set({ isOnline: lokiP2pAPI.isOnline(this.id) });
|
|
|
|
|
if (this.id === this.ourNumber) {
|
|
|
|
|
this.setFriendRequestStatus(FriendRequestStatusEnum.friends);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
this.messageSendQueue = new JobQueue();
|
|
|
|
|
|
|
|
|
@ -642,8 +645,12 @@
|
|
|
|
|
async setFriendRequestStatus(newStatus) {
|
|
|
|
|
// Ensure that the new status is a valid FriendStatusEnum value
|
|
|
|
|
if (!(newStatus in Object.values(FriendRequestStatusEnum))) return;
|
|
|
|
|
const me = textsecure.storage.user.getNumber();
|
|
|
|
|
if (me === this.id && newStatus !== FriendRequestStatusEnum.friends) return;
|
|
|
|
|
if (
|
|
|
|
|
this.ourNumber === this.id &&
|
|
|
|
|
newStatus !== FriendRequestStatusEnum.friends
|
|
|
|
|
) {
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
if (this.get('friendRequestStatus') !== newStatus) {
|
|
|
|
|
this.set({ friendRequestStatus: newStatus });
|
|
|
|
|
await window.Signal.Data.updateConversation(this.id, this.attributes, {
|
|
|
|
|