Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add extra logging and fix return of wrong error #529

Merged
merged 1 commit into from
Mar 29, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion mm-go-irckit/server_commands.go
Original file line number Diff line number Diff line change
Expand Up @@ -418,24 +418,28 @@ func CmdPrivMsg(s Server, u *User, msg *irc.Message) error {
logger.Tracef("sending message %s to user %s", msg.Trailing, toUser.User)
// no messages when we're not logged in
if u.br == nil {
logger.Tracef("u.br was nil, ignored message")
return nil
}

if parseReactionToMsg(u, msg, toUser.User) {
logger.Trace("matched parseReactionToMsg")
return nil
}

if threadMsgUser(u, msg, toUser.User) {
logger.Trace("matched threadMsgUser")
return nil
}

if parseModifyMsg(u, msg, toUser.User) {
logger.Trace("matched parseModifyMsg")
return nil
}

msgID, err2 := u.br.MsgUser(toUser.User, msg.Trailing)
if err2 != nil {
return err
return err2
}
u.msgLastMutex.Lock()
defer u.msgLastMutex.Unlock()
Expand Down Expand Up @@ -572,6 +576,7 @@ func parseModifyMsg(u *User, msg *irc.Message, channelID string) bool {
if err != nil {
// probably a wrong id, just put it through as normally
if strings.Contains(err.Error(), "permissions") {
logger.Trace("parseModifyMsg triggered permissions error")
return false
}
u.MsgSpoofUser(u, u.br.Protocol(), "msg: "+text+" could not be modified "+err.Error())
Expand Down Expand Up @@ -664,6 +669,7 @@ func threadMsgChannelUser(u *User, msg *irc.Message, channelID string, toUser bo
}

func threadMsgChannel(u *User, msg *irc.Message, channelID string) bool {
logger.Trace("entering threadMsgChannel")
return threadMsgChannelUser(u, msg, channelID, false)
}

Expand Down