matrix-org / matrix-appservice-irc

Node.js IRC bridge for Matrix
Apache License 2.0
465 stars 150 forks source link

Locked topics bridge incorrectly... somehow #1037

Open joepie91 opened 4 years ago

joepie91 commented 4 years ago

When a topic is locked on Freenode (and gets reset by ChanServ), the change-back doesn't come through, and the original change gets shown as originating from the appservice, but only when it is someone else changing the topic.

When changing the topic yourself, both the topic set and the change-back are bridged correctly, showing your own user and ChanServ respectively.


Via Matrix, when someone else changes the topic:

Selection_978

Via IRC directly:

Selection_979

But... when I change the topic, via Matrix:

Selection_977

And via IRC directly:

Selection_980

Half-Shot commented 4 years ago

Hmm, we fall back to using the appservice bot if we think the user who set the permission doesn't have permission. Though, that doesn't seem to apply here.

Half-Shot commented 4 years ago

Ah, did Selavi have permission to change the topic?

joepie91 commented 4 years ago

Well, that depends on how you look at 'permission', I guess. The IRCd didn't reject their attempt, as it went through before being reset by ChanServ; but ChanServ certainly concluded that they weren't allowed to do it, because of the topic lock set on the ChanServ side.

Does the bridge perhaps contain some logic like "only assume they have permission if they have +o"? Selavi doesn't have +o, but chanop status doesn't necessarily cleanly map to topic-changing permission on IRC anyway.

(What's the rationale behind using the appservice bot identity in the non-permission case anyway?)