Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Initial support for ban syncing + minor improvements and bugfixes #1807

Open
wants to merge 14 commits into
base: develop
Choose a base branch
from

Commits on Jul 28, 2024

  1. Match IRC conventions when bridging file uploads

    Usually, IRC users just upload files somewhere and send a bare link,
    perhaps with a bit of explanation.
    
    The bridge originally did something like this for files:
    
    	* f_[mtrx] uploaded an image: (20KiB) < https://matrix.org/_matrix/media/v3/download/something/some-other-thing/image.png >
    
    and something like this for code blocks:
    
    	* f_[mtrx] sent a code block: https://matrix.org/_matrix/media/v3/download/something/some-other-thing
    
    That is quite unusual on IRC. This commit changes it to:
    
    	<f_[mtrx]> https://matrix.org/_matrix/media/v3/download/something/some-other-thing/image.png (20KiB)
    	<f_[mtrx]> https://matrix.org/_matrix/media/v3/download/something/some-other-thing
    
    Which is more natural.
    
    Signed-off-by: Ferass El Hafidi <[email protected]>
    Ferass El Hafidi authored and funderscore1 committed Jul 28, 2024
    Configuration menu
    Copy the full SHA
    6b03700 View commit details
    Browse the repository at this point in the history
  2. config.sample.yaml: update outdated comment

    Signed-off-by: Ferass El Hafidi <[email protected]>
    Ferass El Hafidi authored and funderscore1 committed Jul 28, 2024
    Configuration menu
    Copy the full SHA
    1b1094f View commit details
    Browse the repository at this point in the history
  3. config.sample.yaml: change default reply-to format

    It previously was:
    
    	<f_> hi everyone, what's up? I'm about to migrate some stuff today
    	~ a while after ~
    	<f_[mtrx]> <f_> "hi everyone,..." <- hi, doing great!
    
    Now it is:
    
    	<f_> hi everyone, what's up? I'm about to migrate some stuff today
    	~ a while after ~
    	<f_[mtrx]> f_: "hi everyone,..." <- hi, doing great!
    
    Some IRC clients may not create a ping when the nickname is surrounded
    with `<` and `>`.
    
    Signed-off-by: Ferass El Hafidi <[email protected]>
    Ferass El Hafidi authored and funderscore1 committed Jul 28, 2024
    Configuration menu
    Copy the full SHA
    914ab59 View commit details
    Browse the repository at this point in the history
  4. src/bridge/AdminRoomHandler.ts: don't require commands be uppercase

    when using `!cmd`
    
    IRC commands can be lowercase.
    
    Signed-off-by: Ferass El Hafidi <[email protected]>
    Ferass El Hafidi authored and funderscore1 committed Jul 28, 2024
    Configuration menu
    Copy the full SHA
    16f2f4e View commit details
    Browse the repository at this point in the history
  5. src/bridge/AdminRoomHandler.ts: fix !help formatting

    Signed-off-by: Ferass El Hafidi <[email protected]>
    Ferass El Hafidi authored and funderscore1 committed Jul 28, 2024
    Configuration menu
    Copy the full SHA
    3324ff1 View commit details
    Browse the repository at this point in the history

Commits on Aug 3, 2024

  1. src/irc/BridgedClient.ts: replace "M" letter prefix with "`" when nick

    starts with an invalid character
    
    Looks more natural to IRC users. IRC users usually add an underscore at
    the beginning or a "`".
    
    With that, "M24Hacker[m]" becomes "`24Hacker[m]"
    
    Signed-off-by: Ferass El Hafidi <[email protected]>
    Ferass El Hafidi authored and Ferass El Hafidi committed Aug 3, 2024
    Configuration menu
    Copy the full SHA
    b62a6a7 View commit details
    Browse the repository at this point in the history
  2. Initial support for bridging Matrix bans to IRC

    The bridge used to *not* bridge Matrix bans to IRC. As such, when
    someone banned an IRC user from Matrix, it would only prevent Matrix
    users from seeing messages coming from said user, but would not ban that
    user from IRC at all. This resulted in Matrix channel moderators being
    confused when other IRC users are reporting spam that simply isn't
    bridged at all as a result.
    
    This commit adds support for bridging Matrix bans to IRC. Currently, it
    just bans on IRC based on the IRC user's nickname, but this could change
    in the future, and most importantly is better than not bridging the
    ban at all.
    
    Signed-off-by: Ferass El Hafidi <[email protected]>
    Ferass El Hafidi authored and Ferass El Hafidi committed Aug 3, 2024
    Configuration menu
    Copy the full SHA
    d32ea38 View commit details
    Browse the repository at this point in the history
  3. src/bridge/MatrixHandler.ts: add s modifier to REPLY_REGEX

    Fixes matrix-org#1521
    
    Signed-off-by: Ferass El Hafidi <[email protected]>
    Ferass El Hafidi authored and Ferass El Hafidi committed Aug 3, 2024
    Configuration menu
    Copy the full SHA
    37e183c View commit details
    Browse the repository at this point in the history

