mirror of
https://github.com/Govor-team/Govor.git
synced 2026-07-21 11:44:56 +00:00
fix bugs
This commit is contained in:
@@ -50,9 +50,9 @@ public class ChatNotificationService : IChatNotificationService
|
||||
var privateChat = await _privateChatsRepository.GetByIdAsync(message.RecipientId);
|
||||
|
||||
var text = message.EncryptedContent.Substring(0, Math.Min(40, message.EncryptedContent.Length));
|
||||
var userId = message.SenderId == privateChat.UserAId ? privateChat.UserAId : privateChat.UserBId;
|
||||
var userId = message.SenderId == privateChat.UserAId ? privateChat.UserBId : privateChat.UserAId;
|
||||
|
||||
var profile = await _profileService.GetUserProfileAsync(userId);
|
||||
var profile = await _profileService.GetUserProfileAsync(message.SenderId);
|
||||
var title = profile.Username;
|
||||
|
||||
await _notificationService.SendToUserAsync(userId, title,text, "chat_messages");
|
||||
|
||||
@@ -39,15 +39,15 @@ public class FirebasePushProvider : IPushNotificationProvider
|
||||
Notification = new Notification
|
||||
{
|
||||
Title = message.Title,
|
||||
Body = message.Body
|
||||
Body = message.Body,
|
||||
},
|
||||
Data = message.Data,
|
||||
Android = message.ChannelId != null ? new AndroidConfig
|
||||
{
|
||||
Priority = Priority.High,
|
||||
Notification = new AndroidNotification
|
||||
{
|
||||
ChannelId = message.ChannelId,
|
||||
Priority = NotificationPriority.HIGH
|
||||
ChannelId = message.ChannelId ?? "chat_messages"
|
||||
}
|
||||
} : null
|
||||
};
|
||||
@@ -82,7 +82,11 @@ public class FirebasePushProvider : IPushNotificationProvider
|
||||
{
|
||||
var msg = new Message
|
||||
{
|
||||
Notification = new Notification { Title = pm.Title, Body = pm.Body },
|
||||
Notification = new Notification
|
||||
{
|
||||
Title = pm.Title,
|
||||
Body = pm.Body
|
||||
},
|
||||
Data = pm.Data,
|
||||
Token = token
|
||||
};
|
||||
@@ -91,6 +95,7 @@ public class FirebasePushProvider : IPushNotificationProvider
|
||||
{
|
||||
msg.Android = new AndroidConfig
|
||||
{
|
||||
Priority = Priority.High,
|
||||
Notification = new AndroidNotification { ChannelId = pm.ChannelId }
|
||||
};
|
||||
}
|
||||
|
||||
@@ -73,6 +73,7 @@ public class PushTokenRepository : IPushTokenRepository
|
||||
existing.Provider = provider;
|
||||
existing.UpdatedAt = DateTime.UtcNow;
|
||||
existing.LastUsedAt = DateTime.UtcNow;
|
||||
existing.Token = token;
|
||||
existing.IsActive = true;
|
||||
|
||||
_context.UserPushTokens.Update(existing);
|
||||
|
||||
Reference in New Issue
Block a user