diff --git a/iris b/iris index 35cd90c51..b64ba25c1 160000 --- a/iris +++ b/iris @@ -1 +1 @@ -Subproject commit 35cd90c51f7325c7e95ec1b1fe75469a3c22f0bd +Subproject commit b64ba25c1465ff5df3dec4317f113c86a256ba24 diff --git a/src/groupchatdlg.cpp b/src/groupchatdlg.cpp index 7b9a72c69..92661dbaf 100644 --- a/src/groupchatdlg.cpp +++ b/src/groupchatdlg.cpp @@ -1380,15 +1380,23 @@ void GCMainDlg::discoInfoFinished() d->discoMucName = i.first().name; } auto x = t->item().findExtension(XData::Data_Result, QLatin1String("http://jabber.org/protocol/muc#roominfo")); - d->discoMucDescription = x.getField("muc#roominfo_description").value().value(0); + d->discoMucDescription = x.getField(QLatin1String("muc#roominfo_description")).value().value(0); if (d->mucNameSource >= Private::TitleDisco) { updateMucName(); } if (!d->gcSelfPresenceSupported) { if (t->item().features().hasVCard()) { - auto avatarHash = x.getField("muc#roominfo_avatarhash").value().value(0); - account()->avatarFactory()->ensureVCardUpdated(jid(), QByteArray::fromHex(avatarHash.toLatin1()), - AvatarFactory::MucRoom); + // xep-0486 says either we have "muc#roominfo_avatarhash" with valid hash + // or don't have "muc#roominfo_avatarhash" at all and no avatar correspondingly. + // unfortunatelly we also have old server without this stuff in disco. + // So we are going to update avatar factory only we have "muc#roominfo_avatarhash". + // A drawback of this is inability to reset avatar by room configuration update notification. + auto field = x.findField(QLatin1String("muc#roominfo_avatarhash")); + if (field) { + auto avatarHash = field->value().value(0); + account()->avatarFactory()->ensureVCardUpdated(jid(), QByteArray::fromHex(avatarHash.toLatin1()), + AvatarFactory::MucRoom); + } } } } diff --git a/src/options/opt_plugins.cpp b/src/options/opt_plugins.cpp index b3c294c8d..93d7cabcb 100644 --- a/src/options/opt_plugins.cpp +++ b/src/options/opt_plugins.cpp @@ -128,7 +128,7 @@ void OptionsTabPlugins::listPlugins() item->setToolTip(C_NAME, toolTip); item->setCheckState(C_NAME, state); if (!enabled && !icon.isNull()) { - icon = QIcon(icon.pixmap(icon.availableSizes().at(0), QIcon::Disabled)); + icon = QIcon(icon.pixmap(icon.availableSizes().value(0), QIcon::Disabled)); } item->setIcon(C_NAME, icon); @@ -178,7 +178,7 @@ void OptionsTabPlugins::itemChanged(QTreeWidgetItem *item, int column) d->tw_Plugins->itemWidget(item, C_ABOUT)->setEnabled(enabled); QIcon icon = pm->icon(name); if (!enabled && !icon.isNull()) { - icon = QIcon(icon.pixmap(icon.availableSizes().at(0), QIcon::Disabled)); + icon = QIcon(icon.pixmap(icon.availableSizes().value(0), QIcon::Disabled)); } item->setIcon(C_NAME, icon); d->tw_Plugins->blockSignals(false); // Release signals blocking diff --git a/src/psichatdlg.cpp b/src/psichatdlg.cpp index 9fd6cb560..c56b46870 100644 --- a/src/psichatdlg.cpp +++ b/src/psichatdlg.cpp @@ -517,7 +517,7 @@ void PsiChatDlg::initToolButtons() ui_.vboxLayout1->addLayout(hb3a); // -- typeahead - ActionList *list = account()->psi()->actionList()->actionLists(PsiActionList::Actions_Chat).at(0); + ActionList *list = account()->psi()->actionList()->actionLists(PsiActionList::Actions_Chat).value(0); for (const QString &name : list->actions()) { auto action = list->copyAction(name, this); actions_->addAction(name, action); @@ -569,7 +569,7 @@ void PsiChatDlg::initToolButtons() } } - list = account()->psi()->actionList()->actionLists(PsiActionList::Actions_Common).at(0); + list = account()->psi()->actionList()->actionLists(PsiActionList::Actions_Common).value(0); for (const QString &name : list->actions()) { IconAction *action = list->copyAction(name, this); actions_->addAction(name, action); diff --git a/src/vcardfactory.cpp b/src/vcardfactory.cpp index d3e19765d..718ce9f64 100644 --- a/src/vcardfactory.cpp +++ b/src/vcardfactory.cpp @@ -303,7 +303,7 @@ void VCardFactory::ensureVCardPhotoUpdated(PsiAccount *acc, const Jid &jid, Flag if (!vc || vc.photo().isEmpty()) { // we didn't have it and still don't return; } - vc.setPhoto(VCard4::UriValue {}); // reset photo; + vc.setPhoto(VCard4::PAdvUris {}); // reset photo; saveVCard(jid, vc, flags); return;