feat(community): fetch community info from link

Fixes #2290
This commit is contained in:
Jonathan Rainville 2021-04-29 15:08:57 -04:00
parent 358091a8eb
commit 0fe7da0480
2 changed files with 24 additions and 0 deletions

View File

@ -223,6 +223,14 @@ proc init*(self: ChatModel, pubKey: string) =
self.mailserverReady = true
self.requestMissingCommunityInfos()
if (topics.len == 0):
warn "No topics found for chats. Cannot load past messages"
else:
self.events.once("mailserverAvailable") do(a: Args):
self.mailserverReady = true
self.requestMissingCommunityInfos()
self.events.emit("mailserverTopics", TopicArgs(topics: topics));
self.events.on("contactUpdate") do(a: Args):
var evArgs = ContactUpdateArgs(a)
self.updateContacts(evArgs.contacts)

View File

@ -61,6 +61,22 @@ Item {
return Utils.removeStatusEns(alias)
}
property string displayUserName: {
if (isCurrentUser) {
//% "You"
return qsTrId("You")
}
if (localName !== "") {
return localName
}
if (userName !== "") {
return Utils.removeStatusEns(userName)
}
return Utils.removeStatusEns(alias)
}
property string authorCurrentMsg: "authorCurrentMsg"
property string authorPrevMsg: "authorPrevMsg"