Commits on Aug 14, 2024

  1. src/bridge/MatrixHandler.ts: handle replying to self

    When someone sent a message:
    
    	<f_[mtrx]> Hello?
    
    And then replied to their own message:
    
    	<f_[mtrx]> > <@Funderscore:nova.astraltech.org> Hello?
    	           Hi?
    
    What would be sent on IRC would either be this:
    
    	<f_[mtrx]> Hello?
    	<f_[mtrx]> f_[mtrx]: Hi?
    
    Or:
    
    	<f_[mtrx]> Hello?
    	-- a while later --
    	<f_[mtrx]> f_[mtrx]: "Hello?" <- Hi?
    
    Both of which are confusing because usually nobody pings themself on
    IRC.
    
    This commit treats replies to self differently, and introduces a new
    `selfReplyTemplate` config option, so that the reply gets bridged as:
    
    	<f_[mtrx]> <f_[mtrx]> Hello?
    	<f_[mtrx]> Hi?
    
    Which is a bit more natural.
    
    Signed-off-by: Ferass El Hafidi <[email protected]>
    Ferass El Hafidi committed Aug 14, 2024
    Configuration menu
    Copy the full SHA
    6dd994d View commit details
    Browse the repository at this point in the history
  2. Match IRC conventions when bridging file uploads

    Usually, IRC users just upload files somewhere and send a bare link,
    perhaps with a bit of explanation.
    
    The bridge originally did something like this for files:
    
    	* f_[mtrx] uploaded an image: (20KiB) < https://matrix.org/_matrix/media/v3/download/something/some-other-thing/image.png >
    
    and something like this for code blocks:
    
    	* f_[mtrx] sent a code block: https://matrix.org/_matrix/media/v3/download/something/some-other-thing
    
    That is quite unusual on IRC. This commit changes it to:
    
    	<f_[mtrx]> https://matrix.org/_matrix/media/v3/download/something/some-other-thing/image.png (20KiB)
    	<f_[mtrx]> https://matrix.org/_matrix/media/v3/download/something/some-other-thing
    
    Which is more natural.
    
    Signed-off-by: Ferass El Hafidi <[email protected]>
    Ferass El Hafidi committed Aug 14, 2024
    Configuration menu
    Copy the full SHA
    26d76e1 View commit details
    Browse the repository at this point in the history
  3. changelog

    Signed-off-by: Ferass El Hafidi <[email protected]>
    Ferass El Hafidi committed Aug 14, 2024
    Configuration menu
    Copy the full SHA
    fad8029 View commit details
    Browse the repository at this point in the history
  4. spec/: fix tests to match previous changes

    Signed-off-by: Ferass El Hafidi <[email protected]>
    Ferass El Hafidi committed Aug 14, 2024
    Configuration menu
    Copy the full SHA
    e9e55da View commit details
    Browse the repository at this point in the history
  5. spec/integ/matrix-to-irc: add test for self-reply

    Signed-off-by: Ferass El Hafidi <[email protected]>
    Ferass El Hafidi committed Aug 14, 2024
    Configuration menu
    Copy the full SHA
    e490011 View commit details
    Browse the repository at this point in the history
  6. spec/integ/kicking: add ban tests

    Signed-off-by: Ferass El Hafidi <[email protected]>
    Ferass El Hafidi committed Aug 14, 2024
    Configuration menu
    Copy the full SHA
    ce800dc View commit details
    Browse the repository at this point in the history