-
Notifications
You must be signed in to change notification settings - Fork 186
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
22 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -587,7 +587,7 @@ private CompletableFuture<Void> mark(JidProvider chat, boolean read) { | |
var range = createRange(chat, false); | ||
var markAction = new MarkChatAsReadAction(read, Optional.of(range)); | ||
var syncAction = ActionValueSync.of(markAction); | ||
var entry = PatchEntry.of(syncAction, Operation.SET, 3, chat.toJid().toString()); | ||
var entry = PatchEntry.of(syncAction, Operation.SET, chat.toJid().toString()); | ||
var request = new PatchRequest(PatchType.REGULAR_HIGH, List.of(entry)); | ||
return socketHandler.pushPatch(request); | ||
} | ||
|
@@ -1282,7 +1282,7 @@ public CompletableFuture<Void> muteChat(JidProvider chat, ChatMute mute) { | |
var endTimeStamp = mute.type() == ChatMute.Type.MUTED_FOR_TIMEFRAME ? mute.endTimeStamp() * 1000L : mute.endTimeStamp(); | ||
var muteAction = new MuteAction(true, OptionalLong.of(endTimeStamp), false); | ||
var syncAction = ActionValueSync.of(muteAction); | ||
var entry = PatchEntry.of(syncAction, Operation.SET, 2, chat.toJid().toString()); | ||
var entry = PatchEntry.of(syncAction, Operation.SET, chat.toJid().toString()); | ||
var request = new PatchRequest(PatchType.REGULAR_HIGH, List.of(entry)); | ||
return socketHandler.pushPatch(request); | ||
} | ||
|
@@ -1303,7 +1303,7 @@ public CompletableFuture<Void> unmuteChat(JidProvider chat) { | |
|
||
var muteAction = new MuteAction(false, null, false); | ||
var syncAction = ActionValueSync.of(muteAction); | ||
var entry = PatchEntry.of(syncAction, Operation.SET, 2, chat.toJid().toString()); | ||
var entry = PatchEntry.of(syncAction, Operation.SET, chat.toJid().toString()); | ||
var request = new PatchRequest(PatchType.REGULAR_HIGH, List.of(entry)); | ||
return socketHandler.pushPatch(request); | ||
} | ||
|
@@ -1406,7 +1406,7 @@ private CompletableFuture<Void> pinChat(JidProvider chat, boolean pin) { | |
|
||
var pinAction = new PinAction(pin); | ||
var syncAction = ActionValueSync.of(pinAction); | ||
var entry = PatchEntry.of(syncAction, Operation.SET, 5, chat.toJid().toString()); | ||
var entry = PatchEntry.of(syncAction, Operation.SET, chat.toJid().toString()); | ||
var request = new PatchRequest(PatchType.REGULAR_LOW, List.of(entry)); | ||
return socketHandler.pushPatch(request); | ||
} | ||
|
@@ -1430,7 +1430,7 @@ private CompletableFuture<ChatMessageInfo> starMessage(ChatMessageInfo info, boo | |
|
||
var starAction = new StarAction(star); | ||
var syncAction = ActionValueSync.of(starAction); | ||
var entry = PatchEntry.of(syncAction, Operation.SET, 3, info.chatJid() | ||
var entry = PatchEntry.of(syncAction, Operation.SET, info.chatJid() | ||
.toString(), info.id(), fromMeToFlag(info), participantToFlag(info)); | ||
var request = new PatchRequest(PatchType.REGULAR_HIGH, List.of(entry)); | ||
return socketHandler.pushPatch(request).thenApplyAsync(ignored -> info); | ||
|
@@ -1482,7 +1482,7 @@ private CompletableFuture<Void> archiveChat(JidProvider chat, boolean archive) { | |
var range = createRange(chat, false); | ||
var archiveAction = new ArchiveChatAction(archive, Optional.of(range)); | ||
var syncAction = ActionValueSync.of(archiveAction); | ||
var entry = PatchEntry.of(syncAction, Operation.SET, 3, chat.toJid().toString()); | ||
var entry = PatchEntry.of(syncAction, Operation.SET, chat.toJid().toString()); | ||
var request = new PatchRequest(PatchType.REGULAR_LOW, List.of(entry)); | ||
return socketHandler.pushPatch(request); | ||
} | ||
|
@@ -1557,7 +1557,7 @@ public CompletableFuture<Void> deleteMessage(ChatMessageInfo messageInfo, boolea | |
var range = createRange(messageInfo.chatJid(), false); | ||
var deleteMessageAction = new DeleteMessageForMeAction(false, messageInfo.timestampSeconds().orElse(0L)); | ||
var syncAction = ActionValueSync.of(deleteMessageAction); | ||
var entry = PatchEntry.of(syncAction, Operation.SET, 3, messageInfo.chatJid().toString(), messageInfo.id(), fromMeToFlag(messageInfo), participantToFlag(messageInfo)); | ||
var entry = PatchEntry.of(syncAction, Operation.SET, messageInfo.chatJid().toString(), messageInfo.id(), fromMeToFlag(messageInfo), participantToFlag(messageInfo)); | ||
var request = new PatchRequest(PatchType.REGULAR_HIGH, List.of(entry)); | ||
yield socketHandler.pushPatch(request); | ||
} | ||
|
@@ -1608,7 +1608,7 @@ public CompletableFuture<Void> deleteChat(JidProvider chat) { | |
var range = createRange(chat.toJid(), false); | ||
var deleteChatAction = new DeleteChatAction(Optional.of(range)); | ||
var syncAction = ActionValueSync.of(deleteChatAction); | ||
var entry = PatchEntry.of(syncAction, Operation.SET, 6, chat.toJid().toString(), "1"); | ||
var entry = PatchEntry.of(syncAction, Operation.SET, chat.toJid().toString(), "1"); | ||
var request = new PatchRequest(PatchType.REGULAR_HIGH, List.of(entry)); | ||
return socketHandler.pushPatch(request); | ||
} | ||
|
@@ -1633,7 +1633,7 @@ public CompletableFuture<Void> clearChat(JidProvider chat, boolean keepStarredMe | |
var range = createRange(chat.toJid(), true); | ||
var clearChatAction = new ClearChatAction(Optional.of(range)); | ||
var syncAction = ActionValueSync.of(clearChatAction); | ||
var entry = PatchEntry.of(syncAction, Operation.SET, 6, chat.toJid().toString(), booleanToInt(keepStarredMessages), "0"); | ||
var entry = PatchEntry.of(syncAction, Operation.SET, chat.toJid().toString(), booleanToInt(keepStarredMessages), "0"); | ||
var request = new PatchRequest(PatchType.REGULAR_HIGH, List.of(entry)); | ||
return socketHandler.pushPatch(request); | ||
} | ||
|
@@ -2176,12 +2176,12 @@ private List<PatchEntry> createContactEntries() { | |
|
||
private PatchEntry createPushNameEntry() { | ||
var pushNameSetting = new PushNameSettings(store().name()); | ||
return PatchEntry.of(ActionValueSync.of(pushNameSetting), Operation.SET, 1); | ||
return PatchEntry.of(ActionValueSync.of(pushNameSetting), Operation.SET); | ||
} | ||
|
||
private PatchEntry createLocaleEntry() { | ||
var localeSetting = new LocaleSettings(store().locale().orElse("en-US")); | ||
return PatchEntry.of(ActionValueSync.of(localeSetting), Operation.SET, 3); | ||
return PatchEntry.of(ActionValueSync.of(localeSetting), Operation.SET); | ||
} | ||
|
||
private PatchEntry createAndroidEntry() { | ||
|
@@ -2202,12 +2202,12 @@ private PatchEntry createAndroidEntry() { | |
private PatchEntry createNuxRequest() { | ||
var nuxAction = new NuxAction(true); | ||
var timeFormatSync = ActionValueSync.of(nuxAction); | ||
return PatchEntry.of(timeFormatSync, Operation.SET, 7, "[email protected]"); | ||
return PatchEntry.of(timeFormatSync, Operation.SET, "[email protected]"); | ||
} | ||
|
||
private PatchEntry createPrimaryVersionEntry(PrimaryVersionAction primaryVersion, String to) { | ||
var timeFormatSync = ActionValueSync.of(primaryVersion); | ||
return PatchEntry.of(timeFormatSync, Operation.SET, 7, to); | ||
return PatchEntry.of(timeFormatSync, Operation.SET, to); | ||
} | ||
|
||
private PatchEntry createTimeFormatEntry() { | ||
|
@@ -2219,7 +2219,7 @@ private PatchEntry createTimeFormatEntry() { | |
private PatchEntry createContactRequestEntry(Contact contact) { | ||
var action = new ContactAction(null, contact.shortName(), contact.fullName()); | ||
var sync = ActionValueSync.of(action); | ||
return PatchEntry.of(sync, Operation.SET, 2, contact.jid().toString()); | ||
return PatchEntry.of(sync, Operation.SET, contact.jid().toString()); | ||
} | ||
|
||
private CompletableFuture<Void> sendRecentMessage(Jid jid) { | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters