core: fix short link type when adding for group link (#5942)

* core: fix short link type when adding for group link

* shorten, rename

* update setContactShortLink

* update

* fix

* plans

* simplexmq

* ui: show error when setting short link

---------

Co-authored-by: Evgeny Poberezkin <evgeny@poberezkin.com>
This commit is contained in:
spaced4ndy
2025-05-24 14:34:03 +01:00
committed by GitHub
co-authored by Evgeny Poberezkin
parent 6acd239339
commit b2bc4d6a5c
14 changed files with 62 additions and 54 deletions
+5 -5
View File
@@ -1210,9 +1210,9 @@ private func userAddressResponse(_ r: APIResult<ChatResponse1>) throws -> UserCo
}
}
func apiAddShortLinkMyAddress() async throws -> UserContactLink {
let userId = try currentUserId("apiAddShortLinkMyAddress")
let r: ChatResponse1 = try await chatSendCmd(.apiAddShortLinkMyAddress(userId: userId))
func apiAddMyAddressShortLink() async throws -> UserContactLink {
let userId = try currentUserId("apiAddMyAddressShortLink")
let r: ChatResponse1 = try await chatSendCmd(.apiAddMyAddressShortLink(userId: userId))
if case let .userContactLink(_, contactLink) = r { return contactLink }
throw r.unexpected
}
@@ -1743,8 +1743,8 @@ func apiGetGroupLink(_ groupId: Int64) throws -> (CreatedConnLink, GroupMemberRo
}
}
func apiAddShortLinkGroupLink(_ groupId: Int64) async throws -> (CreatedConnLink, GroupMemberRole) {
let r: ChatResponse2 = try await chatSendCmd(.apiAddShortLinkGroupLink(groupId: groupId))
func apiAddGroupShortLink(_ groupId: Int64) async throws -> (CreatedConnLink, GroupMemberRole) {
let r: ChatResponse2 = try await chatSendCmd(.apiAddGroupShortLink(groupId: groupId))
if case let .groupLink(_, _, connLink, memberRole) = r { return (connLink, memberRole) }
throw r.unexpected
}