Skip to content

Commit

Permalink
bridge: remove spurious Msgfs
Browse files Browse the repository at this point in the history
Signed-off-by: Sumner Evans <sumner@beeper.com>
  • Loading branch information
sumnerevans committed Dec 30, 2023
1 parent 07ee267 commit fe5cbda
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,6 @@ repos:
- id: go-vet-repo-mod

- repo: https://github.com/beeper/pre-commit-go
rev: v0.2.1
rev: v0.2.2
hooks:
- id: zerolog-ban-msgf
8 changes: 4 additions & 4 deletions bridge/commands/event.go
Original file line number Diff line number Diff line change
Expand Up @@ -69,30 +69,30 @@ func (ce *Event) ReplyAdvanced(msg string, allowMarkdown, allowHTML bool) {
content.MsgType = event.MsgNotice
_, err := ce.MainIntent().SendMessageEvent(context.Background(), ce.RoomID, event.EventMessage, content)
if err != nil {
ce.ZLog.Error().Err(err).Msgf("Failed to reply to command")
ce.ZLog.Error().Err(err).Msg("Failed to reply to command")
}
}

// React sends a reaction to the command.
func (ce *Event) React(key string) {
_, err := ce.MainIntent().SendReaction(context.Background(), ce.RoomID, ce.EventID, key)
if err != nil {
ce.ZLog.Error().Err(err).Msgf("Failed to react to command")
ce.ZLog.Error().Err(err).Msg("Failed to react to command")
}
}

// Redact redacts the command.
func (ce *Event) Redact(req ...mautrix.ReqRedact) {
_, err := ce.MainIntent().RedactEvent(context.Background(), ce.RoomID, ce.EventID, req...)
if err != nil {
ce.ZLog.Error().Err(err).Msgf("Failed to redact command")
ce.ZLog.Error().Err(err).Msg("Failed to redact command")
}
}

// MarkRead marks the command event as read.
func (ce *Event) MarkRead() {
err := ce.MainIntent().SendReceipt(context.Background(), ce.RoomID, ce.EventID, event.ReceiptTypeRead, nil)
if err != nil {
ce.ZLog.Error().Err(err).Msgf("Failed to mark command as read")
ce.ZLog.Error().Err(err).Msg("Failed to mark command as read")
}
}

0 comments on commit fe5cbda

Please sign in to comment.