-
Notifications
You must be signed in to change notification settings - Fork 21
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
Conversation and Group implement common interface + Stream all #256
Conversation
src/lib/ConversationContainer.ts
Outdated
createdAt: number | ||
version: ConversationVersion | ||
topic: string | ||
isGroup(): boolean |
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.
Remove is Group in favor of version
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.
removed here - 4816fd4
src/lib/ConversationContainer.ts
Outdated
V1 = 'v1', | ||
V2 = 'v2', | ||
GROUP = 'group', |
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.
DirectMessage and Group RN doesn't need to know about V1 or V2
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.
updated here - 4816fd4
"conversationID" to (conversation.conversationId ?: ""), | ||
"keyMaterial" to Base64.encodeToString(conversation.keyMaterial, Base64.NO_WRAP) | ||
) | ||
} |
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.
Maybe clean this up by using the existing wrapper classes.
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.
updated fb87e3b 👍
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.
LGTM!
@@ -23,7 +23,7 @@ struct ConversationWrapper { | |||
"createdAt": UInt64(conversation.createdAt.timeIntervalSince1970 * 1000), | |||
"context": context, | |||
"peerAddress": conversation.peerAddress, | |||
"version": conversation.version == .v1 ? "v1" : "v2", | |||
"version": "DIRECT", |
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.
Note to future self that this will need to be noted in the release notes as a breaking change.
🎉 This PR is included in version 1.27.0-beta.10 🎉 The release is available on: Your semantic-release bot 📦🚀 |
🎉 This PR is included in version 1.28.0-beta.1 🎉 The release is available on: Your semantic-release bot 📦🚀 |
🎉 This PR is included in version 1.30.0-beta.1 🎉 The release is available on: Your semantic-release bot 📦🚀 |
🎉 This PR is included in version 1.31.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |
Added
conversations.streamAll()
function which streamsConversationContainer
.Group
andConversation
both implement theConversationContainer
interface. You can determine if aConversationContainer
is a Group or Conversation by checkingConversationContainer.version
which is of typeConversationVersion
:See new test case for usage example: https://github.com/xmtp/xmtp-react-native/pull/256/files#diff-ad2a5f900212586906998f46d89003c169d2425c5ad8f5b5ba82fa53fe254478R583-R668