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

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 { ...@@ -231,10 +231,12 @@ class ConversationViewModel: ViewModel {
} }
func sendContactRequest() { func sendContactRequest() {
self.contactsService.sendContactRequest(toContactRingId: self.conversation.recipientRingId, vCard: nil, withAccount: self.accountService.currentAccount!) self.accountService.loadVCard(forAccounr: self.accountService.currentAccount!)
.subscribe(onCompleted: { .subscribe(onSuccess: { card in
self.log.info("request sent") self.contactsService.sendContactRequest(toContactRingId: self.conversation.recipientRingId, vCard: card, withAccount: self.accountService.currentAccount!).subscribe(onCompleted: {
}) self.log.info("contact request sent")
.disposed(by: disposeBag) }).disposed(by: self.disposeBag)
}).disposed(by: self.disposeBag)
} }
} }
...@@ -126,7 +126,7 @@ class ContactsService { ...@@ -126,7 +126,7 @@ class ContactsService {
var payload: Data? var payload: Data?
if let vCard = vCard { 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) self.contactsAdapter.sendTrustRequest(toContact: ringId, payload: payload, withAccountId: account.id)
completable(.completed) completable(.completed)
......
Supports Markdown
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