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 "strong": result = fmt("<span style=\"font-weight: bold;\">{elem.literal}</span> ")
|
||||||
of "link": result = elem.destination
|
of "link": result = elem.destination
|
||||||
of "mention": result = fmt("<span style=\"color: #000000;\">{self.mention(elem.literal)}</span> ")
|
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
|
# See render-block in status-react/src/status_im/ui/screens/chat/message/message.cljs
|
||||||
proc renderBlock(self: ChatMessageList, message: Message): string =
|
proc renderBlock(self: ChatMessageList, message: Message): string =
|
||||||
|
|
|
@ -280,7 +280,14 @@ Item {
|
||||||
selectByMouse: true
|
selectByMouse: true
|
||||||
color: !isCurrentUser ? Theme.black : Theme.white
|
color: !isCurrentUser ? Theme.black : Theme.white
|
||||||
visible: contentType == Constants.messageType || isEmoji
|
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 {
|
MouseArea {
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
acceptedButtons: Qt.NoButton // we don't want to eat clicks on the Text
|
acceptedButtons: Qt.NoButton // we don't want to eat clicks on the Text
|
||||||
|
|
Loading…
Reference in New Issue