feat: Support status-tag to join a public channel if mentioned in the message list

This commit is contained in:
Richard Ramos 2020-07-01 08:56:22 -04:00 committed by Iuri Matias
parent 9935d349c4
commit f191f7fe8b
2 changed files with 9 additions and 1 deletions

View File

@ -20,6 +20,7 @@ proc renderInline(self: ChatMessageList, elem: TextItem): string =
of "strong": result = fmt("<span style=\"font-weight: bold;\">{elem.literal}</span> ")
of "link": result = elem.destination
of "mention": result = fmt("<span style=\"color: #000000;\">{self.mention(elem.literal)}</span> ")
of "status-tag": result = fmt("<a href=\"#{elem.literal}\" class=\"status-tag\">{elem.literal}</a> ")
# See render-block in status-react/src/status_im/ui/screens/chat/message/message.cljs
proc renderBlock(self: ChatMessageList, message: Message): string =

View File

@ -280,7 +280,14 @@ Item {
selectByMouse: true
color: !isCurrentUser ? Theme.black : Theme.white
visible: contentType == Constants.messageType || isEmoji
onLinkActivated: Qt.openUrlExternally(link)
onLinkActivated: {
if(link.startsWith("#")){
chatsModel.joinChat(link.substring(1), Constants.chatTypePublic);
return;
}
Qt.openUrlExternally(link)
}
MouseArea {
anchors.fill: parent
acceptedButtons: Qt.NoButton // we don't want to eat clicks on the Text