mirror of
https://github.com/kotatogram/kotatogram-desktop
synced 2025-08-30 22:25:12 +00:00
Save item views in App::*Item() variables.
Also remove App::contextItem. Also use owning pointers for history context menus.
This commit is contained in:
@@ -10,6 +10,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
||||
#include "lang/lang_keys.h"
|
||||
#include "messenger.h"
|
||||
#include "platform/platform_specific.h"
|
||||
#include "history/view/history_view_message.h"
|
||||
#include "boxes/confirm_box.h"
|
||||
#include "base/qthelp_regex.h"
|
||||
#include "base/qthelp_url.h"
|
||||
@@ -241,10 +242,11 @@ void BotCommandClickHandler::onClick(Qt::MouseButton button) const {
|
||||
}
|
||||
|
||||
if (auto peer = Ui::getPeerForMouseAction()) { // old way
|
||||
UserData *bot = peer->isUser() ? peer->asUser() : nullptr;
|
||||
if (auto item = App::hoveredLinkItem()) {
|
||||
if (!bot) {
|
||||
bot = item->fromOriginal()->asUser(); // may return nullptr
|
||||
auto bot = peer->isUser() ? peer->asUser() : nullptr;
|
||||
if (!bot) {
|
||||
if (const auto view = App::hoveredLinkItem()) {
|
||||
// may return nullptr
|
||||
bot = view->data()->fromOriginal()->asUser();
|
||||
}
|
||||
}
|
||||
Ui::showPeerHistory(peer, ShowAtTheEndMsgId);
|
||||
|
@@ -527,7 +527,6 @@ inline int ceilclamp(float64 value, int32 step, int32 lowest, int32 highest) {
|
||||
|
||||
enum ForwardWhatMessages {
|
||||
ForwardSelectedMessages,
|
||||
ForwardContextMessage,
|
||||
ForwardPressedMessage,
|
||||
ForwardPressedLinkMessage
|
||||
};
|
||||
|
Reference in New Issue
Block a user