mobile: update model on adding group member (#923)

This commit is contained in:
JRoberts
2022-08-10 14:54:15 +04:00
committed by GitHub
parent 38f65c82c3
commit f896c4453d
5 changed files with 15 additions and 27 deletions

View File

@@ -567,18 +567,12 @@ func apiNewGroup(_ p: GroupProfile) throws -> GroupInfo {
throw r
}
func apiAddMember(_ groupId: Int64, _ contactId: Int64, _ memberRole: GroupMemberRole) async throws {
func apiAddMember(_ groupId: Int64, _ contactId: Int64, _ memberRole: GroupMemberRole) async throws -> GroupMember {
let r = await chatSendCmd(.apiAddMember(groupId: groupId, contactId: contactId, memberRole: memberRole))
if case .sentGroupInvitation = r { return }
if case let .sentGroupInvitation(_, _, member) = r { return member }
throw r
}
//func apiAddMember(_ groupId: Int64, _ contactId: Int64, _ memberRole: GroupMemberRole) async throws -> GroupMember {
// let r = await chatSendCmd(.apiAddMember(groupId: groupId, contactId: contactId, memberRole: memberRole))
// if case let .sentGroupInvitation(_, _, member) = r { return member }
// throw r
//}
enum JoinGroupResult {
case joined(groupInfo: GroupInfo)
case invitationRemoved