Новый протокол регистрации токенов
All checks were successful
Build rosetta-wss / build (push) Successful in 1m48s

This commit is contained in:
RoyceDa
2026-03-31 17:44:09 +02:00
parent 1e00105d87
commit d2263c6b9a
14 changed files with 391 additions and 169 deletions

View File

@@ -12,6 +12,7 @@ import im.rosetta.database.repository.UserRepository;
import im.rosetta.packet.Packet11Typeing;
import im.rosetta.packet.Packet7Read;
import im.rosetta.packet.base.PacketBaseDialog;
import im.rosetta.service.dispatch.push.PushNotifyDispatcher;
import im.rosetta.service.dispatch.runtime.PushType;
import im.rosetta.service.services.BufferService;
import im.rosetta.service.services.UserService;
@@ -32,7 +33,7 @@ public class MessageDispatcher {
private final ClientManager clientManager;
private final BufferRepository bufferRepository = new BufferRepository();
private final BufferService bufferService;
private final FirebaseDispatcher firebaseDispatcher = new FirebaseDispatcher();
private final PushNotifyDispatcher pushNotifyDispatcher = new PushNotifyDispatcher();
private final UserRepository userRepository = new UserRepository();
private final UserService userService = new UserService(userRepository);
@@ -103,7 +104,7 @@ public class MessageDispatcher {
* Если это пакет прочтения, то отправляем тихий пуш, что диалог прочитан, отправляем тому, кто читает диалог, чтобы
* клиент мог очистить пуши для этого диалога
*/
this.firebaseDispatcher.sendPushNotification(fromPublicKey, new HashMap<>(){
this.pushNotifyDispatcher.sendPush(fromPublicKey, new HashMap<>(){
{
put("type", PushType.READ);
put("dialog", toPublicKey);
@@ -114,7 +115,7 @@ public class MessageDispatcher {
/**
* Отправляем PUSH уведомление
*/
this.firebaseDispatcher.sendPushNotification(groupMembersPublicKeys, new HashMap<>(){
this.pushNotifyDispatcher.sendPush(groupMembersPublicKeys, new HashMap<>(){
{
put("type", PushType.GROUP_MESSAGE);
put("dialog", toPublicKey.replace("#group:", ""));
@@ -173,7 +174,7 @@ public class MessageDispatcher {
* Если это пакет прочтения, то отправляем тихий пуш, что диалог прочитан, отправляем тому, кто читает диалог, чтобы
* клиент мог очистить пуши для этого диалога
*/
this.firebaseDispatcher.sendPushNotification(fromPublicKey, new HashMap<>(){
this.pushNotifyDispatcher.sendPush(fromPublicKey, new HashMap<>(){
{
put("type", PushType.READ);
put("dialog", toPublicKey);
@@ -185,7 +186,7 @@ public class MessageDispatcher {
/**
* Отправляем PUSH уведомление получателю
*/
this.firebaseDispatcher.sendPushNotification(toPublicKey, new HashMap<>(){
this.pushNotifyDispatcher.sendPush(toPublicKey, new HashMap<>(){
{
put("type", PushType.PERSONAL_MESSAGE);
put("dialog", fromPublicKey);