fix: various issues

This commit is contained in:
Richard Ramos 2021-07-26 15:08:27 -04:00 committed by Iuri Matias
parent 2b1945425c
commit af6978a367
3 changed files with 14 additions and 3 deletions

View File

@ -202,6 +202,11 @@ QtObject:
self.setActiveChannel(pubKey)
ChatType.OneToOne.int
proc joinWithENS*(self: ChannelView, ensName: string): int {.slot.} =
let pubKey = status_ens.pubkey(ensName)
if pubKey == "": return
self.joinPrivateChat(pubKey, ensName)
# TODO(pascal): replace with `leaveChat`, which is id based
# instead of index based, when refactoring/removing `ChannelContextMenu`
# (they still make use of this)

View File

@ -19,6 +19,7 @@ Item {
property string message: qsTrId("ens-test-message")
property string authorCurrentMsg: "0"
property string authorPrevMsg: "1"
property bool isText: true
property var clickMessage: function(){}
property string identicon: profileModel.profile.identicon
property int timestamp: 1577872140

View File

@ -382,9 +382,14 @@ QtObject {
}
if (index > -1) {
const pk = link.substring(index + 3)
result.title = qsTrId("start-a-1-on-1-chat-with--1").arg(utilsModel.generateAlias(pk))
result.title = qsTr("Start a 1-on-1 chat with %1")
.arg(isChatKey(pk) ? utilsModel.generateAlias(pk) : ("@" + removeStatusEns(pk)))
result.callback = function () {
chatsModel.channelView.joinPrivateChat(pk, "");
if(isChatKey(pk)){
chatsModel.channelView.joinPrivateChat(pk, "");
} else {
chatsModel.channelView.joinWithENS(pk);
}
}
return result
}
@ -463,7 +468,7 @@ QtObject {
const result = getLinkTitleAndCb(link)
return {
site: qsTrId("status-app-link"),
site: "https://join.status.im",
title: result.title,
communityId: result.communityId,
fetching: result.fetching,