mautrix / facebook

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

Additional noisy FB room is created while chatting via Facebook with another bridge user. #230

Open Liarra opened 2 years ago

Liarra commented 2 years ago

The first time I've noticed this problem is Friday 25th. Here is how to reproduce.

Say there are two users on a Matrix server, Alice and Bob. Both of them also use Facebook accounts and make use of the facebook bridge.

Upon closer inspection, it seems like both FB rooms contain 4 users:

  1. Alice (matrix)
  2. Bob (matrix)
  3. Facebook bridge bot;
  4. FB puppet of Alice or Bob, depending of whose FB account the room is supposed to represent.

Therefore, each time Alice writes to Bob (or Bob to Alice) this message gets delivered to the FB room. Since that FB room contains both Matrix users, the sender will be notified with the message they've just sent.

Edit: Leaving your own (FB) room doesn't help, as with each new message the user will be re-added back.

olmari commented 2 years ago

Well for one, why would you want to talk through FB with peoples having matrix? But also adjacently, if you do doublepuppeting (login-matrix) shouldn't this behavior stop too? (as you're now puppeting both ways)

Liarra commented 2 years ago

The important note is that I have installed the bridge using this ansible script: https://github.com/spantaleev/matrix-docker-ansible-deploy According to the docs, that should result in automatic double puppetting: https://github.com/spantaleev/matrix-docker-ansible-deploy/blob/master/docs/configuring-playbook-bridge-mautrix-facebook.md#set-up-double-puppeting

I tried enabling double puppeting with login-matrix anyway. the behaviour stays the same.

meson800 commented 1 year ago

To add some detail to this since my users are seeing this:

The problem is specifically with direct Facebook chats. If I (facebook ID AAAAA) message another Matrix user (facebook ID BBBBB) that has the Facebook bridge setup, the bridge sets up two chats, [AAAAA <-> BBBBB] and [BBBBB <-> AAAAA].

In Matrix, I get joined into both rooms. The two rooms are:

Double puppeting is correctly setup and works for both users.

I believe the problem is the bolded users, that shouldn't be invited. Comparing to how this is managed on other bridges like mautrix-signal, only your puppet is joined into the equivalent [BBBBB <-> AAAAA] room, which means that you only see the room corresponding to your side of the DM.

@tulir I'm happy to make a PR if you point me in the right direction. I think it's basically coming from some joining script marking both chats as joinable by the real Matrix user, but after some digging I didn't find what I was looking for.