aboutsummaryrefslogtreecommitdiff
path: root/userapi/consumers/roomserver.go
diff options
context:
space:
mode:
authordevonh <devon.dmytro@gmail.com>2023-06-07 17:14:35 +0000
committerGitHub <noreply@github.com>2023-06-07 17:14:35 +0000
commit8ea1a11105ea7e66aa459537bcbef0de606147cd (patch)
tree62a539b761d078978226752c8d3ef23f1a80e677 /userapi/consumers/roomserver.go
parent7a1fd7f512ce06a472a2051ee63eae4a270eb71a (diff)
Use SenderID Type (#3105)
Diffstat (limited to 'userapi/consumers/roomserver.go')
-rw-r--r--userapi/consumers/roomserver.go6
1 files changed, 3 insertions, 3 deletions
diff --git a/userapi/consumers/roomserver.go b/userapi/consumers/roomserver.go
index c025deee..df507eb2 100644
--- a/userapi/consumers/roomserver.go
+++ b/userapi/consumers/roomserver.go
@@ -108,7 +108,7 @@ func (s *OutputRoomEventConsumer) onMessage(ctx context.Context, msgs []*nats.Ms
}
if s.cfg.Matrix.ReportStats.Enabled {
- go s.storeMessageStats(ctx, event.Type(), event.SenderID(), event.RoomID())
+ go s.storeMessageStats(ctx, event.Type(), string(event.SenderID()), event.RoomID())
}
log.WithFields(log.Fields{
@@ -664,7 +664,7 @@ func (s *OutputRoomEventConsumer) evaluatePushRules(ctx context.Context, event *
roomSize: roomSize,
}
eval := pushrules.NewRuleSetEvaluator(ec, &ruleSets.Global)
- rule, err := eval.MatchEvent(event.PDU, func(roomID, senderID string) (*spec.UserID, error) {
+ rule, err := eval.MatchEvent(event.PDU, func(roomID string, senderID spec.SenderID) (*spec.UserID, error) {
return s.rsAPI.QueryUserIDForSender(ctx, roomID, senderID)
})
if err != nil {
@@ -698,7 +698,7 @@ func (rse *ruleSetEvalContext) UserDisplayName() string { return rse.mem.Display
func (rse *ruleSetEvalContext) RoomMemberCount() (int, error) { return rse.roomSize, nil }
-func (rse *ruleSetEvalContext) HasPowerLevel(senderID, levelKey string) (bool, error) {
+func (rse *ruleSetEvalContext) HasPowerLevel(senderID spec.SenderID, levelKey string) (bool, error) {
req := &rsapi.QueryLatestEventsAndStateRequest{
RoomID: rse.roomID,
StateToFetch: []gomatrixserverlib.StateKeyTuple{