Fix opening message menus for popup windows
We were previously assuming that we always want to parent these menus to RoomPage, but that only exists on the main window. If you tried to open the menu for say - the search window - then it would confusingly still open on the main menu. Thankfully the way to fix this is simple, by passing a parent QtObject around.
This commit is contained in:
@@ -282,14 +282,15 @@ void RoomManager::viewEventSource(const QString &eventId)
|
||||
Q_EMIT showEventSource(eventId);
|
||||
}
|
||||
|
||||
void RoomManager::viewEventMenu(const RoomEvent *event, NeoChatRoom *room, const QString &selectedText, const QString &hoveredLink)
|
||||
void RoomManager::viewEventMenu(QObject *parent, const RoomEvent *event, NeoChatRoom *room, const QString &selectedText, const QString &hoveredLink)
|
||||
{
|
||||
if (!event) {
|
||||
qWarning() << "Tried to open event menu with empty event";
|
||||
return;
|
||||
}
|
||||
|
||||
Q_EMIT showDelegateMenu(event->id(),
|
||||
Q_EMIT showDelegateMenu(parent,
|
||||
event->id(),
|
||||
room->qmlSafeMember(event->senderId()),
|
||||
MessageComponentType::typeForEvent(*event),
|
||||
EventHandler::plainBody(room, event),
|
||||
|
||||
Reference in New Issue
Block a user