mirror of
https://github.com/anyproto/anytype-heart.git
synced 2025-06-08 05:47:07 +09:00
GO-5344: Rename all occurrences of databaseId to stateId
This commit is contained in:
parent
c2741a9bb7
commit
d5f6ac2de3
6 changed files with 1375 additions and 1375 deletions
|
@ -298,16 +298,16 @@ func (s *service) Unsubscribe(chatObjectId string, subId string) error {
|
|||
}
|
||||
|
||||
type ReadMessagesRequest struct {
|
||||
ChatObjectId string
|
||||
AfterOrderId string
|
||||
BeforeOrderId string
|
||||
LastDatabaseId string
|
||||
CounterType chatobject.CounterType
|
||||
ChatObjectId string
|
||||
AfterOrderId string
|
||||
BeforeOrderId string
|
||||
LastStateId string
|
||||
CounterType chatobject.CounterType
|
||||
}
|
||||
|
||||
func (s *service) ReadMessages(ctx context.Context, req ReadMessagesRequest) error {
|
||||
return cache.Do(s.objectGetter, req.ChatObjectId, func(sb chatobject.StoreObject) error {
|
||||
return sb.MarkReadMessages(ctx, req.AfterOrderId, req.BeforeOrderId, req.LastDatabaseId, req.CounterType)
|
||||
return sb.MarkReadMessages(ctx, req.AfterOrderId, req.BeforeOrderId, req.LastStateId, req.CounterType)
|
||||
})
|
||||
}
|
||||
|
||||
|
|
|
@ -47,7 +47,7 @@ type StoreObject interface {
|
|||
ToggleMessageReaction(ctx context.Context, messageId string, emoji string) error
|
||||
DeleteMessage(ctx context.Context, messageId string) error
|
||||
SubscribeLastMessages(ctx context.Context, subId string, limit int, asyncInit bool) (*SubscribeLastMessagesResponse, error)
|
||||
MarkReadMessages(ctx context.Context, afterOrderId string, beforeOrderId string, lastDatabaseId string, counterType CounterType) error
|
||||
MarkReadMessages(ctx context.Context, afterOrderId string, beforeOrderId string, lastStateId string, counterType CounterType) error
|
||||
MarkMessagesAsUnread(ctx context.Context, afterOrderId string, counterType CounterType) error
|
||||
Unsubscribe(subId string) error
|
||||
}
|
||||
|
|
|
@ -195,11 +195,11 @@ func (mw *Middleware) ChatUnsubscribeFromMessagePreviews(cctx context.Context, r
|
|||
func (mw *Middleware) ChatReadMessages(cctx context.Context, request *pb.RpcChatReadMessagesRequest) *pb.RpcChatReadMessagesResponse {
|
||||
chatService := mustService[chats.Service](mw)
|
||||
err := chatService.ReadMessages(cctx, chats.ReadMessagesRequest{
|
||||
ChatObjectId: request.ChatObjectId,
|
||||
AfterOrderId: request.AfterOrderId,
|
||||
BeforeOrderId: request.BeforeOrderId,
|
||||
LastDatabaseId: request.LastDatabaseId,
|
||||
CounterType: chatobject.CounterType(request.Type),
|
||||
ChatObjectId: request.ChatObjectId,
|
||||
AfterOrderId: request.AfterOrderId,
|
||||
BeforeOrderId: request.BeforeOrderId,
|
||||
LastStateId: request.LastStateId,
|
||||
CounterType: chatobject.CounterType(request.Type),
|
||||
})
|
||||
if err != nil {
|
||||
code := mapErrorCode(err,
|
||||
|
|
|
@ -10860,7 +10860,7 @@ Get marks list in the selected range in text block.
|
|||
| chatObjectId | [string](#string) | | id of the chat object |
|
||||
| afterOrderId | [string](#string) | | read from this orderId; if empty - read from the beginning of the chat |
|
||||
| beforeOrderId | [string](#string) | | read til this orderId |
|
||||
| lastDatabaseId | [string](#string) | | databaseId from the last processed ChatState event(or GetMessages). Used to prevent race conditions |
|
||||
| lastStateId | [string](#string) | | stateId from the last processed ChatState event(or GetMessages). Used to prevent race conditions |
|
||||
|
||||
|
||||
|
||||
|
|
2722
pb/commands.pb.go
2722
pb/commands.pb.go
File diff suppressed because it is too large
Load diff
|
@ -8321,7 +8321,7 @@ message Rpc {
|
|||
string chatObjectId = 2; // id of the chat object
|
||||
string afterOrderId = 3; // read from this orderId; if empty - read from the beginning of the chat
|
||||
string beforeOrderId = 4; // read til this orderId
|
||||
string lastDatabaseId = 5; // databaseId from the last processed ChatState event(or GetMessages). Used to prevent race conditions
|
||||
string lastStateId = 5; // stateId from the last processed ChatState event(or GetMessages). Used to prevent race conditions
|
||||
}
|
||||
|
||||
message Response {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue