mirror of
https://github.com/status-im/status-desktop.git
synced 2025-01-10 22:36:24 +00:00
feat: Support status-tag to join a public channel if mentioned in the message list
This commit is contained in:
parent
9935d349c4
commit
f191f7fe8b
@ -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 =
|
||||
|
@ -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
|
||||
|
Loading…
x
Reference in New Issue
Block a user