diff --git a/SmartPanel.xaml b/SmartPanel.xaml index 9e8c9498743952bfbac891b50c1b10c51197647d..17eab468350cb83f291bec024b1f8fcd4ec06598 100644 --- a/SmartPanel.xaml +++ b/SmartPanel.xaml @@ -230,8 +230,6 @@ <RowDefinition Height="auto"/> <!-- row definition for the incoming call bar. --> <RowDefinition Height="auto"/> - <!-- row definition for the outgoing call bar. --> - <RowDefinition Height="auto"/> </Grid.RowDefinitions> <!--helper to detect mouse overing--> <Rectangle Fill="Transparent" Grid.Row="0"/> diff --git a/SmartPanel.xaml.cpp b/SmartPanel.xaml.cpp index 813089c0234d811895ede35f10c771760b7d33af..aa90d3e8978ac82f273fd2eae3eac1e00a318d3b 100644 --- a/SmartPanel.xaml.cpp +++ b/SmartPanel.xaml.cpp @@ -82,7 +82,6 @@ SmartPanel::SmartPanel() _selectedAccountAvatar_->ImageSource = ref new BitmapImage(uri); }); ContactsViewModel::instance->contactDataModified += ref new ContactDataModified([this](Contact^ contact){ - }); AccountsViewModel::instance->updateScrollView += ref new UpdateScrollView([this]() { _accountsListScrollView_->UpdateLayout(); @@ -1160,7 +1159,7 @@ void RingClientUWP::Views::SmartPanel::_selectedAccountAvatarContainer__PointerReleased(Platform::Object^ sender, Windows::UI::Xaml::Input::PointerRoutedEventArgs^ e) { CameraCaptureUI^ cameraCaptureUI = ref new CameraCaptureUI(); - cameraCaptureUI->PhotoSettings->Format = CameraCaptureUIPhotoFormat::Png; + cameraCaptureUI->PhotoSettings->Format = CameraCaptureUIPhotoFormat::Jpeg; cameraCaptureUI->PhotoSettings->CroppedSizeInPixels = Size(80, 80); create_task(cameraCaptureUI->CaptureFileAsync(CameraCaptureUIMode::Photo)) diff --git a/VCardUtils.cpp b/VCardUtils.cpp index 2a2e83124b006b722c98f26314624c6222565ae9..8ffae3c3f1975fa819808e69e8c9f0459f332f04 100644 --- a/VCardUtils.cpp +++ b/VCardUtils.cpp @@ -62,24 +62,43 @@ VCard::receiveChunk(const std::string& args, const std::string& payload) } m_mParts[Property::UID] = _line.substr(4); + bool fnFound = false; while (std::getline(_payload, _line)) { - if (_line.find("FN:") != std::string::npos) + if (_line.find("FN:") != std::string::npos) { + fnFound = true; break; + } } - m_mParts[Property::FN] = _line.substr(3); + if (fnFound) + m_mParts[Property::FN] = _line.substr(3); while (std::getline(_payload, _line)) { if (_line.find("PHOTO;") != std::string::npos) break; } + // because android client builds vcard differently (TYPE=PNG: vs PNG:) - m_mParts[Property::PHOTO].append(_line.substr(_line.find("PNG:") + 4)); + size_t pos = _line.find("PNG:"); + if (pos != std::string::npos) + m_mParts[Property::PHOTO].append(_line.substr(pos + 4)); + return VCARD_INCOMPLETE; } else { if (_part == _of) { std::getline(_payload, _line); m_mParts[Property::PHOTO].append(_line); + + bool fnFound = false; + while (std::getline(_payload, _line)) { + if (_line.find("FN:") != std::string::npos) { + fnFound = true; + break; + } + } + if (fnFound) + m_mParts[Property::FN] = _line.substr(3); + saveToFile(); decodeBase64ToPNGFile(); if (!m_mParts[Property::FN].empty()) @@ -101,7 +120,7 @@ void VCard::send(std::string callID, const char* vCardFile) { int i = 0; - const int chunkSize = 4096; + const int chunkSize = 1024; std::string vCard; if (vCardFile) { std::ifstream file(vCardFile); diff --git a/VCardUtils.h b/VCardUtils.h index 593fd6059c5746d1e4cb38d361de34c40bdb1a65..68f09dc64d5dfd456d449d55853c4c68481a0d41 100644 --- a/VCardUtils.h +++ b/VCardUtils.h @@ -44,7 +44,7 @@ struct Symbols { constexpr static const char* SEPERATOR1 = ";"; constexpr static const char* SEPERATOR2 = ":"; constexpr static const char* PHOTO_ENC = "ENDCODING=BASE64"; - constexpr static const char* PHOTO_TYPE = "TYPE=PNG"; + constexpr static const char* PHOTO_TYPE = "TYPE=JPEG"; }; struct Property { @@ -74,6 +74,7 @@ internal: private: std::map<std::string, std::string> m_mParts { }; Contact^ m_Owner; + int m_type; }; diff --git a/Wizard.xaml.cpp b/Wizard.xaml.cpp index 04f0861a314ebdb71cdc8a1a7a79c389af8fad18..66b7e61d10474999448dcd98b8cbde6827d8b808 100644 --- a/Wizard.xaml.cpp +++ b/Wizard.xaml.cpp @@ -80,7 +80,7 @@ void Wizard::_avatarWebcamCaptureBtn__Click(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e) { CameraCaptureUI^ cameraCaptureUI = ref new CameraCaptureUI(); - cameraCaptureUI->PhotoSettings->Format = CameraCaptureUIPhotoFormat::JpegXR; + cameraCaptureUI->PhotoSettings->Format = CameraCaptureUIPhotoFormat::Jpeg; cameraCaptureUI->PhotoSettings->CroppedSizeInPixels = Size(80, 80); create_task(cameraCaptureUI->CaptureFileAsync(CameraCaptureUIMode::Photo))