Merge branch 'master' of https://gitea.nxsir.cn/nanxun/IM_NEW
This commit is contained in:
@@ -52,6 +52,7 @@ namespace MessageService.Domain.Entities
|
||||
UnreadCount = unreadCount;
|
||||
ChatType = chatType;
|
||||
LastMessage = lastMessage;
|
||||
ModificationTime = DateTime.Now;
|
||||
StreamKey = ChatType == ChatType.GROUP ? StreamKeyBuilder.Group(targetId) : StreamKeyBuilder.Private(userId, targetId);
|
||||
AddDomainEvent(new ConversationCreatedDomainEvent(this));
|
||||
}
|
||||
@@ -61,18 +62,32 @@ namespace MessageService.Domain.Entities
|
||||
if (LastReadSequenceId != null)
|
||||
{
|
||||
LastReadSequenceId = LastReadSequenceId.Value;
|
||||
this.NotifyModified();
|
||||
}
|
||||
if (unreadCount != null)
|
||||
{
|
||||
UnreadCount += unreadCount.Value;
|
||||
NotifyModified();
|
||||
}
|
||||
|
||||
if (lastMsg != null)
|
||||
{
|
||||
LastMessage = lastMsg;
|
||||
NotifyModified();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 标记会话已读(清零未读数,更新最后已读消息序列号)
|
||||
/// </summary>
|
||||
public void MarkAsRead(long? lastReadSequenceId)
|
||||
{
|
||||
UnreadCount = 0;
|
||||
if (lastReadSequenceId.HasValue)
|
||||
LastReadSequenceId = lastReadSequenceId.Value;
|
||||
}
|
||||
|
||||
public void UpdateProfile(string name, string avatar)
|
||||
{
|
||||
TargetAvatar = avatar;
|
||||
|
||||
Reference in New Issue
Block a user