Add some missing references

remotes/origin/HEAD
Konstantinos Sideris 7 years ago
parent c75a136973
commit 12a96aae6d
  1. 4
      include/ChatPage.h
  2. 2
      src/AvatarProvider.cc
  3. 6
      src/Cache.cc
  4. 4
      src/ChatPage.cc
  5. 1
      src/MatrixClient.cc
  6. 2
      src/dialogs/ReadReceipts.cc

@ -206,7 +206,7 @@ ChatPage::updateUserMetadata(const std::vector<Collection> &collection)
{
using Member = mtx::events::StateEvent<mtx::events::state::Member>;
for (auto &event : collection) {
for (const auto &event : collection) {
if (mpark::holds_alternative<Member>(event)) {
auto member = mpark::get<Member>(event);
@ -224,7 +224,7 @@ ChatPage::getMemberships(const std::vector<Collection> &collection) const
using Member = mtx::events::StateEvent<mtx::events::state::Member>;
for (auto &event : collection) {
for (const auto &event : collection) {
if (mpark::holds_alternative<Member>(event)) {
auto member = mpark::get<Member>(event);
memberships.emplace(member.state_key, member);

@ -36,7 +36,7 @@ AvatarProvider::updateAvatar(const QString &uid, const QImage &img)
auto callbacks = toBeResolved_[uid];
// Update all the timeline items with the resolved avatar.
for (const auto callback : callbacks)
for (const auto &callback : callbacks)
callback(img);
toBeResolved_.erase(uid);

@ -482,7 +482,7 @@ Cache::readReceipts(const QString &event_id, const QString &room_id)
auto json_response = json::parse(std::string(value.data(), value.size()));
auto values = json_response.get<std::map<std::string, uint64_t>>();
for (auto v : values)
for (const auto &v : values)
// timestamp, user_id
receipts.emplace(v.second, v.first);
}
@ -497,7 +497,7 @@ Cache::readReceipts(const QString &event_id, const QString &room_id)
void
Cache::updateReadReceipt(const std::string &room_id, const Receipts &receipts)
{
for (auto receipt : receipts) {
for (const auto &receipt : receipts) {
const auto event_id = receipt.first;
auto event_receipts = receipt.second;
@ -528,7 +528,7 @@ Cache::updateReadReceipt(const std::string &room_id, const Receipts &receipts)
}
// Append the new ones.
for (auto event_receipt : event_receipts)
for (const auto &event_receipt : event_receipts)
saved_receipts.emplace(event_receipt.first, event_receipt.second);
// Save back the merged (or only the new) receipts.

@ -531,7 +531,7 @@ ChatPage::initialSyncCompleted(const mtx::responses::Sync &response)
roomSettings_.emplace(room_id,
QSharedPointer<RoomSettings>(new RoomSettings(room_id)));
for (const auto membership : roomState->memberships) {
for (const auto &membership : roomState->memberships) {
updateUserDisplayName(membership.second);
updateUserAvatarUrl(membership.second);
}
@ -791,7 +791,7 @@ ChatPage::updateTypingUsers(const QString &roomid, const std::vector<std::string
QSettings settings;
QString user_id = settings.value("auth/user_id").toString();
for (const auto uid : user_ids) {
for (const auto &uid : user_ids) {
auto user = QString::fromStdString(uid);
if (user == user_id)

@ -410,7 +410,6 @@ MatrixClient::initialSync() noexcept
emit initialSyncFailed();
return;
}
});
}

@ -102,7 +102,7 @@ ReadReceipts::addUsers(const std::multimap<uint64_t, std::string, std::greater<u
// We want to remove any previous items that have been set.
userList_->clear();
for (auto receipt : receipts) {
for (const auto &receipt : receipts) {
auto user =
new ReceiptItem(this, QString::fromStdString(receipt.second), receipt.first);
auto item = new QListWidgetItem(userList_);

Loading…
Cancel
Save