sdk: fix typescript client (#1380)

This commit is contained in:
Evgeny Poberezkin 2022-11-17 14:45:48 +00:00 committed by GitHub
parent 5c2b70a214
commit bfa7ff16ff
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 12 additions and 3 deletions

View file

@ -249,7 +249,7 @@ export class ChatClient {
const r = await this.sendChatCommand({type: "showMyAddress"})
switch (r.type) {
case "userContactLink":
return r.connReqContact
return r.contactLink.connReqContact
default:
if (r.type === "chatCmdError" && r.chatError.type === "errorStore" && r.chatError.storeError.type === "userContactLinkNotFound") {
return undefined

View file

@ -280,8 +280,7 @@ export interface CRCmdOk extends CR {
export interface CRUserContactLink extends CR {
type: "userContactLink"
connReqContact: string
autoAccept: boolean
contactLink: UserContactLink
}
export interface CRUserContactLinkUpdated extends CR {
@ -913,6 +912,16 @@ interface FileTransferMeta {
cancelled: boolean
}
interface UserContactLink {
connReqContact: string
autoAccept?: AutoAccept
}
interface AutoAccept {
acceptIncognito: boolean
autoReply?: MsgContent
}
export interface ChatStats {
unreadCount: number
minUnreadItemId: number