Skip to content

Commit

Permalink
Remove debug logs for message hooks (#274)
Browse files Browse the repository at this point in the history
The message hooks fire every time a message is posted or updated
in Mattermost. There is a second debug line in SendChat() that
is hit when we send a message to Teams. We should only log posts
when they are sent via the second logging instance.
  • Loading branch information
gabrieljackson authored Aug 31, 2023
1 parent 6596fad commit 84cb7b4
Showing 1 changed file with 0 additions and 2 deletions.
2 changes: 0 additions & 2 deletions server/message_hooks.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ import (
)

func (p *Plugin) MessageHasBeenPosted(_ *plugin.Context, post *model.Post) {
p.API.LogDebug("Create message hook", "post", post)
if post.Props != nil {
if _, ok := post.Props["msteams_sync_"+p.userID].(bool); ok {
return
Expand Down Expand Up @@ -137,7 +136,6 @@ func (p *Plugin) ReactionHasBeenRemoved(_ *plugin.Context, reaction *model.React
}

func (p *Plugin) MessageHasBeenUpdated(_ *plugin.Context, newPost, oldPost *model.Post) {
p.API.LogDebug("Updating message hook", "newPost", newPost, "oldPost", oldPost)
client, err := p.GetClientForUser(newPost.UserId)
if err != nil {
return
Expand Down

0 comments on commit 84cb7b4

Please sign in to comment.