mautrix / facebook

A Matrix-Facebook Messenger puppeting bridge
https://matrix.to/#/#facebook:maunium.net
GNU Affero General Public License v3.0
389 stars 64 forks source link

invite bot on room creation so that it can invite ghost later if needed #316

Open davitz opened 1 year ago

davitz commented 1 year ago

Fix for https://github.com/mautrix/facebook/issues/314

When not using double puppetting, it would create one-on-one chat rooms with just the user and the bot for the other person. Later, the main bot would attempt to invite the user's ghost into the room, but the main bot itself had never been invited to the room and hence the exception would be thrown. This fix ensures the main bot is always added to the invite list on room creation, meaning that it can later invite ghosts if it needs to.

slagiewka commented 1 year ago

@tulir any chance you could look at this?

tulir commented 1 year ago

Your own ghost isn't supposed to be added to DM rooms. Having any extra users means the room name/avatar need to be managed too since it won't be a DM

davitz commented 1 year ago

Yeah, I've been using my fork since I opened this, and while everything else works well, you're right that the conversation names aren't ideal. I've just been waiting until I have more tinkering time to get the double puppetting configured. My understanding from the documentation though is that this is how it's supposed to handle showing messages from yourself that exist in the Facebook chat if you don't have double puppetting enabled.

So then are you saying that when you don't have double puppetting enabled, it is not meant to be possible for messages you sent in the Facebook client to be shown in Matrix?

That seems to contradict the docs, but in that case it should be simple enough to just remove the part where the Facebook bot tries to invite the ghost which is what was blocking the sync.