Conversation
| if r.Raw == nil { | ||
| return false | ||
| } | ||
| if r.Info != nil && r.Info.MessageRequest != nil && *r.Info.MessageRequest { |
There was a problem hiding this comment.
Should we check spam first? Is it possible to have a folder be a request and marked as spam?
pkg/connector/events.go
Outdated
| } | ||
|
|
||
| func (evt *FBMessageRequestEvent) GetChatInfo(ctx context.Context, portal *bridgev2.Portal) (*bridgev2.ChatInfo, error) { | ||
| info := evt.m.makeMinimalChatInfo(evt.ThreadKey, table.UNKNOWN_THREAD_TYPE) |
There was a problem hiding this comment.
Unknown thread type here sounds wrong. If we actually don't know the thread type, we can't safely create portals. The uncertain receiver method should also be implemented properly
pkg/connector/handlemeta.go
Outdated
| func forcePortalBridgeInfoResync(ctx context.Context, portal *bridgev2.Portal) bool { | ||
| portal.UpdateBridgeInfo(ctx) | ||
| return false | ||
| } |
There was a problem hiding this comment.
This doesn't seem like it should exist at all
|
Oh, this is still missing updates to the room capabilities, plus accepting message requests (does the flag already get cleared when the request is accepted from another client?) |
Updated, but if clients missed the broadcast, manual accept still needed. Or should we get message requests from db and check one by one on reconnect? |
|
You mean if the bridge isn't online when the message request is accepted? Does the sync on non-cached reconnects not have enough data to automatically handle that? We should be getting 20 most recent chats automatically Definitely can't spam requests for every chat on every full reconnect though |
tulir
left a comment
There was a problem hiding this comment.
This plus setting it in chat resync events would probably deal with full reconnects?
Co-authored-by: Tulir Asokan <tulir@maunium.net>
|
seems to work now, also added a graphql api call to reliably get all message requests. |
tulir
left a comment
There was a problem hiding this comment.
Seems like a bunch of merge conflicts appeared too. Probably fine with or without the extra request
pkg/connector/client.go
Outdated
| m.UserLogin.RemoteProfile.Avatar = m.Ghost.AvatarMXC | ||
|
|
||
| m.initialTable.Store(initialTable) | ||
| m.startMessageRequestSync(ctx) |
There was a problem hiding this comment.
Is the extra call required? If message requests are already pushed while online and included in the 20 recent chats that are in the initial table after full reconnects, then I don't think we really need the extra request.
Could maybe be made configurable to sync everything?
There was a problem hiding this comment.
updated, you're right, removed the extra call
# Conflicts: # pkg/messagix/graphql.go # pkg/messagix/graphql/docs.go # pkg/messagix/instagram.go
No description provided.