mirror of https://github.com/procxx/kepka.git
Fixed crash in bot keyboard replacement. 0.9.41 version.
After username resolve bots always opens conversation, not profile.
This commit is contained in:
parent
9cbdc6e95e
commit
af014b3c14
|
@ -2348,6 +2348,13 @@ QString BotKeyboard::tooltipText() const {
|
|||
return QString();
|
||||
}
|
||||
|
||||
void BotKeyboard::onParentScrolled() {
|
||||
// Holding scrollarea can fire scrolled() event from a resize() call before
|
||||
// the resizeEvent() is called, which prepares _impl for updateSelected() call.
|
||||
// Calling updateSelecteD() without delay causes _impl->getState() before _impl->resize().
|
||||
QMetaObject::invokeMethod(this, "updateSelected", Qt::QueuedConnection);
|
||||
}
|
||||
|
||||
void BotKeyboard::updateSelected() {
|
||||
PopupTooltip::Show(1000, this);
|
||||
|
||||
|
@ -2810,7 +2817,7 @@ HistoryWidget::HistoryWidget(QWidget *parent) : TWidget(parent)
|
|||
_kbScroll.setWidget(&_keyboard);
|
||||
_kbScroll.hide();
|
||||
|
||||
connect(&_kbScroll, SIGNAL(scrolled()), &_keyboard, SLOT(updateSelected()));
|
||||
connect(&_kbScroll, SIGNAL(scrolled()), &_keyboard, SLOT(onParentScrolled()));
|
||||
|
||||
updateScrollColors();
|
||||
|
||||
|
|
|
@ -347,6 +347,10 @@ public:
|
|||
|
||||
public slots:
|
||||
|
||||
void onParentScrolled();
|
||||
|
||||
private slots:
|
||||
|
||||
void updateSelected();
|
||||
|
||||
private:
|
||||
|
|
|
@ -3734,6 +3734,9 @@ void MainWidget::usernameResolveDone(QPair<MsgId, QString> msgIdAndStartToken, c
|
|||
if (peer->isUser() && peer->asUser()->botInfo && !peer->asUser()->botInfo->cantJoinGroups && !startToken.isEmpty()) {
|
||||
peer->asUser()->botInfo->startGroupToken = startToken;
|
||||
Ui::showLayer(new ContactsBox(peer->asUser()));
|
||||
} else if (peer->isUser() && peer->asUser()->botInfo) {
|
||||
// Always open bot chats, even from mention links.
|
||||
Ui::showPeerHistoryAsync(peer->id, ShowAtUnreadMsgId);
|
||||
} else {
|
||||
showPeerProfile(peer);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue