/
githubmirror
/
client
Обзор
Документация
Войти
/
githubmirror
/
client
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
master
go/chat/commands/hide.go
50 строк
1 KB
zoom-ua
gofumpt (#28710)
17 дек 2025, 17:16
Не верифицирован
17 дек 2025, 17:16
cda510b
Код
Авторство
О чём код?
package commands import ( "context" "github.com/keybase/client/go/chat/globals" "github.com/keybase/client/go/protocol/chat1" "github.com/keybase/client/go/protocol/gregor1" ) type Hide struct { *baseCommand } func NewHide(g *globals.Context) *Hide { return &Hide{ baseCommand: newBaseCommand(g, "hide", "[conversation]", "Hides [conversation] or the current one", false), } } func (h *Hide) Execute(ctx context.Context, uid gregor1.UID, inConvID chat1.ConversationID, tlfName, text string, replyTo *chat1.MessageID, ) (err error) { defer h.Trace(ctx, &err, "Execute")() if !h.Match(ctx, text) { return ErrInvalidCommand } var convID chat1.ConversationID toks, err := h.tokenize(text, 1) if err != nil { return err } if len(toks) == 1 { convID = inConvID } else if len(toks) == 2 { conv, err := getConvByName(ctx, h.G(), uid, toks[1]) if err != nil { return err } convID = conv.GetConvID() } else { return ErrInvalidArguments } if err = h.G().InboxSource.RemoteSetConversationStatus(ctx, uid, convID, chat1.ConversationStatus_IGNORED); err != nil { return err } return nil }