Skip to content

handlemeta: handle instagram message request#243

Open
rnons wants to merge 7 commits intomainfrom
rnons/plat-35395
Open

handlemeta: handle instagram message request#243
rnons wants to merge 7 commits intomainfrom
rnons/plat-35395

Conversation

@rnons
Copy link
Copy Markdown
Contributor

@rnons rnons commented Mar 7, 2026

No description provided.

@rnons rnons requested a review from tulir March 7, 2026 12:20
Copy link
Copy Markdown
Member

@Fizzadar Fizzadar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One thing!

if r.Raw == nil {
return false
}
if r.Info != nil && r.Info.MessageRequest != nil && *r.Info.MessageRequest {
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we check spam first? Is it possible to have a folder be a request and marked as spam?

}

func (evt *FBMessageRequestEvent) GetChatInfo(ctx context.Context, portal *bridgev2.Portal) (*bridgev2.ChatInfo, error) {
info := evt.m.makeMinimalChatInfo(evt.ThreadKey, table.UNKNOWN_THREAD_TYPE)
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

func forcePortalBridgeInfoResync(ctx context.Context, portal *bridgev2.Portal) bool {
portal.UpdateBridgeInfo(ctx)
return false
}
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This doesn't seem like it should exist at all

@rnons rnons force-pushed the rnons/plat-35395 branch from ad5ebf4 to 4c1b13d Compare March 25, 2026 06:01
@tulir
Copy link
Copy Markdown
Member

tulir commented Mar 25, 2026

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?)

@rnons rnons force-pushed the rnons/plat-35395 branch from 393cc80 to a899bf9 Compare March 26, 2026 01:56
@rnons
Copy link
Copy Markdown
Contributor Author

rnons commented Mar 26, 2026

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?

@rnons rnons changed the title handlemeta: handle message request handlemeta: handle instagram message request Mar 26, 2026
@tulir
Copy link
Copy Markdown
Member

tulir commented Mar 26, 2026

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

Copy link
Copy Markdown
Member

@tulir tulir left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This plus setting it in chat resync events would probably deal with full reconnects?

rnons and others added 2 commits March 27, 2026 09:23
@rnons
Copy link
Copy Markdown
Contributor Author

rnons commented Mar 27, 2026

seems to work now, also added a graphql api call to reliably get all message requests.

Copy link
Copy Markdown
Member

@tulir tulir left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems like a bunch of merge conflicts appeared too. Probably fine with or without the extra request

m.UserLogin.RemoteProfile.Avatar = m.Ghost.AvatarMXC

m.initialTable.Store(initialTable)
m.startMessageRequestSync(ctx)
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

updated, you're right, removed the extra call

rnons added 2 commits April 2, 2026 09:03
# Conflicts:
#	pkg/messagix/graphql.go
#	pkg/messagix/graphql/docs.go
#	pkg/messagix/instagram.go
@rnons rnons force-pushed the rnons/plat-35395 branch from 3b8c6a3 to ab63d2e Compare April 2, 2026 00:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

3 participants