chore(@desktop): rename ambiguous fields `identicon`->`icon`

This commit is contained in:
Patryk Osmaczko 2022-04-01 17:36:57 +02:00 committed by osmaczko
parent 08caca2a60
commit ce36ee90ca
8 changed files with 24 additions and 28 deletions

View File

@ -76,7 +76,7 @@ proc buildLocationMenuForChat(self: Module): location_menu_item.Item =
var subItems: seq[location_menu_sub_item.SubItem]
for c in displayedChats:
var chatName = c.name
var chatImage = c.identicon
var chatImage = c.icon
if(c.chatType == ChatType.OneToOne):
(chatName, chatImage) = self.controller.getOneToOneChatNameAndImage(c.id)
@ -93,7 +93,7 @@ proc buildLocationMenuForCommunity(self: Module, community: CommunityDto): locat
let chats = self.controller.getAllChatsForCommunity(community.id)
for c in chats:
let chatDto = self.controller.getChatDetails(community.id, c.id)
let subItem = location_menu_sub_item.initSubItem(chatDto.id, chatDto.name, chatDto.identicon, "", chatDto.color)
let subItem = location_menu_sub_item.initSubItem(chatDto.id, chatDto.name, chatDto.icon, "", chatDto.color)
subItems.add(subItem)
item.setSubItems(subItems)
@ -166,7 +166,7 @@ method onSearchMessagesDone*(self: Module, messages: seq[MessageDto]) =
let chatDto = self.controller.getChatDetails(co.id, c.id)
if(c.name.toLower.startsWith(self.controller.searchTerm().toLower)):
let item = result_item.initItem(chatDto.id, "", "", chatDto.id, chatDto.name,
SEARCH_RESULT_CHANNELS_SECTION_NAME, chatDto.identicon, chatDto.color, "", "", chatDto.identicon, chatDto.color,
SEARCH_RESULT_CHANNELS_SECTION_NAME, chatDto.icon, chatDto.color, "", "", chatDto.icon, chatDto.color,
false)
self.controller.addResultItemDetails(chatDto.id, co.id, chatDto.id)
@ -181,7 +181,7 @@ method onSearchMessagesDone*(self: Module, messages: seq[MessageDto]) =
for c in displayedChats:
var chatName = c.name
var chatImage = c.identicon
var chatImage = c.icon
if(c.chatType == ChatType.OneToOne):
(chatName, chatImage) = self.controller.getOneToOneChatNameAndImage(c.id)
@ -211,7 +211,7 @@ method onSearchMessagesDone*(self: Module, messages: seq[MessageDto]) =
if(chatDto.communityId.len == 0):
var chatName = chatDto.name
var chatImage = chatDto.identicon
var chatImage = chatDto.icon
if(chatDto.chatType == ChatType.OneToOne):
(chatName, chatImage) = self.controller.getOneToOneChatNameAndImage(chatDto.id)

View File

@ -74,7 +74,7 @@ method load*(self: Module) =
let hasNotification = chatDto.unviewedMessagesCount > 0 or chatDto.unviewedMentionsCount > 0
let notificationsCount = chatDto.unviewedMentionsCount
var chatName = chatDto.name
var chatImage = chatDto.identicon
var chatImage = chatDto.icon
if(chatDto.chatType == ChatType.OneToOne):
(chatName, chatImage) = self.controller.getOneToOneChatNameAndImage()

View File

