parent
e806ef9ff9
commit
7e8dc8c5d1
|
@ -14,6 +14,14 @@ Rectangle {
|
||||||
property string identicon
|
property string identicon
|
||||||
property bool hasMentions: false
|
property bool hasMentions: false
|
||||||
property int chatType: Constants.chatTypePublic
|
property int chatType: Constants.chatTypePublic
|
||||||
|
property int realChatType: {
|
||||||
|
if (chatType === Constants.chatTypeCommunity) {
|
||||||
|
// TODO add a check for private community chats once it is created
|
||||||
|
return Constants.chatTypePublic
|
||||||
|
}
|
||||||
|
return chatType
|
||||||
|
}
|
||||||
|
|
||||||
property string searchStr: ""
|
property string searchStr: ""
|
||||||
property bool isCompact: appSettings.useCompactMode
|
property bool isCompact: appSettings.useCompactMode
|
||||||
property int contentType: 1
|
property int contentType: 1
|
||||||
|
@ -21,10 +29,10 @@ Rectangle {
|
||||||
property bool hovered: false
|
property bool hovered: false
|
||||||
property bool enableMouseArea: true
|
property bool enableMouseArea: true
|
||||||
|
|
||||||
property string profileImage: chatType === Constants.chatTypeOneToOne ? appMain.getProfileImage(chatId) || "" : ""
|
property string profileImage: realChatType === Constants.chatTypeOneToOne ? appMain.getProfileImage(chatId) || "" : ""
|
||||||
|
|
||||||
Connections {
|
Connections {
|
||||||
enabled: chatType === Constants.chatTypeOneToOne
|
enabled: realChatType === Constants.chatTypeOneToOne
|
||||||
target: profileModel.contacts.list
|
target: profileModel.contacts.list
|
||||||
onContactChanged: {
|
onContactChanged: {
|
||||||
if (pubkey === wrapper.chatId) {
|
if (pubkey === wrapper.chatId) {
|
||||||
|
@ -58,7 +66,7 @@ Rectangle {
|
||||||
width: !isCompact ? 40 : 28
|
width: !isCompact ? 40 : 28
|
||||||
chatId: wrapper.chatId
|
chatId: wrapper.chatId
|
||||||
chatName: wrapper.name
|
chatName: wrapper.name
|
||||||
chatType: wrapper.chatType
|
chatType: wrapper.realChatType
|
||||||
identicon: wrapper.profileImage || wrapper.identicon
|
identicon: wrapper.profileImage || wrapper.identicon
|
||||||
anchors.left: parent.left
|
anchors.left: parent.left
|
||||||
anchors.leftMargin: !isCompact ? Style.current.padding : Style.current.smallPadding
|
anchors.leftMargin: !isCompact ? Style.current.padding : Style.current.smallPadding
|
||||||
|
@ -70,18 +78,18 @@ Rectangle {
|
||||||
width: 16
|
width: 16
|
||||||
height: 16
|
height: 16
|
||||||
fillMode: Image.PreserveAspectFit
|
fillMode: Image.PreserveAspectFit
|
||||||
source: "../../../img/channel-icon-" + (wrapper.chatType === Constants.chatTypePublic ? "public-chat.svg" : "group.svg")
|
source: "../../../img/channel-icon-" + (wrapper.realChatType === Constants.chatTypePublic ? "public-chat.svg" : "group.svg")
|
||||||
anchors.left: contactImage.right
|
anchors.left: contactImage.right
|
||||||
anchors.leftMargin: !isCompact ? Style.current.padding : Style.current.smallPadding
|
anchors.leftMargin: !isCompact ? Style.current.padding : Style.current.smallPadding
|
||||||
anchors.top: !isCompact ? parent.top : undefined
|
anchors.top: !isCompact ? parent.top : undefined
|
||||||
anchors.topMargin: !isCompact ? Style.current.smallPadding : 0
|
anchors.topMargin: !isCompact ? Style.current.smallPadding : 0
|
||||||
anchors.verticalCenter: !isCompact ? undefined : parent.verticalCenter
|
anchors.verticalCenter: !isCompact ? undefined : parent.verticalCenter
|
||||||
visible: wrapper.chatType !== Constants.chatTypeOneToOne
|
visible: wrapper.realChatType !== Constants.chatTypeOneToOne
|
||||||
}
|
}
|
||||||
|
|
||||||
StyledText {
|
StyledText {
|
||||||
id: contactInfo
|
id: contactInfo
|
||||||
text: wrapper.chatType !== Constants.chatTypePublic ?
|
text: wrapper.realChatType !== Constants.chatTypePublic ?
|
||||||
Emoji.parse(Utils.removeStatusEns(Utils.filterXSS(wrapper.name))) :
|
Emoji.parse(Utils.removeStatusEns(Utils.filterXSS(wrapper.name))) :
|
||||||
"#" + Utils.filterXSS(wrapper.name)
|
"#" + Utils.filterXSS(wrapper.name)
|
||||||
anchors.right: contactTime.left
|
anchors.right: contactTime.left
|
||||||
|
|
|
@ -98,7 +98,6 @@ Item {
|
||||||
chatColumn.isReply = false;
|
chatColumn.isReply = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -11,18 +11,25 @@ Item {
|
||||||
property string chatId
|
property string chatId
|
||||||
property string chatName
|
property string chatName
|
||||||
property int chatType
|
property int chatType
|
||||||
|
property int realChatType: {
|
||||||
|
if (chatType === Constants.chatTypeCommunity) {
|
||||||
|
// TODO add a check for private community chats once it is created
|
||||||
|
return Constants.chatTypePublic
|
||||||
|
}
|
||||||
|
return chatType
|
||||||
|
}
|
||||||
property string identicon
|
property string identicon
|
||||||
property int identiconSize: 40
|
property int identiconSize: 40
|
||||||
property bool isCompact: false
|
property bool isCompact: false
|
||||||
property bool muted: false
|
property bool muted: false
|
||||||
|
|
||||||
property string profileImage: chatType === Constants.chatTypeOneToOne ? appMain.getProfileImage(chatId) || "" : ""
|
property string profileImage: realChatType === Constants.chatTypeOneToOne ? appMain.getProfileImage(chatId) || "" : ""
|
||||||
|
|
||||||
height: 48
|
height: 48
|
||||||
width: nameAndInfo.width + chatIdenticon.width + Style.current.smallPadding
|
width: nameAndInfo.width + chatIdenticon.width + Style.current.smallPadding
|
||||||
|
|
||||||
Connections {
|
Connections {
|
||||||
enabled: chatType === Constants.chatTypeOneToOne
|
enabled: realChatType === Constants.chatTypeOneToOne
|
||||||
target: profileModel.contacts.list
|
target: profileModel.contacts.list
|
||||||
onContactChanged: {
|
onContactChanged: {
|
||||||
if (pubkey === root.chatId) {
|
if (pubkey === root.chatId) {
|
||||||
|
@ -33,7 +40,7 @@ Item {
|
||||||
|
|
||||||
StatusIdenticon {
|
StatusIdenticon {
|
||||||
id: chatIdenticon
|
id: chatIdenticon
|
||||||
chatType: root.chatType
|
chatType: root.realChatType
|
||||||
chatId: root.chatId
|
chatId: root.chatId
|
||||||
chatName: root.chatName
|
chatName: root.chatName
|
||||||
identicon: root.profileImage || root.identicon
|
identicon: root.profileImage || root.identicon
|
||||||
|
@ -53,7 +60,7 @@ Item {
|
||||||
StyledText {
|
StyledText {
|
||||||
id: chatName
|
id: chatName
|
||||||
text: {
|
text: {
|
||||||
switch(root.chatType) {
|
switch(root.realChatType) {
|
||||||
case Constants.chatTypePublic: return "#" + root.chatName;
|
case Constants.chatTypePublic: return "#" + root.chatName;
|
||||||
case Constants.chatTypeOneToOne: return Utils.removeStatusEns(root.chatName)
|
case Constants.chatTypeOneToOne: return Utils.removeStatusEns(root.chatName)
|
||||||
default: return root.chatName
|
default: return root.chatName
|
||||||
|
@ -110,7 +117,7 @@ Item {
|
||||||
id: chatInfo
|
id: chatInfo
|
||||||
color: Style.current.secondaryText
|
color: Style.current.secondaryText
|
||||||
text: {
|
text: {
|
||||||
switch(root.chatType){
|
switch(root.realChatType){
|
||||||
//% "Public chat"
|
//% "Public chat"
|
||||||
case Constants.chatTypePublic: return qsTrId("public-chat")
|
case Constants.chatTypePublic: return qsTrId("public-chat")
|
||||||
case Constants.chatTypeOneToOne: return (profileModel.contacts.isAdded(root.chatId) ?
|
case Constants.chatTypeOneToOne: return (profileModel.contacts.isAdded(root.chatId) ?
|
||||||
|
|
Loading…
Reference in New Issue