-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: IONConnect DB conversation infrastructure #416
base: master
Are you sure you want to change the base?
Conversation
f679bca
to
84588c4
Compare
lib/app/features/chat/recent_chats/providers/conversations_provider.c.dart
Show resolved
Hide resolved
lib/app/features/chat/recent_chats/providers/conversations_provider.c.dart
Show resolved
Hide resolved
) async { | ||
if (eventMessage.kind == 14) { | ||
// This is the first message of the one-to-one conversation OR | ||
// change of the group conversation subject |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In my understanding empty content can also mean that:
- This is the first message of a conversation (doesn't matter 1v1 or group)
- This is the event that changes the group participants
- This is the event that changes the group subject
We need to process the event first before generating a new uuid for it and inserting to the conversations table.
So in my understanding it should be like:
Try to find a conversation that the message belongs to by pubkeys fingerprint (sorted p tags + pubkey)
* If not found
* If this is a "service" message (no content) -> try to find by the subject
* if found -> insert with the found conversation id (meaning the participants have changed)
* if not found -> generate uuid, insert
* If this is a regular message -> throw exception
* If found -> insert with the found conversation id
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Will fix and write unit tests for it
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@ice-orion empty content also means u change the group picture
Description
Adds
Type of Change