Implement reactions from the matrix side

This commit is contained in:
Gary Kramlich
2022-02-06 22:20:13 -06:00
parent 312018173f
commit 3efe242d70
2 changed files with 35 additions and 0 deletions

View File

@@ -29,6 +29,7 @@ func (b *Bridge) setupEvents() {
}
b.eventProcessor.On(event.EventMessage, b.matrixHandler.handleMessage)
b.eventProcessor.On(event.EventReaction, b.matrixHandler.handleReaction)
b.eventProcessor.On(event.StateMember, b.matrixHandler.handleMembership)
}
@@ -230,3 +231,14 @@ func (mh *matrixHandler) handleMembership(evt *event.Event) {
portal.handleMatrixInvite(user, evt)
}
}
func (mh *matrixHandler) handleReaction(evt *event.Event) {
if mh.ignoreEvent(evt) {
return
}
portal := mh.bridge.GetPortalByMXID(evt.RoomID)
if portal != nil {
portal.handleMatrixReaction(evt)
}
}