Răsfoiți Sursa

Fix handling read receipts

Tulir Asokan 2 ani în urmă
părinte
comite
b826aa1bb7
1 a modificat fișierele cu 11 adăugiri și 2 ștergeri
  1. 11 2
      portal.go

+ 11 - 2
portal.go

@@ -263,6 +263,15 @@ type Portal struct {
 	relayUser *User
 }
 
+var (
+	_ bridge.Portal                    = (*Portal)(nil)
+	_ bridge.ReadReceiptHandlingPortal = (*Portal)(nil)
+	_ bridge.MembershipHandlingPortal  = (*Portal)(nil)
+	_ bridge.MetaHandlingPortal        = (*Portal)(nil)
+	_ bridge.TypingPortal              = (*Portal)(nil)
+	_ bridge.DisappearingPortal        = (*Portal)(nil)
+)
+
 func (portal *Portal) handleMessageLoopItem(msg PortalMessage) {
 	if len(portal.MXID) == 0 {
 		if msg.fake == nil && msg.undecryptable == nil && (msg.evt == nil || !containsSupportedMessage(msg.evt.Message)) {
@@ -3563,8 +3572,8 @@ func (portal *Portal) HandleMatrixRedaction(sender *User, evt *event.Event) {
 	}
 }
 
-func (portal *Portal) HandleMatrixReadReceipt(sender bridge.User, eventID id.EventID, receiptTimestamp time.Time) {
-	portal.handleMatrixReadReceipt(sender.(*User), eventID, receiptTimestamp, true)
+func (portal *Portal) HandleMatrixReadReceipt(sender bridge.User, eventID id.EventID, receipt event.ReadReceipt) {
+	portal.handleMatrixReadReceipt(sender.(*User), eventID, receipt.Timestamp, true)
 }
 
 func (portal *Portal) handleMatrixReadReceipt(sender *User, eventID id.EventID, receiptTimestamp time.Time, isExplicit bool) {