diff options
Diffstat (limited to 'Swift/Controllers/Storages')
| -rw-r--r-- | Swift/Controllers/Storages/AvatarFileStorage.cpp | 14 | ||||
| -rw-r--r-- | Swift/Controllers/Storages/CertificateFileStorage.cpp | 6 |
2 files changed, 10 insertions, 10 deletions
diff --git a/Swift/Controllers/Storages/AvatarFileStorage.cpp b/Swift/Controllers/Storages/AvatarFileStorage.cpp index 9d9b9ea..808c432 100644 --- a/Swift/Controllers/Storages/AvatarFileStorage.cpp +++ b/Swift/Controllers/Storages/AvatarFileStorage.cpp | |||
| @@ -1,5 +1,5 @@ | |||
| 1 | /* | 1 | /* |
| 2 | * Copyright (c) 2010-2018 Isode Limited. | 2 | * Copyright (c) 2010-2019 Isode Limited. |
| 3 | * All rights reserved. | 3 | * All rights reserved. |
| 4 | * See the COPYING file for more information. | 4 | * See the COPYING file for more information. |
| 5 | */ | 5 | */ |
| @@ -30,13 +30,13 @@ AvatarFileStorage::AvatarFileStorage(const boost::filesystem::path& avatarsDir, | |||
| 30 | jidAvatars.insert(std::make_pair(jid, r.first)); | 30 | jidAvatars.insert(std::make_pair(jid, r.first)); |
| 31 | } | 31 | } |
| 32 | else if (!r.first.empty() || !r.second.empty()) { | 32 | else if (!r.first.empty() || !r.second.empty()) { |
| 33 | SWIFT_LOG(error) << "Invalid entry in avatars file: " << r.second << std::endl; | 33 | SWIFT_LOG(error) << "Invalid entry in avatars file: " << r.second; |
| 34 | } | 34 | } |
| 35 | } | 35 | } |
| 36 | } | 36 | } |
| 37 | } | 37 | } |
| 38 | catch (...) { | 38 | catch (...) { |
| 39 | SWIFT_LOG(error) << "Error reading avatars file" << std::endl; | 39 | SWIFT_LOG(error) << "Error reading avatars file"; |
| 40 | } | 40 | } |
| 41 | } | 41 | } |
| 42 | } | 42 | } |
| @@ -54,7 +54,7 @@ void AvatarFileStorage::addAvatar(const std::string& hash, const ByteArray& avat | |||
| 54 | boost::filesystem::create_directories(avatarPath.parent_path()); | 54 | boost::filesystem::create_directories(avatarPath.parent_path()); |
| 55 | } | 55 | } |
| 56 | catch (const boost::filesystem::filesystem_error& e) { | 56 | catch (const boost::filesystem::filesystem_error& e) { |
| 57 | SWIFT_LOG(error) << "filesystem error: " << e.what() << std::endl; | 57 | SWIFT_LOG(error) << "filesystem error: " << e.what(); |
| 58 | } | 58 | } |
| 59 | } | 59 | } |
| 60 | 60 | ||
| @@ -63,7 +63,7 @@ void AvatarFileStorage::addAvatar(const std::string& hash, const ByteArray& avat | |||
| 63 | file.write(reinterpret_cast<const char*>(vecptr(avatar)), static_cast<std::streamsize>(avatar.size())); | 63 | file.write(reinterpret_cast<const char*>(vecptr(avatar)), static_cast<std::streamsize>(avatar.size())); |
| 64 | } | 64 | } |
| 65 | catch (const boost::filesystem::filesystem_error& e) { | 65 | catch (const boost::filesystem::filesystem_error& e) { |
| 66 | SWIFT_LOG(error) << "filesystem error: " << e.what() << std::endl; | 66 | SWIFT_LOG(error) << "filesystem error: " << e.what(); |
| 67 | } | 67 | } |
| 68 | } | 68 | } |
| 69 | 69 | ||
| @@ -77,7 +77,7 @@ ByteArray AvatarFileStorage::getAvatar(const std::string& hash) const { | |||
| 77 | readByteArrayFromFile(data, getAvatarPath(hash)); | 77 | readByteArrayFromFile(data, getAvatarPath(hash)); |
| 78 | } | 78 | } |
| 79 | catch (const boost::filesystem::filesystem_error& e) { | 79 | catch (const boost::filesystem::filesystem_error& e) { |
| 80 | SWIFT_LOG(error) << "filesystem error: " << e.what() << std::endl; | 80 | SWIFT_LOG(error) << "filesystem error: " << e.what(); |
| 81 | } | 81 | } |
| 82 | return data; | 82 | return data; |
| 83 | } | 83 | } |
| @@ -107,7 +107,7 @@ void AvatarFileStorage::saveJIDAvatars() { | |||
| 107 | file.close(); | 107 | file.close(); |
| 108 | } | 108 | } |
| 109 | catch (...) { | 109 | catch (...) { |
| 110 | SWIFT_LOG(error) << "Error writing avatars file" << std::endl; | 110 | SWIFT_LOG(error) << "Error writing avatars file"; |
| 111 | } | 111 | } |
| 112 | } | 112 | } |
| 113 | 113 | ||
diff --git a/Swift/Controllers/Storages/CertificateFileStorage.cpp b/Swift/Controllers/Storages/CertificateFileStorage.cpp index 2e1343f..a8661df 100644 --- a/Swift/Controllers/Storages/CertificateFileStorage.cpp +++ b/Swift/Controllers/Storages/CertificateFileStorage.cpp | |||
| @@ -1,5 +1,5 @@ | |||
| 1 | /* | 1 | /* |
| 2 | * Copyright (c) 2010-2018 Isode Limited. | 2 | * Copyright (c) 2010-2019 Isode Limited. |
| 3 | * All rights reserved. | 3 | * All rights reserved. |
| 4 | * See the COPYING file for more information. | 4 | * See the COPYING file for more information. |
| 5 | */ | 5 | */ |
| @@ -31,7 +31,7 @@ bool CertificateFileStorage::hasCertificate(Certificate::ref certificate) const | |||
| 31 | return true; | 31 | return true; |
| 32 | } | 32 | } |
| 33 | else { | 33 | else { |
| 34 | SWIFT_LOG(warning) << "Stored certificate does not match received certificate" << std::endl; | 34 | SWIFT_LOG(warning) << "Stored certificate does not match received certificate"; |
| 35 | return false; | 35 | return false; |
| 36 | } | 36 | } |
| 37 | } | 37 | } |
| @@ -57,7 +57,7 @@ void CertificateFileStorage::addCertificate(Certificate::ref certificate) { | |||
| 57 | file.close(); | 57 | file.close(); |
| 58 | } | 58 | } |
| 59 | catch (...) { | 59 | catch (...) { |
| 60 | SWIFT_LOG(warning) << "Failed to store certificate to " << certificatePath << std::endl; | 60 | SWIFT_LOG(warning) << "Failed to store certificate to " << certificatePath; |
| 61 | } | 61 | } |
| 62 | } | 62 | } |
| 63 | 63 | ||
Swift