hifi / heisenbridge

a bouncer-style Matrix IRC bridge
MIT License
244 stars 34 forks source link

Private message rooms are created as Matrix channel rooms (with three people) #235

Open CyberShadow opened 2 years ago

CyberShadow commented 2 years ago

Hi, sorry if this was reported - I did not find it in the issue list.

When you receive a private message on IRC, the rooms that Heisenbridge creates are sorted by Element into "Rooms" and not "People". I think this is because Heisenbridge will create a room with three members: you, the other IRC user (@irc_...), and heisenbridge.

A consequence of this is that the created rooms have the same default notification settings as for channels; I have to remember to change each such room's notification settings to alert on every message, otherwise I will usually miss received private messages from IRC users.

If possible, I think it would be an improvement if the room creation was done as coming from the other IRC user, and the heisenbridge user is not involved.

hifi commented 2 years ago

Hi, the current design requires that Heisenbridge is part of the room as otherwise it would be "lost" on restart.

There's no immediate plans to change this behavior as the databaseless design asks for the bridge bots rooms on startup from the homeserver and it wouldn't unfortunately work if it wasn't joined. The bot also has in-room commands and has the "ownership" of it by preventing the bridge user from ever inviting unrelated users in.

CyberShadow commented 2 years ago

Thanks for the quick reply. Though, I don't really understand why the simulated IRC user couldn't fulfill those functions instead.

For what it's worth, I had a look at the other bridges I'm running on my matrix-docker-ansible-deploy instance. None of the SMS, Telegram, Google Chat, Skype, Twitter, Slack, and Discord bridges have this problem, so it seems like heisenbridge is very much an outlier here. It also doesn't seem like an insurmountable problem considering, though I don't know if those bridges are stateless like Heisenbridge is.

I thought that maybe it was because Heisenbridge tracks and simulates users' online/offline state by making them join/part the channel? Without the heisenbridge user that would indeed make the room have only one person... but, that doesn't seem to be the case either. I tried sending a message to someone the other day, and they were still in the room even though they were actually offline on IRC (btw, the only feedback I got from that is an easily missed message in the network room).

BTW, I was wondering why portal rooms were not more commonly used in bridges, incl. Heisenbridge? From what I understand that would address the state issue, as the room's name would be a reproducible identifier.