@ -159,7 +159,7 @@ proc buildCommunityUI(self: Module, events: EventEmitter,
let hasNotification = chatDto.unviewedMessagesCount > 0 or chatDto.unviewedMentionsCount > 0
let notificationsCount = chatDto.unviewedMentionsCount
let amIChatAdmin = comm.admin
let channelItem = initItem(chatDto.id, chatDto.name, chatDto.identicon, chatDto.color,
let channelItem = initItem(chatDto.id, chatDto.name, chatDto.icon, chatDto.color,
chatDto.emoji, chatDto.description, chatDto.chatType.int, amIChatAdmin, hasNotification,
notificationsCount, chatDto.muted, blocked=false, active = false, c.position, c.categoryId)
self.view.chatsModel().appendItem(channelItem)
@ -189,8 +189,8 @@ proc buildCommunityUI(self: Module, events: EventEmitter,
let amIChatAdmin = comm.admin
let channelItem = initSubItem(chatDto.id, cat.id, chatDto.name, chatDto.identicon,
isIdenticon=false, chatDto.color, chatDto.emoji, chatDto.description, chatDto.chatType.int,
let channelItem = initSubItem(chatDto.id, cat.id, chatDto.name, chatDto.icon,
chatDto.color, chatDto.emoji, chatDto.description, chatDto.chatType.int,
amIChatAdmin, hasNotification, notificationsCount, chatDto.muted, blocked=false,
active=false, c.position)
categoryChannels.add(channelItem)
@ -397,7 +397,7 @@ method addNewChat*(
let hasNotification = chatDto.unviewedMessagesCount > 0 or chatDto.unviewedMentionsCount > 0
let notificationsCount = chatDto.unviewedMentionsCount
var chatName = chatDto.name
var chatImage = chatDto.identicon
var chatImage = chatDto.icon
var colorHash: ColorHashDto = @[]
var isUsersListAvailable = true
if(chatDto.chatType == ChatType.OneToOne):
@ -426,7 +426,7 @@ method addNewChat*(
error "A category you're trying to add channel to doesn't exist", categoryId=chatDto.categoryId
return
let channelItem = initSubItem(chatDto.id, chatDto.categoryId, chatDto.name, chatDto.identicon,
let channelItem = initSubItem(chatDto.id, chatDto.categoryId, chatDto.name, chatDto.icon,
chatDto.color, chatDto.emoji, chatDto.description, chatDto.chatType.int,
amIChatAdmin, hasNotification, notificationsCount, chatDto.muted, blocked=false, active=false,
chatDto.position)
@ -460,7 +460,7 @@ method onCommunityCategoryCreated*(self: Module, cat: Category, chats: seq[ChatD
for chatDto in chats:
let hasNotification = chatDto.unviewedMessagesCount > 0 or chatDto.unviewedMentionsCount > 0
let notificationsCount = chatDto.unviewedMentionsCount
let channelItem = initSubItem(chatDto.id, cat.id, chatDto.name, chatDto.identicon,
let channelItem = initSubItem(chatDto.id, cat.id, chatDto.name, chatDto.icon,
chatDto.color, chatDto.emoji, chatDto.description, chatDto.chatType.int,
amIChatAdmin=true, hasNotification, notificationsCount, chatDto.muted, blocked=false,
active=false, chatDto.position)
@ -484,7 +484,7 @@ method onCommunityCategoryDeleted*(self: Module, cat: Category) =
let hasNotification = chatDto.unviewedMessagesCount > 0 or chatDto.unviewedMentionsCount > 0
let notificationsCount = chatDto.unviewedMentionsCount
let amIChatAdmin = self.controller.getMyCommunity().admin
let channelItem = initItem(chatDto.id, chatDto.name, chatDto.identicon,
let channelItem = initItem(chatDto.id, chatDto.name, chatDto.icon,
chatDto.color, chatDto.emoji, chatDto.description, chatDto.chatType.int, amIChatAdmin,
hasNotification, notificationsCount, chatDto.muted, false, active = false,
chatDto.position, categoryId="")
@ -523,13 +523,13 @@ method onCommunityCategoryEdited*(self: Module, cat: Category, chats: seq[ChatDt
categoryItem.subItems().removeItemById(chatDto.id)
if chatDto.categoryId == cat.id:
let channelItem = initSubItem(chatDto.id, cat.id, chatDto.name, chatDto.identicon,
let channelItem = initSubItem(chatDto.id, cat.id, chatDto.name, chatDto.icon,
chatDto.color, chatDto.emoji, chatDto.description, chatDto.chatType.int,
amIChatAdmin=true, hasNotification, notificationsCount, chatDto.muted, blocked=false,
active=false, chatDto.position)
categoryItem.prependSubItem(channelItem)
else:
let channelItem = initItem(chatDto.id, chatDto.name, chatDto.identicon,
let channelItem = initItem(chatDto.id, chatDto.name, chatDto.icon,
chatDto.color, chatDto.emoji, chatDto.description, chatDto.chatType.int, amIChatAdmin,
hasNotification, notificationsCount, chatDto.muted, blocked=false, active = false,
chatDto.position, categoryId="")

View File

@ -52,7 +52,7 @@ proc initModel(self: Module) =
let item = initItem(c.id, chatName, chatImage, c.color)
self.view.mutedContactsModel().addItem(item)
else:
let item = initItem(c.id, c.name, c.identicon, c.color)
let item = initItem(c.id, c.name, c.icon, c.color)
self.view.mutedChatsModel().addItem(item)
method viewDidLoad*(self: Module) =
@ -73,7 +73,7 @@ method onChatMuted*(self: Module, chatId: string) =
let item = initItem(chat.id, chatName, chatImage, chat.color)
self.view.mutedContactsModel().addItem(item)
else:
let item = initItem(chat.id, chat.name, chat.identicon, chat.color)
let item = initItem(chat.id, chat.name, chat.icon, chat.color)
self.view.mutedChatsModel().addItem(item)
method onChatUnmuted*(self: Module, chatId: string) =

View File

@ -136,7 +136,6 @@ proc prepareAccountJsonObject(self: Service, account: GeneratedAccountDto, displ
result = %* {
"name": if displayName == "": account.alias else: displayName,
"address": account.address,
"identicon": "",
"key-uid": account.keyUid,
"keycard-pairing": nil
}
@ -165,7 +164,6 @@ proc prepareSubaccountJsonObject(self: Service, account: GeneratedAccountDto, di
"public-key": account.derivedAccounts.whisper.publicKey,
"address": account.derivedAccounts.whisper.address,
"name": if displayName == "": account.alias else: displayName,
"identicon": "",
"path": PATH_WHISPER,
"chat": true
}
@ -198,7 +196,6 @@ proc prepareAccountSettingsJsonObject(self: Service, account: GeneratedAccountDt
"latest-derived-path": 0,
"networks/networks": DEFAULT_NETWORKS,
"currency": "usd",
"identicon": "",
"waku-enabled": true,
"wallet/visible-tokens": {
DEFAULT_NETWORK_NAME: ["SNT"]
@ -329,7 +326,7 @@ proc login*(self: Service, account: AccountDto, password: string): string =
},
}
let response = status_account.login(account.name, account.keyUid, hashedPassword, "", thumbnailImage,
let response = status_account.login(account.name, account.keyUid, hashedPassword, thumbnailImage,
largeImage, $nodeCfg)
var error = "response doesn't contain \"error\""

View File

@ -57,7 +57,7 @@ type ChatDto* = object
members*: seq[ChatMember]
#membershipUpdateEvents*: seq[ChatMembershipEvent] ???? It's always null and a question why do we need it here within this context ????
alias*: string
identicon*: string # is it identicon or image???
icon*: string
muted*: bool
communityId*: string #set if chat belongs to a community
profile*: string
@ -104,7 +104,7 @@ proc `$`*(self: ChatDto): string =
unviewedMentionsCount: {self.unviewedMentionsCount},
members: {self.members},
alias: {self.alias},
identicon: {self.identicon},
icon: {self.icon},
muted: {self.muted},
communityId: {self.communityId},
profile: {self.profile},
@ -168,7 +168,7 @@ proc toChatDto*(jsonObj: JsonNode): ChatDto =
discard jsonObj.getProp("unviewedMentionsCount", result.unviewedMentionsCount)
discard jsonObj.getProp("canPost", result.canPost)
discard jsonObj.getProp("alias", result.alias)
discard jsonObj.getProp("identicon", result.identicon)
discard jsonObj.getProp("identicon", result.icon)
discard jsonObj.getProp("muted", result.muted)
discard jsonObj.getProp("categoryId", result.categoryId)
if (result.categoryId == ""):

View File

@ -9,7 +9,7 @@ type PinnedMessageUpdateDto* = object
messageId*: string
localChatId*: string # not sure what's this and do we need this at all
pinnedBy*: string
identicon*: string # is it identicon or image???
icon*: string
alias*: string
clock*: int64
pinned*: bool
@ -21,7 +21,7 @@ proc toPinnedMessageUpdateDto*(jsonObj: JsonNode): PinnedMessageUpdateDto =
discard jsonObj.getProp("message_id", result.messageId)
discard jsonObj.getProp("localChatId", result.localChatId)
discard jsonObj.getProp("from", result.pinnedBy)
discard jsonObj.getProp("identicon", result.identicon)
discard jsonObj.getProp("identicon", result.icon)
discard jsonObj.getProp("alias", result.alias)
discard jsonObj.getProp("clock", result.clock)
discard jsonObj.getProp("pinned", result.pinned)

View File

@ -199,7 +199,7 @@ proc saveAccountAndLogin*(hashedPassword: string, account, subaccounts, settings
error "error doing rpc request", methodName = "saveAccountAndLogin", exception=e.msg
raise newException(RpcException, e.msg)
proc login*(name, keyUid, hashedPassword, identicon, thumbnail, large: string, nodeCfgObj: string):
proc login*(name, keyUid, hashedPassword, thumbnail, large: string, nodeCfgObj: string):
RpcResponse[JsonNode]
{.raises: [Exception].} =
try:
@ -207,7 +207,6 @@ proc login*(name, keyUid, hashedPassword, identicon, thumbnail, large: string, n
"name": name,
"key-uid": keyUid,
"identityImage": newJNull(),
"identicon": identicon
}
if(thumbnail.len>0 and large.len > 0):