Skip to content

Commit

Permalink
fix: add methods for finding groups and messages
Browse files Browse the repository at this point in the history
  • Loading branch information
nplasterer committed Jun 25, 2024
1 parent d21d509 commit 4f39c2f
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 8 deletions.
14 changes: 7 additions & 7 deletions example/ios/Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ PODS:
- hermes-engine/Pre-built (= 0.71.14)
- hermes-engine/Pre-built (0.71.14)
- libevent (2.1.12)
- LibXMTP (0.5.3-beta0)
- LibXMTP (0.5.3-beta1)
- Logging (1.0.0)
- MessagePacker (0.4.7)
- MMKV (1.3.5):
Expand Down Expand Up @@ -449,16 +449,16 @@ PODS:
- GenericJSON (~> 2.0)
- Logging (~> 1.0.0)
- secp256k1.swift (~> 0.1)
- XMTP (0.12.2):
- XMTP (0.12.3):
- Connect-Swift (= 0.12.0)
- GzipSwift
- LibXMTP (= 0.5.3-beta0)
- LibXMTP (= 0.5.3-beta1)
- web3.swift
- XMTPReactNative (0.1.0):
- ExpoModulesCore
- MessagePacker
- secp256k1.swift
- XMTP (= 0.12.2)
- XMTP (= 0.12.3)
- Yoga (1.14.0)

DEPENDENCIES:
Expand Down Expand Up @@ -711,7 +711,7 @@ SPEC CHECKSUMS:
GzipSwift: 893f3e48e597a1a4f62fafcb6514220fcf8287fa
hermes-engine: d7cc127932c89c53374452d6f93473f1970d8e88
libevent: 4049cae6c81cdb3654a443be001fb9bdceff7913
LibXMTP: c3d7b5cfa4b8df5c57ef01f09358c87dea299a13
LibXMTP: a4e1c78fd1b174c56b764e96eff70e39c46c2499
Logging: 9ef4ecb546ad3169398d5a723bc9bea1c46bef26
MessagePacker: ab2fe250e86ea7aedd1a9ee47a37083edd41fd02
MMKV: 506311d0494023c2f7e0b62cc1f31b7370fa3cfb
Expand Down Expand Up @@ -763,8 +763,8 @@ SPEC CHECKSUMS:
secp256k1.swift: a7e7a214f6db6ce5db32cc6b2b45e5c4dd633634
SwiftProtobuf: 407a385e97fd206c4fbe880cc84123989167e0d1
web3.swift: 2263d1e12e121b2c42ffb63a5a7beb1acaf33959
XMTP: 1a25f62cf29a9ba87a879b8c85062c497c9c813f
XMTPReactNative: dbf769e050ca4214b13c096cb873feb25f0c4429
XMTP: 5cf6c97a5cfc7295226b8e14dc079f975ea3a4be
XMTPReactNative: 520f9714e30d2909b14718654cc400473ab8d302
Yoga: e71803b4c1fff832ccf9b92541e00f9b873119b9

PODFILE CHECKSUM: 95d6ace79946933ecf80684613842ee553dd76a2
Expand Down
2 changes: 1 addition & 1 deletion ios/XMTPReactNative.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -26,5 +26,5 @@ Pod::Spec.new do |s|
s.source_files = "**/*.{h,m,swift}"
s.dependency 'secp256k1.swift'
s.dependency "MessagePacker"
s.dependency "XMTP", "= 0.12.2"
s.dependency "XMTP", "= 0.12.3"
end
22 changes: 22 additions & 0 deletions src/lib/Conversations.ts
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,28 @@ export default class Conversations<
return result
}

/**
* This method returns a group by the group id if that group exists in the local database.
* To get the latest list of groups from the network, call syncGroups() first.
*
* @returns {Promise<Group>} A Promise that resolves to a Group or undefined if not found.
*/
async findGroup(groupId: string): Promise<Group<ContentTypes> | undefined> {
return await XMTPModule.findGroup(this.client, groupId)
}

/**
* This method returns a message by the message id if that message exists in the local database.
* To get the latest list of messages from the network, call syncGroups() first.
*
* @returns {Promise<DecodedMessage>} A Promise that resolves to a DecodedMessage or undefined if not found.
*/
async findV3Message(
messageId: string
): Promise<DecodedMessage<ContentTypes> | undefined> {
return await XMTPModule.findV3Message(this.client, messageId)
}

/**
* This method returns a list of all conversations and groups that the client is a member of.
* To include the latest groups from the network in the returned list, call syncGroups() first.
Expand Down

0 comments on commit 4f39c2f

Please sign in to comment.