Commit 5e912612 authored by Kateryna Kostiuk's avatar Kateryna Kostiuk Committed by Andreas Traczyk

contact request: send VCard

Change-Id: If6c1995a436dff5da2215fa3262963b412fee0c5
Reviewed-by: Andreas Traczyk's avatarAndreas Traczyk <andreas.traczyk@savoirfairelinux.com>
parent 85f3ac2a
......@@ -231,10 +231,12 @@ class ConversationViewModel: ViewModel {
}
func sendContactRequest() {
self.contactsService.sendContactRequest(toContactRingId: self.conversation.recipientRingId, vCard: nil, withAccount: self.accountService.currentAccount!)
.subscribe(onCompleted: {
self.log.info("request sent")
})
.disposed(by: disposeBag)
self.accountService.loadVCard(forAccounr: self.accountService.currentAccount!)
.subscribe(onSuccess: { card in
self.contactsService.sendContactRequest(toContactRingId: self.conversation.recipientRingId, vCard: card, withAccount: self.accountService.currentAccount!).subscribe(onCompleted: {
self.log.info("contact request sent")
}).disposed(by: self.disposeBag)
}).disposed(by: self.disposeBag)
}
}
......@@ -126,7 +126,7 @@ class ContactsService {
var payload: Data?
if let vCard = vCard {
payload = try CNContactVCardSerialization.data(with: [vCard])
payload = try CNContactVCardSerialization.dataWithImageAndUUID(from: vCard, andImageCompression: 40000)
}
self.contactsAdapter.sendTrustRequest(toContact: ringId, payload: payload, withAccountId: account.id)
completable(.completed)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment