Skip to content

Commit

Permalink
Update whatsmeow
Browse files Browse the repository at this point in the history
  • Loading branch information
tulir committed Dec 13, 2023
1 parent 3e29c51 commit b752bb9
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 11 deletions.
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ require (
github.com/tidwall/gjson v1.17.0
go.mau.fi/util v0.2.1
go.mau.fi/webp v0.1.0
go.mau.fi/whatsmeow v0.0.0-20231127175850-3c97433b4676
go.mau.fi/whatsmeow v0.0.0-20231213182926-f17761e0fe8d
golang.org/x/exp v0.0.0-20231110203233-9a3e6036ecaa
golang.org/x/image v0.14.0
golang.org/x/net v0.19.0
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -68,8 +68,8 @@ go.mau.fi/util v0.2.1 h1:eazulhFE/UmjOFtPrGg6zkF5YfAyiDzQb8ihLMbsPWw=
go.mau.fi/util v0.2.1/go.mod h1:MjlzCQEMzJ+G8RsPawHzpLB8rwTo3aPIjG5FzBvQT/c=
go.mau.fi/webp v0.1.0 h1:BHObH/DcFntT9KYun5pDr0Ot4eUZO8k2C7eP7vF4ueA=
go.mau.fi/webp v0.1.0/go.mod h1:e42Z+VMFrUMS9cpEwGRIor+lQWO8oUAyPyMtcL+NMt8=
go.mau.fi/whatsmeow v0.0.0-20231127175850-3c97433b4676 h1:YaFOVOdFJCSSByUT6WSgh65ChcVEDZN4QD7OTwaMw+k=
go.mau.fi/whatsmeow v0.0.0-20231127175850-3c97433b4676/go.mod h1:5xTtHNaZpGni6z6aE1iEopjW7wNgsKcolZxZrOujK9M=
go.mau.fi/whatsmeow v0.0.0-20231213182926-f17761e0fe8d h1:ERk1aBRvcEC1fLb2HXDCb6UFvFHtuOSyRzFee9BxII4=
go.mau.fi/whatsmeow v0.0.0-20231213182926-f17761e0fe8d/go.mod h1:5xTtHNaZpGni6z6aE1iEopjW7wNgsKcolZxZrOujK9M=
go.mau.fi/zeroconfig v0.1.2 h1:DKOydWnhPMn65GbXZOafgkPm11BvFashZWLct0dGFto=
go.mau.fi/zeroconfig v0.1.2/go.mod h1:NcSJkf180JT+1IId76PcMuLTNa1CzsFFZ0nBygIQM70=
golang.org/x/crypto v0.16.0 h1:mMMrFzRSCF0GvB7Ne27XVtVAaXLrPmgPC7/v0tkwHaY=
Expand Down
10 changes: 3 additions & 7 deletions portal.go
Original file line number Diff line number Diff line change
Expand Up @@ -430,7 +430,7 @@ func (portal *Portal) handleReceipt(receipt *events.Receipt, source *User) {
// TODO handle lids
return
}
if receipt.Type == events.ReceiptTypeDelivered {
if receipt.Type == types.ReceiptTypeDelivered {
portal.handleDeliveryReceipt(receipt, source)
return
}
Expand Down Expand Up @@ -5039,9 +5039,7 @@ func (portal *Portal) HandleMatrixLeave(brSender bridge.User) {
func (portal *Portal) HandleMatrixKick(brSender bridge.User, brTarget bridge.Ghost) {
sender := brSender.(*User)
target := brTarget.(*Puppet)
_, err := sender.Client.UpdateGroupParticipants(portal.Key.JID, map[types.JID]whatsmeow.ParticipantChange{
target.JID: whatsmeow.ParticipantChangeRemove,
})
_, err := sender.Client.UpdateGroupParticipants(portal.Key.JID, []types.JID{target.JID}, whatsmeow.ParticipantChangeRemove)
if err != nil {
portal.log.Errorfln("Failed to kick %s from group as %s: %v", target.JID, sender.MXID, err)
return
Expand All @@ -5052,9 +5050,7 @@ func (portal *Portal) HandleMatrixKick(brSender bridge.User, brTarget bridge.Gho
func (portal *Portal) HandleMatrixInvite(brSender bridge.User, brTarget bridge.Ghost) {
sender := brSender.(*User)
target := brTarget.(*Puppet)
_, err := sender.Client.UpdateGroupParticipants(portal.Key.JID, map[types.JID]whatsmeow.ParticipantChange{
target.JID: whatsmeow.ParticipantChangeAdd,
})
_, err := sender.Client.UpdateGroupParticipants(portal.Key.JID, []types.JID{target.JID}, whatsmeow.ParticipantChangeAdd)
if err != nil {
portal.log.Errorfln("Failed to add %s to group as %s: %v", target.JID, sender.MXID, err)
return
Expand Down
2 changes: 1 addition & 1 deletion user.go
Original file line number Diff line number Diff line change
Expand Up @@ -1238,7 +1238,7 @@ func (user *User) handleChatPresence(presence *events.ChatPresence) {
}

func (user *User) handleReceipt(receipt *events.Receipt) {
if receipt.Type != events.ReceiptTypeRead && receipt.Type != events.ReceiptTypeReadSelf && receipt.Type != events.ReceiptTypeDelivered {
if receipt.Type != types.ReceiptTypeRead && receipt.Type != types.ReceiptTypeReadSelf && receipt.Type != types.ReceiptTypeDelivered {
return
}
portal := user.GetPortalByMessageSource(receipt.MessageSource)
Expand Down

0 comments on commit b752bb9

Please sign in to comment.