|
@ -7,6 +7,7 @@ type
|
|||
icon: string
|
||||
isIdenticon: bool
|
||||
color: string
|
||||
emoji: string
|
||||
description: string
|
||||
hasUnreadMessages: bool
|
||||
notificationsCount: int
|
||||
|
@ -17,7 +18,7 @@ type
|
|||
categoryId: string
|
||||
highlight: bool
|
||||
|
||||
proc setup*(self: BaseItem, id, name, icon: string, isIdenticon: bool, color, description: string,
|
||||
proc setup*(self: BaseItem, id, name, icon: string, isIdenticon: bool, color, emoji, description: string,
|
||||
`type`: int, amIChatAdmin: bool, hasUnreadMessages: bool, notificationsCount: int, muted, blocked, active: bool,
|
||||
position: int, categoryId: string = "", highlight: bool = false) =
|
||||
self.id = id
|
||||
|
@ -26,6 +27,7 @@ proc setup*(self: BaseItem, id, name, icon: string, isIdenticon: bool, color, de
|
|||
self.icon = icon
|
||||
self.isIdenticon = isIdenticon
|
||||
self.color = color
|
||||
self.emoji = emoji
|
||||
self.description = description
|
||||
self.`type` = `type`
|
||||
self.hasUnreadMessages = hasUnreadMessages
|
||||
|
@ -37,12 +39,12 @@ proc setup*(self: BaseItem, id, name, icon: string, isIdenticon: bool, color, de
|
|||
self.categoryId = categoryId
|
||||
self.highlight = highlight
|
||||
|
||||
proc initBaseItem*(id, name, icon: string, isIdenticon: bool, color, description: string, `type`: int,
|
||||
proc initBaseItem*(id, name, icon: string, isIdenticon: bool, color, emoji, description: string, `type`: int,
|
||||
amIChatAdmin: bool, hasUnreadMessages: bool, notificationsCount: int, muted, blocked, active: bool,
|
||||
position: int, categoryId: string = "", highlight: bool = false): BaseItem =
|
||||
result = BaseItem()
|
||||
result.setup(id, name, icon, isIdenticon, color, description, `type`, amIChatAdmin, hasUnreadMessages,
|
||||
notificationsCount, muted, blocked, active, position, categoryId, highlight)
|
||||
result.setup(id, name, icon, isIdenticon, color, emoji, description, `type`, amIChatAdmin,
|
||||
hasUnreadMessages, notificationsCount, muted, blocked, active, position, categoryId, highlight)
|
||||
|
||||
proc delete*(self: BaseItem) =
|
||||
discard
|
||||
|
@ -74,6 +76,12 @@ method `isIdenticon=`*(self: var BaseItem, value: bool) {.inline base.} =
|
|||
method color*(self: BaseItem): string {.inline base.} =
|
||||
self.color
|
||||
|
||||
method emoji*(self: BaseItem): string {.inline base.} =
|
||||
self.emoji
|
||||
|
||||
method `emoji=`*(self: var BaseItem, value: string) {.inline base.} =
|
||||
self.emoji = value
|
||||
|
||||
method description*(self: BaseItem): string {.inline base.} =
|
||||
self.description
|
||||
|
||||
|
|
|
@ -13,6 +13,7 @@ QtObject:
|
|||
isIdenticon: bool
|
||||
color: string
|
||||
description: string
|
||||
emoji: string
|
||||
hasUnreadMessages: bool
|
||||
notificationsCount: int
|
||||
muted: bool
|
||||
|
@ -25,9 +26,9 @@ QtObject:
|
|||
new(result, delete)
|
||||
result.QObject.setup
|
||||
|
||||
proc setChatDetails*(self: ChatDetails, id: string, `type`: int, belongsToCommunity, isUsersListAvailable: bool,
|
||||
name, icon: string, isIdenticon: bool, color, description: string, hasUnreadMessages: bool,
|
||||
notificationsCount: int, muted: bool, position: int) =
|
||||
proc setChatDetails*(self: ChatDetails, id: string, `type`: int, belongsToCommunity,
|
||||
isUsersListAvailable: bool, name, icon: string, isIdenticon: bool, color, description,
|
||||
emoji: string, hasUnreadMessages: bool, notificationsCount: int, muted: bool, position: int) =
|
||||
self.id = id
|
||||
self.`type` = `type`
|
||||
self.belongsToCommunity = belongsToCommunity
|
||||
|
@ -36,6 +37,7 @@ QtObject:
|
|||
self.icon = icon
|
||||
self.isIdenticon = isIdenticon
|
||||
self.color = color
|
||||
self.emoji = emoji
|
||||
self.description = description
|
||||
self.hasUnreadMessages = hasUnreadMessages
|
||||
self.notificationsCount = notificationsCount
|
||||
|
@ -102,6 +104,17 @@ QtObject:
|
|||
self.color = value
|
||||
self.colorChanged()
|
||||
|
||||
proc emojiChanged(self: ChatDetails) {.signal.}
|
||||
proc getEmoji(self: ChatDetails): string {.slot.} =
|
||||
return self.emoji
|
||||
QtProperty[string] emoji:
|
||||
read = getEmoji
|
||||
notify = emojiChanged
|
||||
|
||||
proc setEmoji*(self: ChatDetails, value: string) = # this is not a slot
|
||||
self.emoji = value
|
||||
self.emojiChanged()
|
||||
|
||||
proc descriptionChanged(self: ChatDetails) {.signal.}
|
||||
proc getDescription(self: ChatDetails): string {.slot.} =
|
||||
return self.description
|
||||
|
|
|
@ -81,7 +81,7 @@ method load*(self: Module) =
|
|||
|
||||
self.view.load(chatDto.id, chatDto.chatType.int, self.controller.belongsToCommunity(),
|
||||
self.controller.isUsersListAvailable(), chatName, chatImage, isIdenticon,
|
||||
chatDto.color, chatDto.description, hasNotification, notificationsCount,
|
||||
chatDto.color, chatDto.description, chatDto.emoji, hasNotification, notificationsCount,
|
||||
chatDto.muted, chatDto.position)
|
||||
|
||||
self.inputAreaModule.load()
|
||||
|
@ -326,7 +326,7 @@ method onNotificationsUpdated*(self: Module, hasUnreadMessages: bool, notificati
|
|||
self.view.updateChatDetailsNotifications(hasUnreadMessages, notificationCount)
|
||||
|
||||
method onChatEdited*(self: Module, chatDto: ChatDto) =
|
||||
self.view.updateChatDetails(chatDto.name, chatDto.description)
|
||||
self.view.updateChatDetails(chatDto.name, chatDto.description, chatDto.emoji)
|
||||
self.messagesModule.updateChatIdentifier()
|
||||
|
||||
method onChatRenamed*(self: Module, newName: string) =
|
||||
|
|
|
@ -31,10 +31,10 @@ QtObject:
|
|||
result.chatDetailsVariant = newQVariant(result.chatDetails)
|
||||
|
||||
proc load*(self: View, id: string, `type`: int, belongsToCommunity, isUsersListAvailable: bool,
|
||||
name, icon: string, isIdenticon: bool, color, description: string, hasUnreadMessages: bool,
|
||||
notificationsCount: int, muted: bool, position: int) =
|
||||
name, icon: string, isIdenticon: bool, color, description, emoji: string,
|
||||
hasUnreadMessages: bool, notificationsCount: int, muted: bool, position: int) =
|
||||
self.chatDetails.setChatDetails(id, `type`, belongsToCommunity, isUsersListAvailable, name, icon,
|
||||
isIdenticon, color, description, hasUnreadMessages, notificationsCount, muted, position)
|
||||
isIdenticon, color, description, emoji, hasUnreadMessages, notificationsCount, muted, position)
|
||||
self.delegate.viewDidLoad()
|
||||
self.chatDetailsChanged()
|
||||
|
||||
|
@ -111,9 +111,10 @@ QtObject:
|
|||
proc amIChatAdmin*(self: View): bool {.slot.} =
|
||||
return self.delegate.amIChatAdmin()
|
||||
|
||||
proc updateChatDetails*(self: View, name, description: string) =
|
||||
proc updateChatDetails*(self: View, name, description, emoji: string) =
|
||||
self.chatDetails.setName(name)
|
||||
self.chatDetails.setDescription(description)
|
||||
self.chatDetails.setEmoji(emoji)
|
||||
self.chatDetailsChanged()
|
||||
|
||||
proc updateChatDetailsName*(self: View, name: string) =
|
||||
|
|
|
@ -317,14 +317,16 @@ method createCommunityChannel*(
|
|||
self: Controller,
|
||||
name: string,
|
||||
description: string,
|
||||
emoji: string,
|
||||
categoryId: string) =
|
||||
self.communityService.createCommunityChannel(self.sectionId, name, description, categoryId)
|
||||
self.communityService.createCommunityChannel(self.sectionId, name, description, emoji, categoryId)
|
||||
|
||||
method editCommunityChannel*(
|
||||
self: Controller,
|
||||
channelId: string,
|
||||
name: string,
|
||||
description: string,
|
||||
emoji: string,
|
||||
categoryId: string,
|
||||
position: int) =
|
||||
self.communityService.editCommunityChannel(
|
||||
|
@ -332,6 +334,7 @@ method editCommunityChannel*(
|
|||
channelId,
|
||||
name,
|
||||
description,
|
||||
emoji,
|
||||
categoryId,
|
||||
position)
|
||||
|
||||
|
|
|
@ -119,10 +119,10 @@ method acceptRequestToJoinCommunity*(self: AccessInterface, requestId: string) {
|
|||
method declineRequestToJoinCommunity*(self: AccessInterface, requestId: string) {.base.} =
|
||||
raise newException(ValueError, "No implementation available")
|
||||
|
||||
method createCommunityChannel*(self: AccessInterface, name: string, description: string, categoryId: string) {.base.} =
|
||||
method createCommunityChannel*(self: AccessInterface, name: string, description: string, emoji: string, categoryId: string) {.base.} =
|
||||
raise newException(ValueError, "No implementation available")
|
||||
|
||||
method editCommunityChannel*(self: AccessInterface, channelId: string, name: string, description: string, categoryId: string, position: int) {.base.} =
|
||||
method editCommunityChannel*(self: AccessInterface, channelId: string, name: string, description: string, emoji: string, categoryId: string, position: int) {.base.} =
|
||||
raise newException(ValueError, "No implementation available")
|
||||
|
||||
method createCommunityCategory*(self: AccessInterface, name: string, channels: seq[string]) {.base.} =
|
||||
|
|
|
@ -5,10 +5,11 @@ type
|
|||
Item* = ref object of BaseItem
|
||||
subItems: SubModel
|
||||
|
||||
proc initItem*(id, name, icon: string, isIdenticon: bool, color, description: string, `type`: int, amIChatAdmin: bool,
|
||||
hasUnreadMessages: bool, notificationsCount: int, muted, blocked, active: bool, position: int, categoryId: string, highlight: bool = false): Item =
|
||||
proc initItem*(id, name, icon: string, isIdenticon: bool, color, emoji, description: string,
|
||||
`type`: int, amIChatAdmin: bool, hasUnreadMessages: bool, notificationsCount: int, muted,
|
||||
blocked, active: bool, position: int, categoryId: string, highlight: bool = false): Item =
|
||||
result = Item()
|
||||
result.setup(id, name, icon, isIdenticon, color, description, `type`, amIChatAdmin, hasUnreadMessages,
|
||||
result.setup(id, name, icon, isIdenticon, color, emoji, description, `type`, amIChatAdmin, hasUnreadMessages,
|
||||
notificationsCount, muted, blocked, active, position, categoryId, highlight)
|
||||
result.subItems = newSubModel()
|
||||
|
||||
|
@ -27,6 +28,7 @@ proc `$`*(self: Item): string =
|
|||
icon: {self.icon},
|
||||
isIdenticon: {self.isIdenticon},
|
||||
color: {self.color},
|
||||
emoji: {self.emoji},
|
||||
description: {self.description},
|
||||
type: {self.`type`},
|
||||
hasUnreadMessages: {self.hasUnreadMessages},
|
||||
|
@ -49,6 +51,7 @@ proc toJsonNode*(self: Item): JsonNode =
|
|||
"icon": self.icon,
|
||||
"isIdenticon": self.isIdenticon,
|
||||
"color": self.color,
|
||||
"emoji": self.emoji,
|
||||
"description": self.description,
|
||||
"type": self.`type`,
|
||||
"hasUnreadMessages": self.hasUnreadMessages,
|
||||
|
|
|
@ -10,6 +10,7 @@ type
|
|||
Icon
|
||||
IsIdenticon
|
||||
Color
|
||||
Emoji
|
||||
Description
|
||||
Type
|
||||
HasUnreadMessages
|
||||
|
@ -76,6 +77,7 @@ QtObject:
|
|||
ModelRole.Icon.int:"icon",
|
||||
ModelRole.IsIdenticon.int:"isIdenticon",
|
||||
ModelRole.Color.int:"color",
|
||||
ModelRole.Emoji.int:"emoji",
|
||||
ModelRole.Description.int:"description",
|
||||
ModelRole.Type.int:"type",
|
||||
ModelRole.HasUnreadMessages.int:"hasUnreadMessages",
|
||||
|
@ -113,6 +115,8 @@ QtObject:
|
|||
result = newQVariant(item.isIdenticon)
|
||||
of ModelRole.Color:
|
||||
result = newQVariant(item.color)
|
||||
of ModelRole.Emoji:
|
||||
result = newQVariant(item.emoji)
|
||||
of ModelRole.Description:
|
||||
result = newQVariant(item.description)
|
||||
of ModelRole.Type:
|
||||
|
@ -268,14 +272,16 @@ QtObject:
|
|||
self.dataChanged(index, index, @[ModelRole.Name.int])
|
||||
return
|
||||
|
||||
proc updateItemDetails*(self: Model, id, name, description: string) =
|
||||
proc updateItemDetails*(self: Model, id, name, description, emoji: string) =
|
||||
## This updates only first level items, it doesn't update subitems, since subitems cannot have custom icon.
|
||||
for i in 0 ..< self.items.len:
|
||||
if(self.items[i].id == id):
|
||||
self.items[i].BaseItem.name = name
|
||||
self.items[i].BaseItem.description = description
|
||||
self.items[i].BaseItem.emoji = emoji
|
||||
let index = self.createIndex(i, 0, nil)
|
||||
self.dataChanged(index, index, @[ModelRole.Name.int, ModelRole.Description.int])
|
||||
self.dataChanged(index, index,
|
||||
@[ModelRole.Name.int, ModelRole.Description.int, ModelRole.Emoji.int])
|
||||
return
|
||||
|
||||
proc updateNotificationsForItemOrSubItemById*(self: Model, id: string, hasUnreadMessages: bool,
|
||||
|
|
|
@ -125,8 +125,9 @@ proc buildChatUI(self: Module, events: EventEmitter,
|
|||
|
||||
let amIChatAdmin = self.amIMarkedAsAdminUser(c.members)
|
||||
|
||||
let item = initItem(c.id, chatName, chatImage, isIdenticon, c.color, c.description, c.chatType.int, amIChatAdmin,
|
||||
hasNotification, notificationsCount, c.muted, blocked, active=false, c.position, c.categoryId)
|
||||
let item = initItem(c.id, chatName, chatImage, isIdenticon, c.color, c.emoji, c.description,
|
||||
c.chatType.int, amIChatAdmin, hasNotification, notificationsCount, c.muted, blocked,
|
||||
active=false, c.position, c.categoryId)
|
||||
self.view.chatsModel().appendItem(item)
|
||||
self.addSubmodule(c.id, false, isUsersListAvailable, events, settingsService, contactService, chatService,
|
||||
communityService, messageService, gifService, mailserversService)
|
||||
|
@ -161,8 +162,8 @@ proc buildCommunityUI(self: Module, events: EventEmitter,
|
|||
let notificationsCount = chatDto.unviewedMentionsCount
|
||||
let amIChatAdmin = comm.admin
|
||||
let channelItem = initItem(chatDto.id, chatDto.name, chatDto.identicon, false, chatDto.color,
|
||||
chatDto.description, chatDto.chatType.int, amIChatAdmin, hasNotification, notificationsCount,
|
||||
chatDto.muted, blocked=false, active = false, c.position, c.categoryId)
|
||||
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)
|
||||
self.addSubmodule(chatDto.id, true, true, events, settingsService, contactService, chatService, communityService,
|
||||
messageService, gifService, mailserversService)
|
||||
|
@ -190,9 +191,10 @@ proc buildCommunityUI(self: Module, events: EventEmitter,
|
|||
|
||||
let amIChatAdmin = comm.admin
|
||||
|
||||
let channelItem = initSubItem(chatDto.id, cat.id, chatDto.name, chatDto.identicon, false, chatDto.color,
|
||||
chatDto.description, chatDto.chatType.int, amIChatAdmin, hasNotification, notificationsCount, chatDto.muted,
|
||||
blocked=false, active=false, c.position)
|
||||
let channelItem = initSubItem(chatDto.id, cat.id, chatDto.name, chatDto.identicon,
|
||||
isIdenticon=false, chatDto.color, chatDto.emoji, chatDto.description, chatDto.chatType.int,
|
||||
amIChatAdmin, hasNotification, notificationsCount, chatDto.muted, blocked=false,
|
||||
active=false, c.position)
|
||||
categoryChannels.add(channelItem)
|
||||
self.addSubmodule(chatDto.id, true, true, events, settingsService, contactService, chatService, communityService,
|
||||
messageService, gifService, mailserversService)
|
||||
|
@ -203,8 +205,9 @@ proc buildCommunityUI(self: Module, events: EventEmitter,
|
|||
selectedItemId = cat.id
|
||||
selectedSubItemId = channelItem.id
|
||||
|
||||
var categoryItem = initItem(cat.id, cat.name, "", false, "", "", ChatType.Unknown.int, false,
|
||||
hasNotificationPerCategory, notificationsCountPerCategory, muted=false, blocked=false, active=false,
|
||||
var categoryItem = initItem(cat.id, cat.name, icon="", isIdenticon=false, color="", emoji="",
|
||||
description="", ChatType.Unknown.int, amIChatAdmin=false, hasNotificationPerCategory,
|
||||
notificationsCountPerCategory, muted=false, blocked=false, active=false,
|
||||
cat.position, cat.id)
|
||||
categoryItem.prependSubItems(categoryChannels)
|
||||
self.view.chatsModel().appendItem(categoryItem)
|
||||
|
@ -414,9 +417,9 @@ method addNewChat*(
|
|||
amIChatAdmin = self.amIMarkedAsAdminUser(chatDto.members)
|
||||
|
||||
if chatDto.categoryId.len == 0:
|
||||
let item = initItem(chatDto.id, chatName, chatImage, isIdenticon, chatDto.color, chatDto.description,
|
||||
chatDto.chatType.int, amIChatAdmin, hasNotification, notificationsCount, chatDto.muted,
|
||||
blocked=false, active=false, position = 0, chatDto.categoryId, chatDto.highlight)
|
||||
let item = initItem(chatDto.id, chatName, chatImage, isIdenticon, chatDto.color, chatDto.emoji,
|
||||
chatDto.description, chatDto.chatType.int, amIChatAdmin, hasNotification, notificationsCount,
|
||||
chatDto.muted, blocked=false, active=false, position = 0, chatDto.categoryId, chatDto.highlight)
|
||||
self.addSubmodule(chatDto.id, belongsToCommunity, isUsersListAvailable, events, settingsService, contactService, chatService,
|
||||
communityService, messageService, gifService, mailserversService)
|
||||
self.chatContentModules[chatDto.id].load()
|
||||
|
@ -429,9 +432,10 @@ 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, false, chatDto.color,
|
||||
chatDto.description, chatDto.chatType.int, amIChatAdmin, hasNotification, notificationsCount, chatDto.muted,
|
||||
blocked=false, active=false, chatDto.position)
|
||||
let channelItem = initSubItem(chatDto.id, chatDto.categoryId, chatDto.name, chatDto.identicon,
|
||||
isIdenticon=false, chatDto.color, chatDto.emoji, chatDto.description, chatDto.chatType.int,
|
||||
amIChatAdmin, hasNotification, notificationsCount, chatDto.muted, blocked=false, active=false,
|
||||
chatDto.position)
|
||||
self.addSubmodule(chatDto.id, belongsToCommunity, isUsersListAvailable, events, settingsService, contactService, chatService,
|
||||
communityService, messageService, gifService, mailserversService)
|
||||
self.chatContentModules[chatDto.id].load()
|
||||
|
@ -455,15 +459,17 @@ method removeCommunityChat*(self: Module, chatId: string) =
|
|||
method onCommunityCategoryCreated*(self: Module, cat: Category, chats: seq[ChatDto]) =
|
||||
if (self.doesCatOrChatExist(cat.id)):
|
||||
return
|
||||
var categoryItem = initItem(cat.id, cat.name, "", false, "", "", ChatType.Unknown.int, false,
|
||||
false, 0, muted=false, blocked=false, active=false, cat.position, cat.id)
|
||||
var categoryItem = initItem(cat.id, cat.name, icon="", isIdenticon=false, color="", emoji="",
|
||||
description="", ChatType.Unknown.int, amIChatAdmin=false, hasUnreadMessages=false,
|
||||
notificationsCount=0, muted=false, blocked=false, active=false, cat.position, cat.id)
|
||||
var categoryChannels: seq[SubItem]
|
||||
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, false, chatDto.color,
|
||||
chatDto.description, chatDto.chatType.int, true, hasNotification, notificationsCount, chatDto.muted,
|
||||
blocked=false, active=false, chatDto.position)
|
||||
let channelItem = initSubItem(chatDto.id, cat.id, chatDto.name, chatDto.identicon,
|
||||
isIdenticon=false, chatDto.color, chatDto.emoji, chatDto.description, chatDto.chatType.int,
|
||||
amIChatAdmin=true, hasNotification, notificationsCount, chatDto.muted, blocked=false,
|
||||
active=false, chatDto.position)
|
||||
|
||||
# Important:
|
||||
# Since we're just adding an already added community channel to a certain community, there is no need to call
|
||||
|
@ -484,9 +490,10 @@ 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, false, chatDto.color,
|
||||
chatDto.description, chatDto.chatType.int, amIChatAdmin, hasNotification, notificationsCount,
|
||||
chatDto.muted, false, active = false, chatDto.position, "")
|
||||
let channelItem = initItem(chatDto.id, chatDto.name, chatDto.identicon, isIdenticon=false,
|
||||
chatDto.color, chatDto.emoji, chatDto.description, chatDto.chatType.int, amIChatAdmin,
|
||||
hasNotification, notificationsCount, chatDto.muted, false, active = false,
|
||||
chatDto.position, categoryId="")
|
||||
self.view.chatsModel().appendItem(channelItem)
|
||||
|
||||
self.view.chatsModel().removeItemById(cat.id)
|
||||
|
@ -511,14 +518,16 @@ 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, false, chatDto.color,
|
||||
chatDto.description, chatDto.chatType.int, true, hasNotification, notificationsCount, chatDto.muted,
|
||||
false, false, chatDto.position)
|
||||
let channelItem = initSubItem(chatDto.id, cat.id, chatDto.name, chatDto.identicon,
|
||||
isIdenticon=false, 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, false, chatDto.color,
|
||||
chatDto.description, chatDto.chatType.int, amIChatAdmin, hasNotification, notificationsCount,
|
||||
chatDto.muted, false, active = false, chatDto.position, "")
|
||||
let channelItem = initItem(chatDto.id, chatDto.name, chatDto.identicon, isIdenticon=false,
|
||||
chatDto.color, chatDto.emoji, chatDto.description, chatDto.chatType.int, amIChatAdmin,
|
||||
hasNotification, notificationsCount, chatDto.muted, blocked=false, active = false,
|
||||
chatDto.position, categoryId="")
|
||||
self.view.chatsModel().appendItem(channelItem)
|
||||
|
||||
method onCommunityChannelDeletedOrChatLeft*(self: Module, chatId: string) =
|
||||
|
@ -541,7 +550,7 @@ method onCommunityChannelDeletedOrChatLeft*(self: Module, chatId: string) =
|
|||
method onCommunityChannelEdited*(self: Module, chat: ChatDto) =
|
||||
if(not self.chatContentModules.contains(chat.id)):
|
||||
return
|
||||
self.view.chatsModel().updateItemDetails(chat.id, chat.name, chat.description)
|
||||
self.view.chatsModel().updateItemDetails(chat.id, chat.name, chat.description, chat.emoji)
|
||||
|
||||
method createOneToOneChat*(self: Module, chatId: string, ensName: string) =
|
||||
if(self.controller.isCommunity()):
|
||||
|
@ -683,12 +692,12 @@ method acceptRequestToJoinCommunity*(self: Module, requestId: string) =
|
|||
method declineRequestToJoinCommunity*(self: Module, requestId: string) =
|
||||
self.controller.declineRequestToJoinCommunity(requestId)
|
||||
|
||||
method createCommunityChannel*(self: Module, name, description, categoryId: string) =
|
||||
self.controller.createCommunityChannel(name, description, categoryId)
|
||||
method createCommunityChannel*(self: Module, name, description, emoji, categoryId: string) =
|
||||
self.controller.createCommunityChannel(name, description, emoji, categoryId)
|
||||
|
||||
method editCommunityChannel*(self: Module, channelId, name, description, categoryId: string,
|
||||
position: int) =
|
||||
self.controller.editCommunityChannel(channelId, name, description, categoryId, position)
|
||||
method editCommunityChannel*(self: Module, channelId, name, description, emoji, categoryId: string,
|
||||
position: int) =
|
||||
self.controller.editCommunityChannel(channelId, name, description, emoji, categoryId, position)
|
||||
|
||||
method createCommunityCategory*(self: Module, name: string, channels: seq[string]) =
|
||||
self.controller.createCommunityCategory(name, channels)
|
||||
|
@ -726,15 +735,17 @@ method prepareEditCategoryModel*(self: Module, categoryId: string) =
|
|||
let chats = self.controller.getChats(communityId, "")
|
||||
for chat in chats:
|
||||
let c = self.controller.getChatDetails(communityId, chat.id)
|
||||
let item = initItem(c.id, c.name, "", false, c.color, c.description, c.chatType.int, false,
|
||||
false, 0, c.muted, false, active = false, c.position, "")
|
||||
let item = initItem(c.id, c.name, icon="", isIdenticon=false, c.color, c.emoji, c.description,
|
||||
c.chatType.int, amIChatAdmin=false, hasUnreadMessages=false, notificationsCount=0, c.muted,
|
||||
blocked=false, active=false, c.position, categoryId="")
|
||||
|
||||
self.view.editCategoryChannelsModel().appendItem(item)
|
||||
let catChats = self.controller.getChats(communityId, categoryId)
|
||||
for chat in catChats:
|
||||
let c = self.controller.getChatDetails(communityId, chat.id)
|
||||
let item = initItem(c.id, c.name, "", false, c.color, c.description, c.chatType.int, false,
|
||||
false, 0, c.muted, false, active = false, c.position, categoryId)
|
||||
let item = initItem(c.id, c.name, icon="", isIdenticon=false, c.color, c.emoji, c.description,
|
||||
c.chatType.int, amIChatAdmin=false, hasUnreadMessages=false, notificationsCount=0, c.muted,
|
||||
blocked=false, active=false, c.position, categoryId)
|
||||
self.view.editCategoryChannelsModel().appendItem(item)
|
||||
|
||||
method reorderCommunityCategories*(self: Module, categoryId: string, position: int) =
|
||||
|
|
|
@ -94,10 +94,10 @@ method acceptRequestToJoinCommunity*(self: AccessInterface, requestId: string) {
|
|||
method declineRequestToJoinCommunity*(self: AccessInterface, requestId: string) {.base.} =
|
||||
raise newException(ValueError, "No implementation available")
|
||||
|
||||
method createCommunityChannel*(self: AccessInterface, name: string, description: string, categoryId: string) {.base.} =
|
||||
method createCommunityChannel*(self: AccessInterface, name: string, description: string, emoji: string, categoryId: string) {.base.} =
|
||||
raise newException(ValueError, "No implementation available")
|
||||
|
||||
method editCommunityChannel*(self: AccessInterface, channelId, name, description, categoryId: string, position: int) {.base.} =
|
||||
method editCommunityChannel*(self: AccessInterface, channelId, name, description, emoji, categoryId: string, position: int) {.base.} =
|
||||
raise newException(ValueError, "No implementation available")
|
||||
|
||||
method leaveCommunity*(self: AccessInterface) {.base.} =
|
||||
|
|
|
@ -7,11 +7,12 @@ type
|
|||
SubItem* = ref object of BaseItem
|
||||
parentId: string
|
||||
|
||||
proc initSubItem*(id, parentId, name, icon: string, isIdenticon: bool, color, description: string, `type`: int,
|
||||
amIChatAdmin: bool, hasUnreadMessages: bool, notificationsCount: int, muted, blocked, active: bool, position: int): SubItem =
|
||||
proc initSubItem*(id, parentId, name, icon: string, isIdenticon: bool, color, emoji, description: string,
|
||||
`type`: int, amIChatAdmin: bool, hasUnreadMessages: bool, notificationsCount: int, muted, blocked,
|
||||
active: bool, position: int): SubItem =
|
||||
result = SubItem()
|
||||
result.setup(id, name, icon, isIdenticon, color, description, `type`, amIChatAdmin, hasUnreadMessages,
|
||||
notificationsCount, muted, blocked, active, position)
|
||||
result.setup(id, name, icon, isIdenticon, color, emoji, description, `type`, amIChatAdmin,
|
||||
hasUnreadMessages, notificationsCount, muted, blocked, active, position)
|
||||
result.parentId = parentId
|
||||
|
||||
proc delete*(self: SubItem) =
|
||||
|
@ -29,6 +30,7 @@ proc `$`*(self: SubItem): string =
|
|||
icon: {self.icon},
|
||||
isIdenticon: {self.isIdenticon},
|
||||
color: {self.color},
|
||||
emoji: {self.emoji},
|
||||
description: {self.description},
|
||||
type: {self.`type`},
|
||||
hasUnreadMessages: {self.hasUnreadMessages},
|
||||
|
@ -47,6 +49,7 @@ proc toJsonNode*(self: SubItem): JsonNode =
|
|||
"icon": self.icon,
|
||||
"isIdenticon": self.isIdenticon,
|
||||
"color": self.color,
|
||||
"emoji": self.emoji,
|
||||
"description": self.description,
|
||||
"type": self.`type`,
|
||||
"hasUnreadMessages": self.hasUnreadMessages,
|
||||
|
|
|
@ -11,6 +11,7 @@ type
|
|||
Icon
|
||||
IsIdenticon
|
||||
Color
|
||||
Emoji
|
||||
Description
|
||||
Type
|
||||
HasUnreadMessages
|
||||
|
@ -69,6 +70,7 @@ QtObject:
|
|||
ModelRole.Icon.int:"icon",
|
||||
ModelRole.IsIdenticon.int:"isIdenticon",
|
||||
ModelRole.Color.int:"color",
|
||||
ModelRole.Emoji.int:"emoji",
|
||||
ModelRole.Description.int:"description",
|
||||
ModelRole.Type.int:"type",
|
||||
ModelRole.HasUnreadMessages.int:"hasUnreadMessages",
|
||||
|
@ -104,6 +106,8 @@ QtObject:
|
|||
result = newQVariant(item.isIdenticon)
|
||||
of ModelRole.Color:
|
||||
result = newQVariant(item.color)
|
||||
of ModelRole.Emoji:
|
||||
result = newQVariant(item.emoji)
|
||||
of ModelRole.Description:
|
||||
result = newQVariant(item.description)
|
||||
of ModelRole.Type:
|
||||
|
|
|
@ -208,14 +208,21 @@ QtObject:
|
|||
proc declineRequestToJoinCommunity*(self: View, requestId: string) {.slot.} =
|
||||
self.delegate.declineRequestToJoinCommunity(requestId)
|
||||
|
||||
proc createCommunityChannel*(self: View, name: string, description: string, categoryId: string) {.slot.} =
|
||||
self.delegate.createCommunityChannel(name, description, categoryId)
|
||||
proc createCommunityChannel*(
|
||||
self: View,
|
||||
name: string,
|
||||
description: string,
|
||||
emoji: string,
|
||||
categoryId: string
|
||||
) {.slot.} =
|
||||
self.delegate.createCommunityChannel(name, description, emoji, categoryId)
|
||||
|
||||
proc editCommunityChannel*(
|
||||
self: View,
|
||||
channelId: string,
|
||||
name: string,
|
||||
description: string,
|
||||
emoji: string,
|
||||
categoryId: string,
|
||||
position: int
|
||||
) {.slot.} =
|
||||
|
@ -223,6 +230,7 @@ QtObject:
|
|||
channelId,
|
||||
name,
|
||||
description,
|
||||
emoji,
|
||||
categoryId,
|
||||
position
|
||||
)
|
||||
|
|
|
@ -24,7 +24,7 @@ type ChatDto* = object
|
|||
name*: string
|
||||
description*: string
|
||||
color*: string
|
||||
emoji*: string # not sure why do we receive this at all?
|
||||
emoji*: string
|
||||
active*: bool # indicates whether the chat has been soft deleted
|
||||
chatType*: ChatType
|
||||
timestamp*: int64 # indicates the last time this chat has received/sent a message
|
||||
|
|
|
@ -432,7 +432,7 @@ QtObject:
|
|||
for k, chat in updatedCommunity.chats:
|
||||
let fullChatId = communityId & chat.id
|
||||
let currentChat = self.chatService.getChatById(fullChatId, showWarning = false)
|
||||
echo currentChat
|
||||
|
||||
if (currentChat.id != ""):
|
||||
# The chat service already knows that about that chat
|
||||
continue
|
||||
|
@ -580,9 +580,10 @@ QtObject:
|
|||
communityId: string,
|
||||
name: string,
|
||||
description: string,
|
||||
emoji: string,
|
||||
categoryId: string) =
|
||||
try:
|
||||
let response = status_go.createCommunityChannel(communityId, name, description, categoryId)
|
||||
let response = status_go.createCommunityChannel(communityId, name, description, emoji, categoryId)
|
||||
|
||||
if not response.error.isNil:
|
||||
let error = Json.decode($response.error, RpcError)
|
||||
|
@ -609,6 +610,7 @@ QtObject:
|
|||
channelId: string,
|
||||
name: string,
|
||||
description: string,
|
||||
emoji: string,
|
||||
categoryId: string,
|
||||
position: int) =
|
||||
try:
|
||||
|
@ -617,6 +619,7 @@ QtObject:
|
|||
channelId,
|
||||
name,
|
||||
description,
|
||||
emoji,
|
||||
categoryId,
|
||||
position)
|
||||
|
||||
|
|
|
@ -84,6 +84,7 @@ proc createCommunityChannel*(
|
|||
communityId: string,
|
||||
name: string,
|
||||
description: string,
|
||||
emoji: string,
|
||||
categoryId: string
|
||||
): RpcResponse[JsonNode] {.raises: [Exception].} =
|
||||
result = callPrivateRPC("createCommunityChat".prefix, %*[
|
||||
|
@ -94,16 +95,9 @@ proc createCommunityChannel*(
|
|||
},
|
||||
"identity": {
|
||||
"display_name": name,
|
||||
"description": description#,
|
||||
# "color": color#,
|
||||
# TODO add images once it is supported by Status-Go
|
||||
# "images": [
|
||||
# {
|
||||
# "payload": image,
|
||||
# # TODO get that from an enum
|
||||
# "image_type": 1 # 1 is a raw payload
|
||||
# }
|
||||
# ]
|
||||
"description": description,
|
||||
"emoji": emoji#,
|
||||
# "color": color#
|
||||
},
|
||||
"category_id": categoryId
|
||||
}])
|
||||
|
@ -113,6 +107,7 @@ proc editCommunityChannel*(
|
|||
channelId: string,
|
||||
name: string,
|
||||
description: string,
|
||||
emoji: string,
|
||||
categoryId: string,
|
||||
position: int
|
||||
): RpcResponse[JsonNode] {.raises: [Exception].} =
|
||||
|
@ -125,16 +120,9 @@ proc editCommunityChannel*(
|
|||
},
|
||||
"identity": {
|
||||
"display_name": name,
|
||||
"description": description#,
|
||||
# "color": color#,
|
||||
# TODO add images once it is supported by Status-Go
|
||||
# "images": [
|
||||
# {
|
||||
# "payload": image,
|
||||
# # TODO get that from an enum
|
||||
# "image_type": 1 # 1 is a raw payload
|
||||
# }
|
||||
# ]
|
||||
"description": description,
|
||||
"emoji": emoji#,
|
||||
# "color": color
|
||||
},
|
||||
"category_id": categoryId,
|
||||
"position": position
|
||||
|
|
|
@ -1 +1 @@
|
|||
Subproject commit c3c0ac64d50268cd35b84f1c73184d4b7b7e9a5f
|
||||
Subproject commit 381150a7b55d53b3cb59d9ee2c4f50985488c708
|
|
@ -31,6 +31,7 @@ StatusAppThreePanelLayout {
|
|||
}
|
||||
|
||||
property Component pinnedMessagesListPopupComponent
|
||||
property var emojiPopup
|
||||
property bool stickersLoaded: false
|
||||
signal profileButtonClicked()
|
||||
signal openAppSearch()
|
||||
|
@ -63,6 +64,7 @@ StatusAppThreePanelLayout {
|
|||
chatSectionModule: root.rootStore.chatCommunitySectionModule
|
||||
pinnedMessagesPopupComponent: root.pinnedMessagesListPopupComponent
|
||||
stickersLoaded: root.stickersLoaded
|
||||
emojiPopup: root.emojiPopup
|
||||
//chatGroupsListViewCount: contactColumnLoader.item.chatGroupsListViewCount
|
||||
onOpenStickerPackPopup: {
|
||||
Global.openPopup(statusStickerPackClickPopup, {packId: stickerPackId} )
|
||||
|
@ -113,6 +115,7 @@ StatusAppThreePanelLayout {
|
|||
chatSectionModule: root.rootStore.chatCommunitySectionModule
|
||||
store: root.rootStore
|
||||
contactsStore: root.contactsStore
|
||||
emojiPopup: root.emojiPopup
|
||||
onOpenProfileClicked: {
|
||||
root.profileButtonClicked();
|
||||
}
|
||||
|
@ -128,6 +131,7 @@ StatusAppThreePanelLayout {
|
|||
CommunityColumnView {
|
||||
communitySectionModule: root.rootStore.chatCommunitySectionModule
|
||||
store: root.rootStore
|
||||
emojiPopup: root.emojiPopup
|
||||
hasAddedContacts: root.hasAddedContacts
|
||||
pinnedMessagesPopupComponent: root.pinnedMessagesListPopupComponent
|
||||
}
|
||||
|
|
|
@ -9,6 +9,7 @@ import shared.panels 1.0
|
|||
|
||||
import StatusQ.Components 0.1
|
||||
import StatusQ.Core 0.1
|
||||
import StatusQ.Core.Utils 0.1 as StatusQUtils
|
||||
|
||||
Item {
|
||||
id: channelBadge
|
||||
|
@ -52,7 +53,7 @@ Item {
|
|||
StyledText {
|
||||
id: contactInfo
|
||||
text: realChatType !== Constants.chatType.publicChat ?
|
||||
Emoji.parse(Utils.removeStatusEns(Utils.filterXSS(name))) :
|
||||
StatusQUtils.Emoji.parse(Utils.removeStatusEns(Utils.filterXSS(name))) :
|
||||
"#" + Utils.filterXSS(name)
|
||||
anchors.left: contactImage.right
|
||||
anchors.leftMargin: 4
|
||||
|
|
|
@ -7,6 +7,8 @@ import utils 1.0
|
|||
import shared.controls 1.0
|
||||
import shared.panels 1.0
|
||||
|
||||
import StatusQ.Core.Utils 0.1 as StatusQUtils
|
||||
|
||||
Item {
|
||||
id: replyComponent
|
||||
|
||||
|
@ -27,7 +29,7 @@ Item {
|
|||
}
|
||||
|
||||
StyledTextEdit {
|
||||
text: Utils.getReplyMessageStyle(Emoji.parse(Utils.linkifyAndXSS(repliedMessageContent), Emoji.size.small), false)
|
||||
text: Utils.getReplyMessageStyle(StatusQUtils.Emoji.parse(Utils.linkifyAndXSS(repliedMessageContent), StatusQUtils.Emoji.size.small), false)
|
||||
textFormat: Text.RichText
|
||||
height: 18
|
||||
width: implicitWidth > 300 ? 300 : implicitWidth
|
||||
|
|
|
@ -5,6 +5,7 @@ import utils 1.0
|
|||
|
||||
import StatusQ.Core 0.1
|
||||
import StatusQ.Core.Theme 0.1
|
||||
import StatusQ.Core.Utils 0.1 as StatusQUtils
|
||||
import StatusQ.Controls 0.1
|
||||
import StatusQ.Controls.Validators 0.1
|
||||
import StatusQ.Components 0.1
|
||||
|
@ -18,12 +19,16 @@ StatusModal {
|
|||
property string categoryId: ""
|
||||
property string channelName: ""
|
||||
property string channelDescription: ""
|
||||
property string channelEmoji: ""
|
||||
property bool emojiPopupOpened: false
|
||||
property var emojiPopup: null
|
||||
readonly property string emojiRegexStr: 'alt="(\u00a9|\u00ae|[\u2000-\u3300]|\ud83c[\ud000-\udfff]|\ud83d[\ud000-\udfff]|\ud83e[\ud000-\udfff])"'
|
||||
|
||||
readonly property int maxChannelNameLength: 30
|
||||
readonly property int maxChannelDescLength: 140
|
||||
|
||||
signal createCommunityChannel(string chName, string chDescription, string chCategoryId)
|
||||
signal editCommunityChannel(string chName, string chDescription, string chCategoryId)
|
||||
signal createCommunityChannel(string chName, string chDescription, string chEmoji, string chCategoryId)
|
||||
signal editCommunityChannel(string chName, string chDescription, string chEmoji, string chCategoryId)
|
||||
|
||||
//% "New channel"
|
||||
header.title: qsTrId("create-channel-title")
|
||||
|
@ -36,11 +41,24 @@ StatusModal {
|
|||
header.title = qsTrId("edit---1").arg(popup.channelName);
|
||||
contentItem.channelName.input.text = popup.channelName
|
||||
contentItem.channelDescription.input.text = popup.channelDescription
|
||||
contentItem.channelEmoji.text = StatusQUtils.Emoji.parse(popup.channelEmoji)
|
||||
}
|
||||
}
|
||||
|
||||
onClosed: destroy()
|
||||
|
||||
Connections {
|
||||
enabled: popup.opened && popup.emojiPopupOpened
|
||||
target: emojiPopup
|
||||
|
||||
onEmojiSelected: function (emojiText, atCursor) {
|
||||
scrollView.channelEmoji.text = emojiText
|
||||
}
|
||||
onClosed: {
|
||||
popup.emojiPopupOpened = false
|
||||
}
|
||||
}
|
||||
|
||||
function isFormValid() {
|
||||
return (scrollView.channelName.valid &&
|
||||
scrollView.channelDescription.valid)
|
||||
|
@ -54,6 +72,7 @@ StatusModal {
|
|||
|
||||
property alias channelName: nameInput
|
||||
property alias channelDescription: descriptionTextArea
|
||||
property alias channelEmoji: emojiText
|
||||
|
||||
contentHeight: content.height
|
||||
height: Math.min(content.height, 432)
|
||||
|
@ -105,6 +124,46 @@ StatusModal {
|
|||
}]
|
||||
}
|
||||
|
||||
// TODO replace this with the new emoji + name + color input when it is implemented in StatusQ
|
||||
Item {
|
||||
width: parent.width
|
||||
height: childrenRect.height + 8
|
||||
|
||||
StatusButton {
|
||||
id: emojiBtn
|
||||
text: qsTr("Choose emoji")
|
||||
anchors.top: parent.top
|
||||
anchors.topMargin: 8
|
||||
anchors.left: parent.left
|
||||
anchors.leftMargin: 16
|
||||
onClicked: {
|
||||
popup.emojiPopupOpened = true
|
||||
popup.emojiPopup.open()
|
||||
popup.emojiPopup.x = Global.applicationWindow.width/2 - popup.emojiPopup.width/2 + popup.width/2
|
||||
popup.emojiPopup.y = Global.applicationWindow.height/2 - popup.emojiPopup.height/2
|
||||
}
|
||||
}
|
||||
StatusBaseText {
|
||||
id: emojiText
|
||||
font.pixelSize: 15
|
||||
anchors.verticalCenter: emojiBtn.verticalCenter
|
||||
anchors.left: emojiBtn.right
|
||||
anchors.leftMargin: 8
|
||||
}
|
||||
StatusButton {
|
||||
id: removeEmojiBtn
|
||||
visible: !!emojiText.text
|
||||
text: qsTr("Remove emoji")
|
||||
anchors.top: parent.top
|
||||
anchors.topMargin: 8
|
||||
anchors.left: emojiText.right
|
||||
anchors.leftMargin: 8
|
||||
onClicked: {
|
||||
emojiText.text = ""
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* TODO: use the code below to enable private channels and message limit */
|
||||
/* StatusListItem { */
|
||||
/* width: parent.width */
|
||||
|
@ -180,13 +239,20 @@ StatusModal {
|
|||
return
|
||||
}
|
||||
let error = "";
|
||||
let emoji = ""
|
||||
const found = RegExp(emojiRegexStr, 'g').exec(popup.contentItem.channelEmoji.text);
|
||||
if (found) {
|
||||
emoji = found[1]
|
||||
}
|
||||
if (!isEdit) {
|
||||
popup.createCommunityChannel(Utils.filterXSS(popup.contentItem.channelName.input.text),
|
||||
Utils.filterXSS(popup.contentItem.channelDescription.input.text),
|
||||
emoji,
|
||||
popup.categoryId)
|
||||
} else {
|
||||
popup.editCommunityChannel(Utils.filterXSS(popup.contentItem.channelName.input.text),
|
||||
Utils.filterXSS(popup.contentItem.channelDescription.input.text),
|
||||
emoji,
|
||||
popup.categoryId)
|
||||
}
|
||||
|
||||
|
|
|
@ -1,6 +1,8 @@
|
|||
import QtQuick 2.13
|
||||
import utils 1.0
|
||||
|
||||
import StatusQ.Core.Utils 0.1 as StatusQUtils
|
||||
|
||||
QtObject {
|
||||
id: root
|
||||
|
||||
|
@ -165,7 +167,7 @@ QtObject {
|
|||
|
||||
//% " reacted with "
|
||||
tooltip += qsTrId("-reacted-with-");
|
||||
let emojiHtml = Emoji.getEmojiFromId(emojiId);
|
||||
let emojiHtml = StatusQUtils.Emoji.getEmojiFromId(emojiId);
|
||||
if (emojiHtml) {
|
||||
tooltip += emojiHtml;
|
||||
}
|
||||
|
|
|
@ -178,11 +178,11 @@ QtObject {
|
|||
chatCommunitySectionModule.removeUserFromCommunity(pubKey);
|
||||
}
|
||||
|
||||
function createCommunityChannel(channelName, channelDescription, categoryId) {
|
||||
chatCommunitySectionModule.createCommunityChannel(channelName, channelDescription, categoryId);
|
||||
function createCommunityChannel(channelName, channelDescription, channelEmoji, categoryId) {
|
||||
chatCommunitySectionModule.createCommunityChannel(channelName, channelDescription, channelEmoji, categoryId);
|
||||
}
|
||||
|
||||
function editCommunityChannel(chatId, newName, newDescription, newCategory, channelPosition) {
|
||||
function editCommunityChannel(chatId, newName, newDescription, newEmoji, newCategory, channelPosition) {
|
||||
// TODO: pass the private value when private channels
|
||||
// are implemented
|
||||
//privateSwitch.checked)
|
||||
|
@ -190,6 +190,7 @@ QtObject {
|
|||
chatId,
|
||||
newName,
|
||||
newDescription,
|
||||
newEmoji,
|
||||
newCategory,
|
||||
channelPosition
|
||||
)
|
||||
|
|
|
@ -33,6 +33,7 @@ Item {
|
|||
property var rootStore
|
||||
property var contactsStore
|
||||
property var chatSectionModule
|
||||
property var emojiPopup
|
||||
|
||||
property Component pinnedMessagesPopupComponent
|
||||
// Not Refactored Yet
|
||||
|
@ -226,6 +227,7 @@ Item {
|
|||
clip: true
|
||||
rootStore: root.rootStore
|
||||
contactsStore: root.contactsStore
|
||||
emojiPopup: root.emojiPopup
|
||||
sendTransactionNoEnsModal: cmpSendTransactionNoEns
|
||||
receiveTransactionModal: cmpReceiveTransaction
|
||||
sendTransactionWithEnsModal: cmpSendTransactionWithEns
|
||||
|
|
|
@ -5,6 +5,7 @@ import QtQuick.Layouts 1.13
|
|||
import QtGraphicalEffects 1.0
|
||||
|
||||
import StatusQ.Core.Theme 0.1
|
||||
import StatusQ.Core.Utils 0.1 as StatusQUtils
|
||||
import StatusQ.Components 0.1
|
||||
import StatusQ.Controls 0.1
|
||||
|
||||
|
@ -32,6 +33,7 @@ ColumnLayout {
|
|||
property var rootStore
|
||||
property var contactsStore
|
||||
property bool isActiveChannel: false
|
||||
property var emojiPopup
|
||||
property UsersStore usersStore: UsersStore {}
|
||||
|
||||
onChatContentModuleChanged: {
|
||||
|
@ -160,6 +162,7 @@ ColumnLayout {
|
|||
onNotificationButtonClicked: activityCenter.open()
|
||||
|
||||
popupMenu: ChatContextMenuView {
|
||||
emojiPopup: chatContentRoot.emojiPopup
|
||||
openHandler: function () {
|
||||
if(!chatContentModule) {
|
||||
console.debug("error on open chat context menu handler - chat content module is not set")
|
||||
|
@ -171,6 +174,7 @@ ColumnLayout {
|
|||
chatId = chatContentModule.chatDetails.id
|
||||
chatName = chatContentModule.chatDetails.name
|
||||
chatDescription = chatContentModule.chatDetails.description
|
||||
chatEmoji = chatContentModule.chatDetails.emoji
|
||||
chatType = chatContentModule.chatDetails.type
|
||||
chatMuted = chatContentModule.chatDetails.muted
|
||||
channelPosition = chatContentModule.chatDetails.position
|
||||
|
@ -242,6 +246,7 @@ ColumnLayout {
|
|||
chatId,
|
||||
newName,
|
||||
newDescription,
|
||||
newEmoji,
|
||||
newCategory,
|
||||
channelPosition // TODO change this to the signal once it is modifiable
|
||||
)
|
||||
|
@ -416,6 +421,7 @@ ColumnLayout {
|
|||
// chatContentRoot.rootStore.chatsModelInst.channelView.activeChannel.canPost
|
||||
}
|
||||
messageContextMenu: contextmenu
|
||||
emojiPopup: chatContentRoot.emojiPopup
|
||||
isContactBlocked: chatContentRoot.isBlocked
|
||||
isActiveChannel: chatContentRoot.isActiveChannel
|
||||
chatInputPlaceholder: chatContentRoot.isBlocked ?
|
||||
|
@ -457,7 +463,7 @@ ColumnLayout {
|
|||
if (chatInput.fileUrls.length > 0){
|
||||
chatContentModule.inputAreaModule.sendImages(JSON.stringify(fileUrls));
|
||||
}
|
||||
let msg = globalUtils.plainText(Emoji.deparse(chatInput.textInput.text))
|
||||
let msg = globalUtils.plainText(StatusQUtils.Emoji.deparse(chatInput.textInput.text))
|
||||
if (msg.length > 0) {
|
||||
msg = chatInput.interpretMessage(msg)
|
||||
|
||||
|
|
|
@ -19,11 +19,13 @@ StatusPopupMenu {
|
|||
property string chatId: ""
|
||||
property string chatName: ""
|
||||
property string chatDescription: ""
|
||||
property string chatEmoji: ""
|
||||
property string chatIcon: ""
|
||||
property int chatType: -1
|
||||
property bool chatMuted: false
|
||||
property int channelPosition: -1
|
||||
property string chatCategoryId: ""
|
||||
property var emojiPopup
|
||||
|
||||
signal displayProfilePopup(string publicKey)
|
||||
signal displayGroupInfoPopup(string chatId)
|
||||
|
@ -36,8 +38,8 @@ StatusPopupMenu {
|
|||
signal deleteCommunityChat(string chatId)
|
||||
signal leaveChat(string chatId)
|
||||
|
||||
signal createCommunityChannel(string chatId, string newName, string newDescription)
|
||||
signal editCommunityChannel(string chatId, string newName, string newDescription, string newCategory)
|
||||
signal createCommunityChannel(string chatId, string newName, string newDescription, string newEmoji)
|
||||
signal editCommunityChannel(string chatId, string newName, string newDescription, string newEmoji, string newCategory)
|
||||
|
||||
StatusMenuItem {
|
||||
id: viewProfileMenuItem
|
||||
|
@ -127,6 +129,7 @@ StatusPopupMenu {
|
|||
isEdit: true,
|
||||
channelName: root.chatName,
|
||||
channelDescription: root.chatDescription,
|
||||
channelEmoji: root.chatEmoji,
|
||||
categoryId: root.chatCategoryId
|
||||
});
|
||||
}
|
||||
|
@ -137,11 +140,12 @@ StatusPopupMenu {
|
|||
CreateChannelPopup {
|
||||
anchors.centerIn: parent
|
||||
isEdit: true
|
||||
emojiPopup: root.emojiPopup
|
||||
onCreateCommunityChannel: {
|
||||
root.createCommunityChannel(root.chatId, chName, chDescription);
|
||||
root.createCommunityChannel(root.chatId, chName, chDescription, chEmoji);
|
||||
}
|
||||
onEditCommunityChannel: {
|
||||
root.editCommunityChannel(root.chatId, chName, chDescription, chCategoryId);
|
||||
root.editCommunityChannel(root.chatId, chName, chDescription, chEmoji, chCategoryId);
|
||||
}
|
||||
onClosed: {
|
||||
destroy()
|
||||
|
|
|
@ -24,6 +24,7 @@ Item {
|
|||
// We're here in case of CommunitySection
|
||||
// This module is set from `ChatLayout` (each `ChatLayout` has its own communitySectionModule)
|
||||
property var communitySectionModule
|
||||
property var emojiPopup
|
||||
|
||||
property var store
|
||||
property bool hasAddedContacts: false
|
||||
|
@ -89,7 +90,7 @@ Item {
|
|||
Loader {
|
||||
id: membershipRequests
|
||||
|
||||
property int nbRequests: root.communityData.pendingRequestsToJoin.count
|
||||
property int nbRequests: root.communityData.pendingRequestsToJoin.count || 0
|
||||
|
||||
anchors.top: communityHeader.bottom
|
||||
anchors.topMargin: active ? 8 : 0
|
||||
|
@ -257,6 +258,7 @@ Item {
|
|||
|
||||
chatListPopupMenu: ChatContextMenuView {
|
||||
id: chatContextMenuView
|
||||
emojiPopup: root.emojiPopup
|
||||
|
||||
openHandler: function (id) {
|
||||
let jsonObj = root.communitySectionModule.getItemAsJson(id)
|
||||
|
@ -273,6 +275,8 @@ Item {
|
|||
chatId = obj.itemId
|
||||
chatName = obj.name
|
||||
chatDescription = obj.description
|
||||
|
||||
chatEmoji = obj.emoji
|
||||
chatType = obj.type
|
||||
chatMuted = obj.muted
|
||||
channelPosition = obj.position
|
||||
|
@ -327,6 +331,7 @@ Item {
|
|||
chatId,
|
||||
newName,
|
||||
newDescription,
|
||||
newEmoji,
|
||||
newCategory,
|
||||
channelPosition // TODO change this to the signal once it is modifiable
|
||||
)
|
||||
|
@ -399,8 +404,9 @@ Item {
|
|||
id: createChannelPopup
|
||||
CreateChannelPopup {
|
||||
anchors.centerIn: parent
|
||||
onCreateCommunityChannel: function (chName, chDescription, chCategoryId) {
|
||||
root.store.createCommunityChannel(chName, chDescription, chCategoryId)
|
||||
emojiPopup: root.emojiPopup
|
||||
onCreateCommunityChannel: function (chName, chDescription, chEmoji, chCategoryId) {
|
||||
root.store.createCommunityChannel(chName, chDescription, chEmoji, chCategoryId)
|
||||
}
|
||||
onClosed: {
|
||||
destroy()
|
||||
|
|
|
@ -28,6 +28,7 @@ Item {
|
|||
|
||||
property var store
|
||||
property var contactsStore
|
||||
property var emojiPopup
|
||||
|
||||
// Not Refactored Yet
|
||||
//property int chatGroupsListViewCount: channelList.model.count
|
||||
|
@ -237,6 +238,7 @@ Item {
|
|||
|
||||
popupMenu: ChatContextMenuView {
|
||||
id: chatContextMenuView
|
||||
emojiPopup: root.emojiPopup
|
||||
|
||||
openHandler: function (id) {
|
||||
let jsonObj = root.chatSectionModule.getItemAsJson(id)
|
||||
|
@ -253,6 +255,7 @@ Item {
|
|||
chatId = obj.itemId
|
||||
chatName = obj.name
|
||||
chatDescription = obj.description
|
||||
chatEmoji = obj.emoji
|
||||
chatType = obj.type
|
||||
chatMuted = obj.muted
|
||||
}
|
||||
|
|
|
@ -205,6 +205,12 @@ Item {
|
|||
store: appMain.rootStore.appSearchStore
|
||||
}
|
||||
|
||||
StatusEmojiPopup {
|
||||
id: statusEmojiPopup
|
||||
width: 360
|
||||
height: 440
|
||||
}
|
||||
|
||||
StatusAppLayout {
|
||||
id: appLayout
|
||||
|
||||
|
@ -466,6 +472,7 @@ Item {
|
|||
Layout.fillHeight: true
|
||||
|
||||
pinnedMessagesListPopupComponent: pinnedMessagesPopupComponent
|
||||
emojiPopup: statusEmojiPopup
|
||||
|
||||
contactsStore: appMain.rootStore.contactStore
|
||||
rootStore.emojiReactionsModel: appMain.rootStore.emojiReactionsModel
|
||||
|
@ -552,6 +559,7 @@ Item {
|
|||
Layout.fillHeight: true
|
||||
|
||||
pinnedMessagesListPopupComponent: pinnedMessagesPopupComponent
|
||||
emojiPopup: statusEmojiPopup
|
||||
|
||||
contactsStore: appMain.rootStore.contactStore
|
||||
rootStore.emojiReactionsModel: appMain.rootStore.emojiReactionsModel
|
||||
|
|
Before Width: | Height: | Size: 1012 B |
Before Width: | Height: | Size: 1.4 KiB |
Before Width: | Height: | Size: 934 B |
Before Width: | Height: | Size: 855 B |
Before Width: | Height: | Size: 850 B |
Before Width: | Height: | Size: 788 B |
Before Width: | Height: | Size: 1.2 KiB |
Before Width: | Height: | Size: 1.0 KiB |
Before Width: | Height: | Size: 995 B |
Before Width: | Height: | Size: 1.1 KiB |
Before Width: | Height: | Size: 876 B |
Before Width: | Height: | Size: 1.1 KiB |
Before Width: | Height: | Size: 1.1 KiB |
Before Width: | Height: | Size: 1.2 KiB |
Before Width: | Height: | Size: 1.2 KiB |
Before Width: | Height: | Size: 1020 B |
Before Width: | Height: | Size: 1.2 KiB |
Before Width: | Height: | Size: 1.4 KiB |
Before Width: | Height: | Size: 833 B |
Before Width: | Height: | Size: 671 B |
Before Width: | Height: | Size: 1.3 KiB |
Before Width: | Height: | Size: 989 B |
Before Width: | Height: | Size: 1.4 KiB |
Before Width: | Height: | Size: 843 B |
Before Width: | Height: | Size: 468 B |
Before Width: | Height: | Size: 906 B |
Before Width: | Height: | Size: 822 B |
Before Width: | Height: | Size: 553 B |
Before Width: | Height: | Size: 1.3 KiB |
Before Width: | Height: | Size: 422 B |
Before Width: | Height: | Size: 1.4 KiB |
Before Width: | Height: | Size: 621 B |
Before Width: | Height: | Size: 640 B |
Before Width: | Height: | Size: 703 B |
Before Width: | Height: | Size: 915 B |
Before Width: | Height: | Size: 960 B |
Before Width: | Height: | Size: 671 B |
Before Width: | Height: | Size: 674 B |
Before Width: | Height: | Size: 476 B |
Before Width: | Height: | Size: 579 B |
Before Width: | Height: | Size: 478 B |
Before Width: | Height: | Size: 651 B |
Before Width: | Height: | Size: 1.4 KiB |
Before Width: | Height: | Size: 594 B |
Before Width: | Height: | Size: 1.1 KiB |
Before Width: | Height: | Size: 1.5 KiB |
Before Width: | Height: | Size: 1.4 KiB |
Before Width: | Height: | Size: 714 B |
Before Width: | Height: | Size: 1.2 KiB |
Before Width: | Height: | Size: 993 B |
Before Width: | Height: | Size: 659 B |
Before Width: | Height: | Size: 1.3 KiB |
Before Width: | Height: | Size: 629 B |
Before Width: | Height: | Size: 422 B |
Before Width: | Height: | Size: 881 B |
Before Width: | Height: | Size: 1.1 KiB |
Before Width: | Height: | Size: 857 B |
Before Width: | Height: | Size: 824 B |
Before Width: | Height: | Size: 960 B |
Before Width: | Height: | Size: 1.1 KiB |
Before Width: | Height: | Size: 906 B |
Before Width: | Height: | Size: 618 B |
Before Width: | Height: | Size: 556 B |
Before Width: | Height: | Size: 476 B |
Before Width: | Height: | Size: 1.4 KiB |
Before Width: | Height: | Size: 708 B |
Before Width: | Height: | Size: 567 B |
Before Width: | Height: | Size: 663 B |
Before Width: | Height: | Size: 475 B |
Before Width: | Height: | Size: 476 B |
Before Width: | Height: | Size: 659 B |