ios: groups miscellaneous (#843)

Co-authored-by: Evgeny Poberezkin <2769109+epoberezkin@users.noreply.github.com>
This commit is contained in:
JRoberts
2022-07-27 11:16:07 +04:00
committed by GitHub
co-authored by Evgeny Poberezkin
parent a4aaf36774
commit aa7e377bce
12 changed files with 265 additions and 144 deletions
+3 -3
View File
@@ -306,7 +306,7 @@ func apiContactInfo(contactId: Int64) async throws -> ConnectionStats? {
throw r
}
func apiGroupMemberInfo(groupId: Int64, groupMemberId: Int64) async throws -> ConnectionStats? {
func apiGroupMemberInfo(_ groupId: Int64, _ groupMemberId: Int64) async throws -> ConnectionStats? {
let r = await chatSendCmd(.apiGroupMemberInfo(groupId: groupId, groupMemberId: groupMemberId))
if case let .groupMemberInfo(_, _, connStats_) = r { return connStats_ }
throw r
@@ -565,9 +565,9 @@ func apiNewGroup(_ gp: GroupProfile) throws -> GroupInfo {
throw r
}
func addMember(groupId: Int64, contactId: Int64) async {
func addMember(groupId: Int64, contactId: Int64, memberRole: GroupMemberRole) async {
do {
try await apiAddMember(groupId: groupId, contactId: contactId, memberRole: .admin)
try await apiAddMember(groupId: groupId, contactId: contactId, memberRole: memberRole)
} catch let error {
logger.error("addMember error: \(responseError(error))")
}