refactor(@desktop/general): dto should not be `ref object`

This commit is contained in:
Sale Djenic 2021-10-28 13:04:12 +02:00 committed by Iuri Matias
parent 05cf431339
commit 4c96bc70ed
3 changed files with 8 additions and 10 deletions

View File

@ -132,9 +132,7 @@ method load*[T](self: Module[T]) =
echo "=> communitiesSection"
let communities = self.controller.getCommunities()
for c in communities:
self.view.addItem(initItem(c.id, SectionType.Community.int, c.name,
if not c.images.isNil: c.images.thumbnail else: "",
"", c.color, 0, 0))
self.view.addItem(initItem(c.id, SectionType.Community.int, c.name, c.images.thumbnail, "", c.color, 0, 0))
echo "=> chatSection"
self.chatSectionModule.load()

View File

@ -13,7 +13,7 @@ type ChatType* {.pure.}= enum
Timeline = 5
CommunityChat = 6
type ChatDto* = ref object
type ChatDto* = object
id*: string # ID is the id of the chat, for public chats it is the name e.g. status,
# for one-to-one is the hex encoded public key and for group chats is a random
# uuid appended with the hex encoded pk of the creator of the chat

View File

@ -5,15 +5,15 @@ import json
include ../../../common/json_utils
type
Permission* = ref object
Permission* = object
access*: int
type
Images* = ref object
Images* = object
thumbnail*: string
large*: string
type Chat* = ref object
type Chat* = object
id*: string
name*: string
color*: string
@ -25,16 +25,16 @@ type Chat* = ref object
position*: int
categoryId*: string
type Category* = ref object
type Category* = object
id*: string
name*: string
position*: int
type Member* = ref object
type Member* = object
id*: string
roles*: seq[int]
type CommunityDto* = ref object
type CommunityDto* = object
id*: string
admin*: bool
verified*: bool