Added mention of user by right-clicking on his nickname. (#589)

* Added mention of user by right-clicking on his nickname.

* Removed possibility of choice. Always add @ to username.
This commit is contained in:
23rd
2018-07-10 19:27:42 +03:00
committed by fourtf
parent d82c647edd
commit c3793121cb
3 changed files with 16 additions and 1 deletions
+9 -1
View File
@@ -963,7 +963,15 @@ void ChannelView::handleMouseClick(QMouseEvent *event, const MessageLayoutElemen
}
} break;
case Qt::RightButton: {
this->addContextMenuItems(hoveredElement, layout);
auto &link = hoveredElement->getLink();
if (link.type == Link::UserInfo) {
Split *split = dynamic_cast<Split *>(this->parentWidget());
if (split != nullptr) {
split->insertTextToInput("@" + link.value + ", ");
}
} else {
this->addContextMenuItems(hoveredElement, layout);
}
} break;
default:;
}