fix: fix chat links in a couple of ways

- link color in compact mode
- channel links did not have a #
- clicking on a mention should show that profile
- The AddChat button image didn't reposition when closing
This commit is contained in:
Jonathan Rainville 2020-08-26 14:10:47 -04:00 committed by Iuri Matias
parent f47fda6d68
commit d19f15bb84
4 changed files with 6 additions and 5 deletions

View File

@ -22,7 +22,7 @@ proc renderInline(self: ChatMessageList, elem: TextItem): string =
of "strong": result = fmt("<strong>{elem.literal}</strong> ")
of "link": result = elem.destination
of "mention": result = fmt("<a href=\"//{elem.literal}\" class=\"mention\">{self.mention(elem.literal)}</a> ")
of "status-tag": result = fmt("<a href=\"#{elem.literal}\" class=\"status-tag\">{elem.literal}</a> ")
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

@ -20,9 +20,9 @@ StyledTextEdit {
}
if (link.startsWith('//')) {
let pk = link.replace("//", "");
profileClick(chatsModel.userNameOrAlias(pk), pk, chatsModel.generateIdenticon(pk))
return;
let pk = link.replace("//", "");
profilePopup.openPopup(chatsModel.userNameOrAlias(pk), pk, chatsModel.generateIdenticon(pk))
return;
}
Qt.openUrlExternally(link)

View File

@ -40,7 +40,7 @@ AddButton {
onTriggered: publicChatPopup.open()
}
onAboutToHide: {
btnAdd.icon.state = "default"
btnAdd.iconImg.state = "default"
}
}
}

View File

@ -141,6 +141,7 @@ DISTFILES += \
app/AppLayouts/Chat/ChatColumn/MessageComponents/UserImage.qml \
app/AppLayouts/Chat/ChatColumn/MessageComponents/UsernameLabel.qml \
app/AppLayouts/Chat/ChatColumn/MessageComponents/qmldir \
app/AppLayouts/Chat/ContactsColumn/AddChat.qml \
app/AppLayouts/Chat/ContactsColumn/ClosedEmptyView.qml \
app/AppLayouts/Chat/components/EmojiCategoryButton.qml \
app/AppLayouts/Chat/components/EmojiPopup.qml \