Fix NeedsRelaybot check and relaybot command handling without arguments

This commit is contained in:
Tulir Asokan
2019-11-11 22:30:59 +02:00
parent 0f4048a178
commit 691d2ea1b3
3 changed files with 7 additions and 3 deletions

View File

@ -781,5 +781,5 @@ func (user *User) HandleRawMessage(message *waProto.WebMessageInfo) {
}
func (user *User) NeedsRelaybot(portal *Portal) bool {
return !user.HasSession() || user.IsInPortal(portal.Key.JID) || portal.IsPrivateChat()
return !user.HasSession() || (user.IsInPortal(portal.Key.JID) && (!portal.IsPrivateChat() || portal.Key.Receiver == user.JID))
}