refactor(@desktop/general): remove interfaces for controllers, make a single module interface

Fixes #5093
This commit is contained in:
Sale Djenic 2022-03-22 16:26:59 +01:00 committed by saledjenic
parent 1bf5882f25
commit c5c92fcfd1
253 changed files with 2194 additions and 4308 deletions

View File

@ -1,5 +1,4 @@
import Tables, stint
import ./controller_interface
import ./io_interface
import ../../../global/app_signals
@ -10,10 +9,8 @@ import ../../../../app_service/service/message/service as message_service
import ../../../../app_service/service/eth/utils as eth_utils
import ../../../../app_service/service/chat/service as chat_service
export controller_interface
type
Controller*[T: controller_interface.DelegateInterface] = ref object of controller_interface.AccessInterface
Controller* = ref object of RootObj
delegate: io_interface.AccessInterface
events: EventEmitter
activityCenterService: activity_center_service.Service
@ -21,15 +18,15 @@ type
messageService: message_service.Service
chatService: chat_service.Service
proc newController*[T](
proc newController*(
delegate: io_interface.AccessInterface,
events: EventEmitter,
activityCenterService: activity_center_service.Service,
contactsService: contacts_service.Service,
messageService: message_service.Service,
chatService: chat_service.Service
): Controller[T] =
result = Controller[T]()
): Controller =
result = Controller()
result.delegate = delegate
result.events = events
result.activityCenterService = activityCenterService
@ -37,10 +34,10 @@ proc newController*[T](
result.messageService = messageService
result.chatService = chatService
method delete*[T](self: Controller[T]) =
proc delete*(self: Controller) =
discard
method init*[T](self: Controller[T]) =
proc init*(self: Controller) =
self.events.on(activity_center_service.SIGNAL_ACTIVITY_CENTER_NOTIFICATIONS_LOADED) do(e: Args):
let args = ActivityCenterNotificationsArgs(e)
self.delegate.addActivityCenterNotification(args.activityCenterNotifications)
@ -67,50 +64,50 @@ method init*[T](self: Controller[T]) =
self.delegate.markActivityCenterNotificationUnreadDone(evArgs.notificationIds)
method hasMoreToShow*[T](self: Controller[T]): bool =
proc hasMoreToShow*(self: Controller): bool =
return self.activityCenterService.hasMoreToShow()
method unreadActivityCenterNotificationsCount*[T](self: Controller[T]): int =
proc unreadActivityCenterNotificationsCount*(self: Controller): int =
return self.activityCenterService.unreadActivityCenterNotificationsCount()
method getContactDetails*[T](self: Controller[T], contactId: string): ContactDetails =
proc getContactDetails*(self: Controller, contactId: string): ContactDetails =
return self.contactsService.getContactDetails(contactId)
method getActivityCenterNotifications*[T](self: Controller[T]): seq[ActivityCenterNotificationDto] =
proc getActivityCenterNotifications*(self: Controller): seq[ActivityCenterNotificationDto] =
return self.activityCenterService.getActivityCenterNotifications()
method markAllActivityCenterNotificationsRead*[T](self: Controller[T]): string =
proc markAllActivityCenterNotificationsRead*(self: Controller): string =
return self.activityCenterService.markAllActivityCenterNotificationsRead()
method markActivityCenterNotificationRead*[T](
self: Controller[T],
proc markActivityCenterNotificationRead*(
self: Controller,
notificationId: string,
markAsReadProps: MarkAsReadNotificationProperties
): string =
return self.activityCenterService.markActivityCenterNotificationRead(notificationId, markAsReadProps)
method markActivityCenterNotificationUnread*[T](
self: Controller[T],
proc markActivityCenterNotificationUnread*(
self: Controller,
notificationId: string,
markAsUnreadProps: MarkAsUnreadNotificationProperties
): string =
return self.activityCenterService.markActivityCenterNotificationUnread(notificationId, markAsUnreadProps)
method acceptActivityCenterNotifications*[T](self: Controller[T], notificationIds: seq[string]): string =
proc acceptActivityCenterNotifications*(self: Controller, notificationIds: seq[string]): string =
return self.activityCenterService.acceptActivityCenterNotifications(notificationIds)
method dismissActivityCenterNotifications*[T](self: Controller[T], notificationIds: seq[string]): string =
proc dismissActivityCenterNotifications*(self: Controller, notificationIds: seq[string]): string =
return self.activityCenterService.dismissActivityCenterNotifications(notificationIds)
method getRenderedText*[T](self: Controller[T], parsedTextArray: seq[ParsedText]): string =
proc getRenderedText*(self: Controller, parsedTextArray: seq[ParsedText]): string =
return self.messageService.getRenderedText(parsedTextArray)
method decodeContentHash*[T](self: Controller[T], hash: string): string =
proc decodeContentHash*(self: Controller, hash: string): string =
return eth_utils.decodeContentHash(hash)
method switchTo*[T](self: Controller[T], sectionId, chatId, messageId: string) =
proc switchTo*(self: Controller, sectionId, chatId, messageId: string) =
let data = ActiveSectionChatArgs(sectionId: sectionId, chatId: chatId, messageId: messageId)
self.events.emit(SIGNAL_MAKE_SECTION_CHAT_ACTIVE, data)
method getChatDetails*[T](self: Controller[T], chatId: string): ChatDto =
proc getChatDetails*(self: Controller, chatId: string): ChatDto =
return self.chatService.getChatById(chatId)

View File

@ -1,59 +0,0 @@
import ../../../../app_service/service/contacts/service as contacts_service
import ../../../../app_service/service/activity_center/service as activity_center_service
import ../../../../app_service/service/message/dto/[message]
import ../../../../app_service/service/chat/dto/[chat]
type
AccessInterface* {.pure inheritable.} = ref object of RootObj
## Abstract class for any input/interaction with this module.
method delete*(self: AccessInterface) {.base.} =
raise newException(ValueError, "No implementation available")
method init*(self: AccessInterface) {.base.} =
raise newException(ValueError, "No implementation available")
method hasMoreToShow*(self: AccessInterface): bool {.base.} =
raise newException(ValueError, "No implementation available")
method unreadActivityCenterNotificationsCount*(self: AccessInterface): int {.base.} =
raise newException(ValueError, "No implementation available")
method getContactDetails*(self: AccessInterface, contactId: string): ContactDetails {.base.} =
raise newException(ValueError, "No implementation available")
method getActivityCenterNotifications*(self: AccessInterface): seq[ActivityCenterNotificationDto] {.base.} =
raise newException(ValueError, "No implementation available")
method markAllActivityCenterNotificationsRead*(self: AccessInterface): string {.base.} =
raise newException(ValueError, "No implementation available")
method markActivityCenterNotificationRead*(self: AccessInterface, notificationId: string, markAsReadProps: MarkAsReadNotificationProperties): string {.base.} =
raise newException(ValueError, "No implementation available")
method markActivityCenterNotificationUnread*(self: AccessInterface, notificationId: string, markAsUnreadProps: MarkAsUnreadNotificationProperties): string {.base.} =
raise newException(ValueError, "No implementation available")
method acceptActivityCenterNotifications*(self: AccessInterface, notificationIds: seq[string]): string {.base.} =
raise newException(ValueError, "No implementation available")
method dismissActivityCenterNotifications*(self: AccessInterface, notificationIds: seq[string]): string {.base.} =
raise newException(ValueError, "No implementation available")
method getRenderedText*(self: AccessInterface, parsedTextArray: seq[ParsedText]): string {.base.} =
raise newException(ValueError, "No implementation available")
method decodeContentHash*(self: AccessInterface, hash: string): string {.base.} =
raise newException(ValueError, "No implementation available")
method switchTo*(self: AccessInterface, sectionId, chatId, messageId: string) {.base.} =
raise newException(ValueError, "No implementation available")
method getChatDetails*(self: AccessInterface, chatId: string): ChatDto {.base.} =
raise newException(ValueError, "No implementation available")
type
## Abstract class (concept) which must be implemented by object/s used in this
## module.
DelegateInterface* = concept c

View File

@ -68,9 +68,3 @@ method dismissActivityCenterNotifications*(self: AccessInterface, notificationId
method switchTo*(self: AccessInterface, sectionId, chatId, messageId: string) {.base.} =
raise newException(ValueError, "No implementation available")
type
## Abstract class (concept) which must be implemented by object/s used in this
## module.
DelegateInterface* = concept c
c.activityCenterDidLoad()

View File

@ -1,6 +1,7 @@
import NimQml, Tables, stint, sugar, sequtils
import ./io_interface, ./view, ./controller
import ../io_interface as delegate_interface
import ./item as notification_item
import ../../shared_models/message_item as msg_item
import ../../shared_models/message_item_qobject as msg_item_qobj
@ -17,26 +18,26 @@ import ../../../global/app_sections_config as conf
export io_interface
type
Module* [T: io_interface.DelegateInterface] = ref object of io_interface.AccessInterface
delegate: T
controller: controller.AccessInterface
Module* = ref object of io_interface.AccessInterface
delegate: delegate_interface.AccessInterface
controller: Controller
view: View
viewVariant: QVariant
moduleLoaded: bool
proc newModule*[T](
delegate: T,
proc newModule*(
delegate: delegate_interface.AccessInterface,
events: EventEmitter,
activityCenterService: activity_center_service.Service,
contactsService: contacts_service.Service,
messageService: message_service.Service,
chatService: chat_service.Service
): Module[T] =
result = Module[T]()
): Module =
result = Module()
result.delegate = delegate
result.view = newView(result)
result.viewVariant = newQVariant(result.view)
result.controller = controller.newController[Module[T]](
result.controller = controller.newController(
result,
events,
activityCenterService,
@ -46,29 +47,29 @@ proc newModule*[T](
)
result.moduleLoaded = false
method delete*[T](self: Module[T]) =
method delete*(self: Module) =
self.view.delete
method load*[T](self: Module[T]) =
method load*(self: Module) =
singletonInstance.engine.setRootContextProperty("activityCenterModule", self.viewVariant)
self.controller.init()
self.view.load()
method isLoaded*[T](self: Module[T]): bool =
method isLoaded*(self: Module): bool =
return self.moduleLoaded
method viewDidLoad*[T](self: Module[T]) =
method viewDidLoad*(self: Module) =
self.moduleLoaded = true
self.delegate.activityCenterDidLoad()
method hasMoreToShow*[T](self: Module[T]): bool =
method hasMoreToShow*(self: Module): bool =
self.controller.hasMoreToShow()
method unreadActivityCenterNotificationsCount*[T](self: Module[T]): int =
method unreadActivityCenterNotificationsCount*(self: Module): int =
self.controller.unreadActivityCenterNotificationsCount()
method convertToItems*[T](
self: Module[T],
method convertToItems*(
self: Module,
activityCenterNotifications: seq[ActivityCenterNotificationDto]
): seq[notification_item.Item] =
result = activityCenterNotifications.map(
@ -123,18 +124,18 @@ method convertToItems*[T](
)
)
method getActivityCenterNotifications*[T](self: Module[T]): seq[notification_item.Item] =
method getActivityCenterNotifications*(self: Module): seq[notification_item.Item] =
let activityCenterNotifications = self.controller.getActivityCenterNotifications()
self.view.pushActivityCenterNotifications(self.convertToItems(activityCenterNotifications))
method markAllActivityCenterNotificationsRead*[T](self: Module[T]): string =
method markAllActivityCenterNotificationsRead*(self: Module): string =
self.controller.markAllActivityCenterNotificationsRead()
method markAllActivityCenterNotificationsReadDone*[T](self: Module[T]) =
method markAllActivityCenterNotificationsReadDone*(self: Module) =
self.view.markAllActivityCenterNotificationsReadDone()
method markActivityCenterNotificationRead*[T](
self: Module[T],
method markActivityCenterNotificationRead*(
self: Module,
notificationId: string,
communityId: string,
channelId: string,
@ -149,24 +150,24 @@ method markActivityCenterNotificationRead*[T](
)
result = self.controller.markActivityCenterNotificationRead(notificationId, markAsReadProps)
method markActivityCenterNotificationReadDone*[T](self: Module[T], notificationIds: seq[string]) =
method markActivityCenterNotificationReadDone*(self: Module, notificationIds: seq[string]) =
for notificationId in notificationIds:
self.view.markActivityCenterNotificationReadDone(notificationId)
method pushActivityCenterNotifications*[T](
self: Module[T],
method pushActivityCenterNotifications*(
self: Module,
activityCenterNotifications: seq[ActivityCenterNotificationDto]
) =
self.view.pushActivityCenterNotifications(self.convertToItems(activityCenterNotifications))
method addActivityCenterNotification*[T](
self: Module[T],
method addActivityCenterNotification*(
self: Module,
activityCenterNotifications: seq[ActivityCenterNotificationDto]
) =
self.view.addActivityCenterNotification(self.convertToItems(activityCenterNotifications))
method markActivityCenterNotificationUnread*[T](
self: Module[T],
method markActivityCenterNotificationUnread*(
self: Module,
notificationId: string,
communityId: string,
channelId: string,
@ -182,21 +183,21 @@ method markActivityCenterNotificationUnread*[T](
result = self.controller.markActivityCenterNotificationUnread(notificationId, markAsUnreadProps)
method markActivityCenterNotificationUnreadDone*[T](self: Module[T], notificationIds: seq[string]) =
method markActivityCenterNotificationUnreadDone*(self: Module, notificationIds: seq[string]) =
for notificationId in notificationIds:
self.view.markActivityCenterNotificationUnreadDone(notificationId)
method acceptActivityCenterNotificationsDone*[T](self: Module[T], notificationIds: seq[string]) =
method acceptActivityCenterNotificationsDone*(self: Module, notificationIds: seq[string]) =
self.view.acceptActivityCenterNotificationsDone(notificationIds)
method acceptActivityCenterNotifications*[T](self: Module[T], notificationIds: seq[string]): string =
method acceptActivityCenterNotifications*(self: Module, notificationIds: seq[string]): string =
self.controller.acceptActivityCenterNotifications(notificationIds)
method dismissActivityCenterNotificationsDone*[T](self: Module[T], notificationIds: seq[string]) =
method dismissActivityCenterNotificationsDone*(self: Module, notificationIds: seq[string]) =
self.view.dismissActivityCenterNotificationsDone(notificationIds)
method dismissActivityCenterNotifications*[T](self: Module[T], notificationIds: seq[string]): string =
method dismissActivityCenterNotifications*(self: Module, notificationIds: seq[string]): string =
self.controller.dismissActivityCenterNotifications(notificationIds)
method switchTo*[T](self: Module[T], sectionId, chatId, messageId: string) =
method switchTo*(self: Module, sectionId, chatId, messageId: string) =
self.controller.switchTo(sectionId, chatId, messageId)

View File

@ -1,4 +1,4 @@
import Tables, controller_interface, chronicles
import Tables, chronicles
import io_interface
import ../../../global/app_signals
@ -11,8 +11,6 @@ import ../../../../app_service/service/message/service as message_service
import ../../../core/signals/types
import ../../../core/eventemitter
export controller_interface
logScope:
topics = "app-search-module-controller"
@ -21,13 +19,13 @@ type ResultItemDetails = object
channelId*: string
messageId*: string
method isEmpty(self: ResultItemDetails): bool =
proc isEmpty(self: ResultItemDetails): bool =
self.sectionId.len == 0 and
self.channelId.len == 0 and
self.messageId.len == 0
type
Controller* = ref object of controller_interface.AccessInterface
Controller* = ref object of RootObj
delegate: io_interface.AccessInterface
events: EventEmitter
contactsService: contact_service.Service
@ -53,56 +51,56 @@ proc newController*(delegate: io_interface.AccessInterface, events: EventEmitter
result.messageService = messageService
result.resultItems = initTable[string, ResultItemDetails]()
method delete*(self: Controller) =
proc delete*(self: Controller) =
self.resultItems.clear
method init*(self: Controller) =
proc init*(self: Controller) =
self.events.on(SIGNAL_SEARCH_MESSAGES_LOADED) do(e:Args):
let args = MessagesArgs(e)
self.delegate.onSearchMessagesDone(args.messages)
method activeSectionId*(self: Controller): string =
proc activeSectionId*(self: Controller): string =
return self.activeSectionId
method activeChatId*(self: Controller): string =
proc activeChatId*(self: Controller): string =
return self.activeChatId
method setActiveSectionIdAndChatId*(self: Controller, sectionId: string, chatId: string) =
proc setActiveSectionIdAndChatId*(self: Controller, sectionId: string, chatId: string) =
self.activeSectionId = sectionId
self.activeChatId = chatId
method searchTerm*(self: Controller): string =
proc searchTerm*(self: Controller): string =
return self.searchTerm
method searchLocation*(self: Controller): string =
proc searchLocation*(self: Controller): string =
return self.searchLocation
method searchSubLocation*(self: Controller): string =
proc searchSubLocation*(self: Controller): string =
return self.searchSubLocation
method setSearchLocation*(self: Controller, location: string, subLocation: string) =
proc setSearchLocation*(self: Controller, location: string, subLocation: string) =
## Setting location and subLocation to an empty string means we're
## searching in all available chats/channels/communities.
self.searchLocation = location
self.searchSubLocation = subLocation
method getJoinedCommunities*(self: Controller): seq[CommunityDto] =
proc getJoinedCommunities*(self: Controller): seq[CommunityDto] =
return self.communityService.getJoinedCommunities()
method getCommunityById*(self: Controller, communityId: string): CommunityDto =
proc getCommunityById*(self: Controller, communityId: string): CommunityDto =
return self.communityService.getCommunityById(communityId)
method getAllChatsForCommunity*(self: Controller, communityId: string): seq[Chat] =
proc getAllChatsForCommunity*(self: Controller, communityId: string): seq[Chat] =
return self.communityService.getAllChats(communityId)
method getChatDetailsForChatTypes*(self: Controller, types: seq[ChatType]): seq[ChatDto] =
proc getChatDetailsForChatTypes*(self: Controller, types: seq[ChatType]): seq[ChatDto] =
return self.chatService.getChatsOfChatTypes(types)
method getChatDetails*(self: Controller, communityId, chatId: string): ChatDto =
proc getChatDetails*(self: Controller, communityId, chatId: string): ChatDto =
let fullId = communityId & chatId
return self.chatService.getChatById(fullId)
method searchMessages*(self: Controller, searchTerm: string) =
proc searchMessages*(self: Controller, searchTerm: string) =
self.resultItems.clear
self.searchTerm = searchTerm
@ -133,18 +131,18 @@ method searchMessages*(self: Controller, searchTerm: string) =
self.messageService.asyncSearchMessages(communities, chats, self.searchTerm, false)
method getOneToOneChatNameAndImage*(self: Controller, chatId: string):
proc getOneToOneChatNameAndImage*(self: Controller, chatId: string):
tuple[name: string, image: string, isIdenticon: bool] =
return self.chatService.getOneToOneChatNameAndImage(chatId)
method getContactNameAndImage*(self: Controller, contactId: string):
proc getContactNameAndImage*(self: Controller, contactId: string):
tuple[name: string, image: string, isIdenticon: bool] =
return self.contactsService.getContactNameAndImage(contactId)
method addResultItemDetails*(self: Controller, itemId: string, sectionId = "", channelId = "", messageId = "") =
proc addResultItemDetails*(self: Controller, itemId: string, sectionId = "", channelId = "", messageId = "") =
self.resultItems.add(itemId, ResultItemDetails(sectionId: sectionId, channelId: channelId, messageId: messageId))
method resultItemClicked*(self: Controller, itemId: string) =
proc resultItemClicked*(self: Controller, itemId: string) =
let itemDetails = self.resultItems.getOrDefault(itemId)
if(itemDetails.isEmpty()):
# we shouldn't be here ever

View File

@ -1,67 +0,0 @@
import ../../../../app_service/service/contacts/dto/contacts
import ../../../../app_service/service/chat/dto/chat
import ../../../../app_service/service/community/dto/community
type
AccessInterface* {.pure inheritable.} = ref object of RootObj
## Abstract class for any input/interaction with this module.
method delete*(self: AccessInterface) {.base.} =
raise newException(ValueError, "No implementation available")
method init*(self: AccessInterface) {.base.} =
raise newException(ValueError, "No implementation available")
method activeSectionId*(self: AccessInterface): string {.base.} =
raise newException(ValueError, "No implementation available")
method activeChatId*(self: AccessInterface): string {.base.} =
raise newException(ValueError, "No implementation available")
method setActiveSectionIdAndChatId*(self: AccessInterface, sectionId: string, chatId: string) {.base.} =
raise newException(ValueError, "No implementation available")
method searchTerm*(self: AccessInterface): string {.base.} =
raise newException(ValueError, "No implementation available")
method searchLocation*(self: AccessInterface): string {.base.} =
raise newException(ValueError, "No implementation available")
method searchSubLocation*(self: AccessInterface): string {.base.} =
raise newException(ValueError, "No implementation available")
method setSearchLocation*(self: AccessInterface, location: string, subLocation: string) {.base.} =
raise newException(ValueError, "No implementation available")
method getJoinedCommunities*(self: AccessInterface): seq[CommunityDto] {.base.} =
raise newException(ValueError, "No implementation available")
method getCommunityById*(self: AccessInterface, communityId: string): CommunityDto {.base.} =
raise newException(ValueError, "No implementation available")
method getAllChatsForCommunity*(self: AccessInterface, communityId: string): seq[Chat] {.base.} =
raise newException(ValueError, "No implementation available")
method getChatDetailsForChatTypes*(self: AccessInterface, types: seq[ChatType]): seq[ChatDto] {.base.} =
raise newException(ValueError, "No implementation available")
method getChatDetails*(self: AccessInterface, communityId, chatId: string): ChatDto {.base.} =
raise newException(ValueError, "No implementation available")
method searchMessages*(self: AccessInterface, searchTerm: string) {.base.} =
raise newException(ValueError, "No implementation available")
method getOneToOneChatNameAndImage*(self: AccessInterface, chatId: string):
tuple[name: string, image: string, isIdenticon: bool] {.base.} =
raise newException(ValueError, "No implementation available")
method getContactNameAndImage*(self: AccessInterface, contactId: string):
tuple[name: string, image: string, isIdenticon: bool] {.base.} =
raise newException(ValueError, "No implementation available")
method addResultItemDetails*(self: AccessInterface, itemId: string, sectionId = "", channelId = "", messageId = "")
{.base.} =
raise newException(ValueError, "No implementation available")
method resultItemClicked*(self: AccessInterface, itemId: string) {.base.} =
raise newException(ValueError, "No implementation available")

View File

@ -1,11 +1,42 @@
# Defines how parent module accesses this module
include ./private_interfaces/module_base_interface
include ./private_interfaces/module_access_interface
import NimQml
# Defines how this module view communicates with this module
include ./private_interfaces/module_view_delegate_interface
import ../../../../app_service/service/message/dto/message
# Defines how this controller communicates with this module
include ./private_interfaces/module_controller_delegate_interface
type
AccessInterface* {.pure inheritable.} = ref object of RootObj
# Defines how submodules of this module communicate with this module
method delete*(self: AccessInterface) {.base.} =
raise newException(ValueError, "No implementation available")
method load*(self: AccessInterface) {.base.} =
raise newException(ValueError, "No implementation available")
method isLoaded*(self: AccessInterface): bool {.base.} =
raise newException(ValueError, "No implementation available")
method getModuleAsVariant*(self: AccessInterface): QVariant {.base.} =
raise newException(ValueError, "No implementation available")
method onActiveChatChange*(self: AccessInterface, sectionId: string, chatId: string) {.base.} =
raise newException(ValueError, "No implementation available")
method onSearchMessagesDone*(self: AccessInterface, messages: seq[MessageDto]) {.base.} =
raise newException(ValueError, "No implementation available")
method viewDidLoad*(self: AccessInterface) {.base.} =
raise newException(ValueError, "No implementation available")
method prepareLocationMenuModel*(self: AccessInterface) {.base.} =
raise newException(ValueError, "No implementation available")
method setSearchLocation*(self: AccessInterface, location: string, subLocation: string) {.base.} =
raise newException(ValueError, "No implementation available")
method getSearchLocationObject*(self: AccessInterface): string {.base.} =
raise newException(ValueError, "No implementation available")
method searchMessages*(self: AccessInterface, searchTerm: string) {.base.} =
raise newException(ValueError, "No implementation available")
method resultItemClicked*(self: AccessInterface, itemId: string) {.base.} =
raise newException(ValueError, "No implementation available")

View File

@ -33,7 +33,7 @@ type
delegate: delegate_interface.AccessInterface
view: View
viewVariant: QVariant
controller: controller.AccessInterface
controller: Controller
moduleLoaded: bool
proc newModule*(delegate: delegate_interface.AccessInterface, events: EventEmitter, contactsService: contact_service.Service,

View File

@ -1,16 +0,0 @@
import NimQml
method delete*(self: AccessInterface) {.base.} =
raise newException(ValueError, "No implementation available")
method load*(self: AccessInterface) {.base.} =
raise newException(ValueError, "No implementation available")
method isLoaded*(self: AccessInterface): bool {.base.} =
raise newException(ValueError, "No implementation available")
method getModuleAsVariant*(self: AccessInterface): QVariant {.base.} =
raise newException(ValueError, "No implementation available")
method onActiveChatChange*(self: AccessInterface, sectionId: string, chatId: string) {.base.} =
raise newException(ValueError, "No implementation available")

View File

@ -1,5 +0,0 @@
type
AccessInterface* {.pure inheritable.} = ref object of RootObj
# Since nim doesn't support using concepts in second level nested types we
# define delegate interfaces within access interface.

View File

@ -1,4 +0,0 @@
import ../../../../../app_service/service/message/dto/message
method onSearchMessagesDone*(self: AccessInterface, messages: seq[MessageDto]) {.base.} =
raise newException(ValueError, "No implementation available")

View File

@ -1,17 +0,0 @@
method viewDidLoad*(self: AccessInterface) {.base.} =
raise newException(ValueError, "No implementation available")
method prepareLocationMenuModel*(self: AccessInterface) {.base.} =
raise newException(ValueError, "No implementation available")
method setSearchLocation*(self: AccessInterface, location: string, subLocation: string) {.base.} =
raise newException(ValueError, "No implementation available")
method getSearchLocationObject*(self: AccessInterface): string {.base.} =
raise newException(ValueError, "No implementation available")
method searchMessages*(self: AccessInterface, searchTerm: string) {.base.} =
raise newException(ValueError, "No implementation available")
method resultItemClicked*(self: AccessInterface, itemId: string) {.base.} =
raise newException(ValueError, "No implementation available")

View File

@ -1,14 +1,11 @@
import Tables
import result
import controller_interface
import io_interface
import ../../../../../app_service/service/bookmarks/service as bookmark_service
export controller_interface
type
Controller* = ref object of controller_interface.AccessInterface
Controller* = ref object of RootObj
delegate: io_interface.AccessInterface
bookmarkService: bookmark_service.Service
@ -19,25 +16,25 @@ proc newController*(delegate: io_interface.AccessInterface,
result.delegate = delegate
result.bookmarkService = bookmarkService
method delete*(self: Controller) =
proc delete*(self: Controller) =
discard
method init*(self: Controller) =
proc init*(self: Controller) =
discard
method getBookmarks*(self: Controller): seq[bookmark_service.BookmarkDto] =
proc getBookmarks*(self: Controller): seq[bookmark_service.BookmarkDto] =
return self.bookmarkService.getBookmarks()
method storeBookmark*(self: Controller, url, name: string) =
proc storeBookmark*(self: Controller, url, name: string) =
let b = self.bookmarkService.storeBookmark(url, name)
if b.isOk:
self.delegate.onBoomarkStored(url, name, b.get().imageUrl)
method deleteBookmark*(self: Controller, url: string) =
proc deleteBookmark*(self: Controller, url: string) =
if self.bookmarkService.deleteBookmark(url):
self.delegate.onBookmarkDeleted(url)
method updateBookmark*(self: Controller, oldUrl, newUrl, newName: string) =
proc updateBookmark*(self: Controller, oldUrl, newUrl, newName: string) =
let b = self.bookmarkService.updateBookmark(oldUrl, newUrl, newName)
if b.isOk:
self.delegate.onBookmarkUpdated(oldUrl, newUrl, newName, b.get().imageUrl)

View File

@ -1,23 +0,0 @@
import ../../../../../app_service/service/bookmarks/service as bookmark_service
type
AccessInterface* {.pure inheritable.} = ref object of RootObj
## Abstract class for any input/interaction with this module.
method delete*(self: AccessInterface) {.base.} =
raise newException(ValueError, "No implementation available")
method init*(self: AccessInterface) {.base.} =
raise newException(ValueError, "No implementation available")
method getBookmarks*(self: AccessInterface): seq[bookmark_service.BookmarkDto] =
raise newException(ValueError, "No implementation available")
method storeBookmark*(self: AccessInterface, url, name: string) =
raise newException(ValueError, "No implementation available")
method deleteBookmark*(self: AccessInterface, url: string) =
raise newException(ValueError, "No implementation available")
method updateBookmark*(self: AccessInterface, oldUrl, newUrl, newName: string) =
raise newException(ValueError, "No implementation available")

View File

@ -1,11 +1,37 @@
import ../../../../../app_service/service/bookmarks/service as bookmark_service
# Defines how parent module accesses this module
include ./private_interfaces/module_base_interface
include ./private_interfaces/module_access_interface
type
AccessInterface* {.pure inheritable.} = ref object of RootObj
# Defines how this module view communicates with this module
include ./private_interfaces/module_view_delegate_interface
method delete*(self: AccessInterface) {.base.} =
raise newException(ValueError, "No implementation available")
# Defines how this controller communicates with this module
include ./private_interfaces/module_controller_delegate_interface
method load*(self: AccessInterface) {.base.} =
raise newException(ValueError, "No implementation available")
method isLoaded*(self: AccessInterface): bool {.base.} =
raise newException(ValueError, "No implementation available")
method getBookmarks*(self: AccessInterface): seq[bookmark_service.BookmarkDto] =
raise newException(ValueError, "No implementation available")
method storeBookmark*(self: AccessInterface, url, name: string) =
raise newException(ValueError, "No implementation available")
method deleteBookmark*(self: AccessInterface, url: string) =
raise newException(ValueError, "No implementation available")
method updateBookmark*(self: AccessInterface, oldUrl, newUrl, newName: string) =
raise newException(ValueError, "No implementation available")
method onBoomarkStored*(self: AccessInterface, url: string, name: string, imageUrl: string) =
raise newException(ValueError, "No implementation available")
method onBookmarkDeleted*(self: AccessInterface, url: string) =
raise newException(ValueError, "No implementation available")
method onBookmarkUpdated*(self: AccessInterface, oldUrl: string, newUrl: string, newName: string, newImageUrl: string) =
raise newException(ValueError, "No implementation available")
method viewDidLoad*(self: AccessInterface) {.base.} =
raise newException(ValueError, "No implementation available")

View File

@ -15,7 +15,7 @@ type
view: View
viewVariant: QVariant
moduleLoaded: bool
controller: controller.AccessInterface
controller: Controller
proc newModule*(delegate: delegate_interface.AccessInterface, bookmarkService: bookmark_service.Service): Module =
result = Module()

View File

@ -1,8 +0,0 @@
method delete*(self: AccessInterface) {.base.} =
raise newException(ValueError, "No implementation available")
method load*(self: AccessInterface) {.base.} =
raise newException(ValueError, "No implementation available")
method isLoaded*(self: AccessInterface): bool {.base.} =
raise newException(ValueError, "No implementation available")

View File

@ -1,5 +0,0 @@
type
AccessInterface* {.pure inheritable.} = ref object of RootObj
# Since nim doesn't support using concepts in second level nested types we
# define delegate interfaces within access interface.

View File

@ -1,20 +0,0 @@
method getBookmarks*(self: AccessInterface): seq[bookmark_service.BookmarkDto] =
raise newException(ValueError, "No implementation available")
method storeBookmark*(self: AccessInterface, url, name: string) =
raise newException(ValueError, "No implementation available")
method deleteBookmark*(self: AccessInterface, url: string) =
raise newException(ValueError, "No implementation available")
method updateBookmark*(self: AccessInterface, oldUrl, newUrl, newName: string) =
raise newException(ValueError, "No implementation available")
method onBoomarkStored*(self: AccessInterface, url: string, name: string, imageUrl: string) =
raise newException(ValueError, "No implementation available")
method onBookmarkDeleted*(self: AccessInterface, url: string) =
raise newException(ValueError, "No implementation available")
method onBookmarkUpdated*(self: AccessInterface, oldUrl: string, newUrl: string, newName: string, newImageUrl: string) =
raise newException(ValueError, "No implementation available")

View File

@ -1,2 +0,0 @@
method viewDidLoad*(self: AccessInterface) {.base.} =
raise newException(ValueError, "No implementation available")

View File

@ -1,11 +1,8 @@
import ./controller_interface
import io_interface
import ../../../../../app_service/service/wallet_account/service as wallet_account_service
export controller_interface
type
Controller* = ref object of controller_interface.AccessInterface
Controller* = ref object of RootObj
delegate: io_interface.AccessInterface
walletAccountService: wallet_account_service.Service
@ -17,14 +14,14 @@ proc newController*(
result.delegate = delegate
result.walletAccountService = walletAccountService
method delete*(self: Controller) =
proc delete*(self: Controller) =
discard
method init*(self: Controller) =
proc init*(self: Controller) =
discard
method getWalletAccount*(self: Controller, accountIndex: int): wallet_account_service.WalletAccountDto =
proc getWalletAccount*(self: Controller, accountIndex: int): wallet_account_service.WalletAccountDto =
return self.walletAccountService.getWalletAccount(accountIndex)
method getIndex*(self: Controller, address: string): int =
proc getIndex*(self: Controller, address: string): int =
return self.walletAccountService.getIndex(address)

View File

@ -1,22 +0,0 @@
import ../../../../../app_service/service/wallet_account/service as wallet_account_service
type
AccessInterface* {.pure inheritable.} = ref object of RootObj
## Abstract class for any input/interaction with this module.
method delete*(self: AccessInterface) {.base.} =
raise newException(ValueError, "No implementation available")
method init*(self: AccessInterface) {.base.} =
raise newException(ValueError, "No implementation available")
method getWalletAccount*(self: AccessInterface, accountIndex: int): wallet_account_service.WalletAccountDto {.base.} =
raise newException(ValueError, "No implementation available")
method getIndex*(self: AccessInterface, address: string): int {.base.} =
raise newException(ValueError, "No implementation available")
type
## Abstract class (concept) which must be implemented by object/s used in this
## module.
DelegateInterface* = concept c

View File

@ -12,7 +12,7 @@ type
Module* = ref object of io_interface.AccessInterface
delegate: delegate_interface.AccessInterface
view: View
controller: controller.AccessInterface
controller: Controller
moduleLoaded: bool
currentAccountIndex: int

View File

@ -1,15 +1,13 @@
import Tables
import result
import controller_interface
import io_interface
import options
import ../../../../../app_service/service/dapp_permissions/service as dapp_permissions_service
import ../../../../../app_service/service/wallet_account/service as wallet_account_service
export controller_interface
type
Controller* = ref object of controller_interface.AccessInterface
Controller* = ref object of RootObj
delegate: io_interface.AccessInterface
dappPermissionsService: dapp_permissions_service.Service
walletAccountService: wallet_account_service.Service
@ -24,32 +22,32 @@ proc newController*(
result.dappPermissionsService = dappPermissionsService
result.walletAccountService = walletAccountService
method delete*(self: Controller) =
proc delete*(self: Controller) =
discard
method init*(self: Controller) =
proc init*(self: Controller) =
discard
method getDapps*(self: Controller): seq[dapp_permissions_service.Dapp] =
proc getDapps*(self: Controller): seq[dapp_permissions_service.Dapp] =
return self.dappPermissionsService.getDapps()
method getDapp*(self: Controller, dapp:string, address: string): Option[dapp_permissions_service.Dapp] =
proc getDapp*(self: Controller, dapp:string, address: string): Option[dapp_permissions_service.Dapp] =
return self.dappPermissionsService.getDapp(dapp, address)
method hasPermission*(self: Controller, dapp: string, address: string, permission: dapp_permissions_service.Permission):bool =
proc hasPermission*(self: Controller, dapp: string, address: string, permission: dapp_permissions_service.Permission):bool =
return self.dappPermissionsService.hasPermission(dapp, address, permission)
method addPermission*(self: Controller, dapp: string, address: string, permission: dapp_permissions_service.Permission) =
proc addPermission*(self: Controller, dapp: string, address: string, permission: dapp_permissions_service.Permission) =
discard self.dappPermissionsService.addPermission(dapp, address, permission)
method disconnectAddress*(self: Controller, dappName: string, address: string) =
proc disconnectAddress*(self: Controller, dappName: string, address: string) =
discard self.dappPermissionsService.disconnectAddress(dappName, address)
method disconnect*(self: Controller, dappName: string) =
proc disconnect*(self: Controller, dappName: string) =
discard self.dappPermissionsService.disconnect(dappName)
method removePermission*(self: Controller, dappName: string, address: string, permission: dapp_permissions_service.Permission) =
proc removePermission*(self: Controller, dappName: string, address: string, permission: dapp_permissions_service.Permission) =
discard self.dappPermissionsService.removePermission(dappName, address, permission)
method getAccountForAddress*(self: Controller, address: string): WalletAccountDto =
proc getAccountForAddress*(self: Controller, address: string): WalletAccountDto =
return self.walletAccountService.getAccountByAddress(address)

View File

@ -1,38 +0,0 @@
import ../../../../../app_service/service/dapp_permissions/service as dapp_permissions_service
import ../../../../../app_service/service/wallet_account/service as wallet_account_service
import options
type
AccessInterface* {.pure inheritable.} = ref object of RootObj
## Abstract class for any input/interaction with this module.
method delete*(self: AccessInterface) {.base.} =
raise newException(ValueError, "No implementation available")
method init*(self: AccessInterface) {.base.} =
raise newException(ValueError, "No implementation available")
method getDapps*(self: AccessInterface): seq[dapp_permissions_service.Dapp] {.base.} =
raise newException(ValueError, "No implementation available")
method getDapp*(self: AccessInterface, dapp: string, address: string): Option[dapp_permissions_service.Dapp] {.base.} =
raise newException(ValueError, "No implementation available")
method addPermission*(self: AccessInterface, dapp: string, address: string, permission: dapp_permissions_service.Permission) {.base.} =
raise newException(ValueError, "No implementation available")
method hasPermission*(self: AccessInterface, dapp: string, address: string, permission: dapp_permissions_service.Permission):bool {.base.} =
raise newException(ValueError, "No implementation available")
method disconnectAddress*(self: AccessInterface, dapp: string, address: string) {.base.} =
raise newException(ValueError, "No implementation available")
method disconnect*(self: AccessInterface, dapp: string) {.base.} =
raise newException(ValueError, "No implementation available")
method removePermission*(self: AccessInterface, dapp: string, address: string, permission: dapp_permissions_service.Permission) {.base.} =
raise newException(ValueError, "No implementation available")
method getAccountForAddress*(self: AccessInterface, address: string): WalletAccountDto {.base.} =
raise newException(ValueError, "No implementation available")

View File

@ -1,11 +1,35 @@
import ../../../../../app_service/service/dapp_permissions/service as dapp_permissions_service
type
AccessInterface* {.pure inheritable.} = ref object of RootObj
# Defines how parent module accesses this module
include ./private_interfaces/module_base_interface
include ./private_interfaces/module_access_interface
method delete*(self: AccessInterface) {.base.} =
raise newException(ValueError, "No implementation available")
# Defines how this module view communicates with this module
include ./private_interfaces/module_view_delegate_interface
method load*(self: AccessInterface) {.base.} =
raise newException(ValueError, "No implementation available")
# Defines how this controller communicates with this module
include ./private_interfaces/module_controller_delegate_interface
method isLoaded*(self: AccessInterface): bool {.base.} =
raise newException(ValueError, "No implementation available")
method hasPermission*(self: AccessInterface, hostname: string, address: string, permission: string): bool =
raise newException(ValueError, "No implementation available")
method disconnectAddress*(self: AccessInterface, dapp: string, address: string) {.base.} =
raise newException(ValueError, "No implementation available")
method removePermission*(self: AccessInterface, dapp: string, address: string, permission: string) {.base.} =
raise newException(ValueError, "No implementation available")
method disconnect*(self: AccessInterface, dapp: string) {.base.} =
raise newException(ValueError, "No implementation available")
method fetchDapps*(self: AccessInterface) =
raise newException(ValueError, "No implementation available")
method fetchPermissions*(self: AccessInterface, dapp: string, address: string) =
raise newException(ValueError, "No implementation available")
method viewDidLoad*(self: AccessInterface) {.base.} =
raise newException(ValueError, "No implementation available")
method addPermission*(self: AccessInterface, hostname: string, address: string, permission: string) =
raise newException(ValueError, "No implementation available")

View File

@ -18,7 +18,7 @@ type
view: View
viewVariant: QVariant
moduleLoaded: bool
controller: controller.AccessInterface
controller: Controller
proc newModule*(
delegate: delegate_interface.AccessInterface,

View File

@ -1,8 +0,0 @@
method delete*(self: AccessInterface) {.base.} =
raise newException(ValueError, "No implementation available")
method load*(self: AccessInterface) {.base.} =
raise newException(ValueError, "No implementation available")
method isLoaded*(self: AccessInterface): bool {.base.} =
raise newException(ValueError, "No implementation available")

View File

@ -1,5 +0,0 @@
type
AccessInterface* {.pure inheritable.} = ref object of RootObj
# Since nim doesn't support using concepts in second level nested types we
# define delegate interfaces within access interface.

View File

@ -1,17 +0,0 @@
method hasPermission*(self: AccessInterface, hostname: string, address: string, permission: string): bool =
raise newException(ValueError, "No implementation available")
method disconnectAddress*(self: AccessInterface, dapp: string, address: string) {.base.} =
raise newException(ValueError, "No implementation available")
method removePermission*(self: AccessInterface, dapp: string, address: string, permission: string) {.base.} =
raise newException(ValueError, "No implementation available")
method disconnect*(self: AccessInterface, dapp: string) {.base.} =
raise newException(ValueError, "No implementation available")
method fetchDapps*(self: AccessInterface) =
raise newException(ValueError, "No implementation available")
method fetchPermissions*(self: AccessInterface, dapp: string, address: string) =
raise newException(ValueError, "No implementation available")

View File

@ -1,5 +0,0 @@
method viewDidLoad*(self: AccessInterface) {.base.} =
raise newException(ValueError, "No implementation available")
method addPermission*(self: AccessInterface, hostname: string, address: string, permission: string) =
raise newException(ValueError, "No implementation available")

View File

@ -1,15 +1,23 @@
# Defines how parent module accesses this module
include ./private_interfaces/module_base_interface
include ./private_interfaces/module_access_interface
type
AccessInterface* {.pure inheritable.} = ref object of RootObj
# Defines how this module view communicates with this module
include ./private_interfaces/module_view_delegate_interface
method delete*(self: AccessInterface) {.base.} =
raise newException(ValueError, "No implementation available")
# Defines how this controller communicates with this module
include ./private_interfaces/module_controller_delegate_interface
method load*(self: AccessInterface) {.base.} =
raise newException(ValueError, "No implementation available")
# Defines how submodules of this module communicate with this module
# will be added if needed
include ./private_interfaces/module_provider_delegate_interface
include ./private_interfaces/module_bookmark_delegate_interface
include ./private_interfaces/module_dapps_delegate_interface
method isLoaded*(self: AccessInterface): bool {.base.} =
raise newException(ValueError, "No implementation available")
method bookmarkDidLoad*(self: AccessInterface) {.base.} =
raise newException(ValueError, "No implementation available")
method dappsDidLoad*(self: AccessInterface) {.base.} =
raise newException(ValueError, "No implementation available")
method providerDidLoad*(self: AccessInterface) {.base.} =
raise newException(ValueError, "No implementation available")
method viewDidLoad*(self: AccessInterface) {.base.} =
raise newException(ValueError, "No implementation available")

View File

@ -1,8 +0,0 @@
method delete*(self: AccessInterface) {.base.} =
raise newException(ValueError, "No implementation available")
method load*(self: AccessInterface) {.base.} =
raise newException(ValueError, "No implementation available")
method isLoaded*(self: AccessInterface): bool {.base.} =
raise newException(ValueError, "No implementation available")

View File

@ -1,5 +0,0 @@
type
AccessInterface* {.pure inheritable.} = ref object of RootObj
# Since nim doesn't support using concepts in second level nested types we
# define delegate interfaces within access interface.

View File

@ -1,2 +0,0 @@
method bookmarkDidLoad*(self: AccessInterface) {.base.} =
raise newException(ValueError, "No implementation available")

View File

@ -1,2 +0,0 @@
method dappsDidLoad*(self: AccessInterface) {.base.} =
raise newException(ValueError, "No implementation available")

View File

@ -1,2 +0,0 @@
method providerDidLoad*(self: AccessInterface) {.base.} =
raise newException(ValueError, "No implementation available")

View File

@ -1,2 +0,0 @@
method viewDidLoad*(self: AccessInterface) {.base.} =
raise newException(ValueError, "No implementation available")

View File

@ -1,13 +1,11 @@
import strutils
import controller_interface
import io_interface
import ../../../../../app_service/service/settings/service as settings_service
import ../../../../../app_service/service/provider/service as provider_service
export controller_interface
type
Controller* = ref object of controller_interface.AccessInterface
Controller* = ref object of RootObj
delegate: io_interface.AccessInterface
settingsService: settings_service.Service
providerService: provider_service.Service
@ -21,27 +19,27 @@ proc newController*(delegate: io_interface.AccessInterface,
result.settingsService = settingsService
result.providerService = providerService
method delete*(self: Controller) =
proc delete*(self: Controller) =
discard
method init*(self: Controller) =
proc init*(self: Controller) =
discard
method getDappsAddress*(self: Controller): string =
proc getDappsAddress*(self: Controller): string =
return self.settingsService.getDappsAddress()
method setDappsAddress*(self: Controller, address: string) =
proc setDappsAddress*(self: Controller, address: string) =
if self.settingsService.saveDappsAddress(address):
self.delegate.onDappAddressChanged(address)
method getCurrentNetworkId*(self: Controller): int =
proc getCurrentNetworkId*(self: Controller): int =
return self.settingsService.getCurrentNetworkId()
method getCurrentNetwork*(self: Controller): string =
proc getCurrentNetwork*(self: Controller): string =
return self.settingsService.getCurrentNetwork()
method postMessage*(self: Controller, requestType: string, message: string): string =
proc postMessage*(self: Controller, requestType: string, message: string): string =
return self.providerService.postMessage(requestType, message)
method ensResourceURL*(self: Controller, ens: string, url: string): (string, string, string, string, bool) =
proc ensResourceURL*(self: Controller, ens: string, url: string): (string, string, string, string, bool) =
return self.providerService.ensResourceURL(ens, url)

View File

@ -1,27 +0,0 @@
type
AccessInterface* {.pure inheritable.} = ref object of RootObj
## Abstract class for any input/interaction with this module.
method delete*(self: AccessInterface) {.base.} =
raise newException(ValueError, "No implementation available")
method init*(self: AccessInterface) {.base.} =
raise newException(ValueError, "No implementation available")
method getDappsAddress*(self: AccessInterface): string {.base.} =
raise newException(ValueError, "No implementation available")
method setDappsAddress*(self: AccessInterface, address: string) {.base.} =
raise newException(ValueError, "No implementation available")
method getCurrentNetworkId*(self: AccessInterface): int {.base.} =
raise newException(ValueError, "No implementation available")
method getCurrentNetwork*(self: AccessInterface): string {.base.} =
raise newException(ValueError, "No implementation available")
method postMessage*(self: AccessInterface, requestType: string, message: string): string {.base.} =
raise newException(ValueError, "No implementation available")
method ensResourceURL*(self: AccessInterface, ens: string, url: string): (string, string, string, string, bool) =
raise newException(ValueError, "No implementation available")

View File

@ -1,9 +1,29 @@
# Defines how parent module accesses this module
include ./private_interfaces/module_base_interface
include ./private_interfaces/module_access_interface
type
AccessInterface* {.pure inheritable.} = ref object of RootObj
# Defines how this module view communicates with this module
include ./private_interfaces/module_view_delegate_interface
method delete*(self: AccessInterface) {.base.} =
raise newException(ValueError, "No implementation available")
# Defines how this controller communicates with this module
include ./private_interfaces/module_controller_delegate_interface
method load*(self: AccessInterface) {.base.} =
raise newException(ValueError, "No implementation available")
method isLoaded*(self: AccessInterface): bool {.base.} =
raise newException(ValueError, "No implementation available")
method setDappsAddress*(self: AccessInterface, newDappAddress: string) {.base.} =
raise newException(ValueError, "No implementation available")
method onDappAddressChanged*(self: AccessInterface, newDappAddress: string) {.base.} =
raise newException(ValueError, "No implementation available")
method disconnect*(self: AccessInterface, dappName: string, address: string) {.base.} =
raise newException(ValueError, "No implementation available")
method postMessage*(self: AccessInterface, requestType: string, message: string): string {.base.} =
raise newException(ValueError, "No implementation available")
method ensResourceURL*(self: AccessInterface, ens: string, url: string): (string, string, string, string, bool) =
raise newException(ValueError, "No implementation available")
method viewDidLoad*(self: AccessInterface) {.base.} =
raise newException(ValueError, "No implementation available")

View File

@ -14,7 +14,7 @@ type
view: View
viewVariant: QVariant
moduleLoaded: bool
controller: controller.AccessInterface
controller: Controller
proc newModule*(delegate: delegate_interface.AccessInterface,
settingsService: settings_service.Service,

View File

@ -1,8 +0,0 @@
method delete*(self: AccessInterface) {.base.} =
raise newException(ValueError, "No implementation available")
method load*(self: AccessInterface) {.base.} =
raise newException(ValueError, "No implementation available")
method isLoaded*(self: AccessInterface): bool {.base.} =
raise newException(ValueError, "No implementation available")

View File

@ -1,5 +0,0 @@
type
AccessInterface* {.pure inheritable.} = ref object of RootObj
# Since nim doesn't support using concepts in second level nested types we
# define delegate interfaces within access interface.

View File

@ -1,14 +0,0 @@
method setDappsAddress*(self: AccessInterface, newDappAddress: string) {.base.} =
raise newException(ValueError, "No implementation available")
method onDappAddressChanged*(self: AccessInterface, newDappAddress: string) {.base.} =
raise newException(ValueError, "No implementation available")
method disconnect*(self: AccessInterface, dappName: string, address: string) {.base.} =
raise newException(ValueError, "No implementation available")
method postMessage*(self: AccessInterface, requestType: string, message: string): string {.base.} =
raise newException(ValueError, "No implementation available")
method ensResourceURL*(self: AccessInterface, ens: string, url: string): (string, string, string, string, bool) =
raise newException(ValueError, "No implementation available")

View File

@ -1,2 +0,0 @@
method viewDidLoad*(self: AccessInterface) {.base.} =
raise newException(ValueError, "No implementation available")

View File

@ -1,6 +1,5 @@
import Tables
import controller_interface
import io_interface
import ../../../../../app_service/service/settings/service as settings_service
@ -14,10 +13,9 @@ import ../../../../../app_service/service/wallet_account/service as wallet_accou
import ../../../../core/signals/types
import ../../../../core/eventemitter
export controller_interface
type
Controller* = ref object of controller_interface.AccessInterface
Controller* = ref object of RootObj
delegate: io_interface.AccessInterface
events: EventEmitter
sectionId: string
@ -47,10 +45,10 @@ proc newController*(delegate: io_interface.AccessInterface, events: EventEmitter
result.communityService = communityService
result.messageService = messageService
method delete*(self: Controller) =
proc delete*(self: Controller) =
discard
method init*(self: Controller) =
proc init*(self: Controller) =
self.events.on(SIGNAL_MESSAGES_LOADED) do(e:Args):
let args = MessagesLoadedArgs(e)
if(self.chatId != args.chatId or args.pinnedMessages.len == 0):
@ -126,69 +124,69 @@ method init*(self: Controller) =
return
self.delegate.onChatRenamed(args.newName)
method getMyChatId*(self: Controller): string =
proc getMyChatId*(self: Controller): string =
return self.chatId
method getChatDetails*(self: Controller): ChatDto =
proc getChatDetails*(self: Controller): ChatDto =
return self.chatService.getChatById(self.chatId)
method getCommunityDetails*(self: Controller): CommunityDto =
proc getCommunityDetails*(self: Controller): CommunityDto =
return self.communityService.getCommunityById(self.sectionId)
method getOneToOneChatNameAndImage*(self: Controller): tuple[name: string, image: string, isIdenticon: bool] =
proc getOneToOneChatNameAndImage*(self: Controller): tuple[name: string, image: string, isIdenticon: bool] =
return self.chatService.getOneToOneChatNameAndImage(self.chatId)
method belongsToCommunity*(self: Controller): bool =
proc belongsToCommunity*(self: Controller): bool =
return self.belongsToCommunity
method unpinMessage*(self: Controller, messageId: string) =
proc unpinMessage*(self: Controller, messageId: string) =
self.messageService.pinUnpinMessage(self.chatId, messageId, false)
method getMessageDetails*(self: Controller, messageId: string):
proc getMessageDetails*(self: Controller, messageId: string):
tuple[message: MessageDto, reactions: seq[ReactionDto], error: string] =
return self.messageService.getDetailsForMessage(self.chatId, messageId)
method isUsersListAvailable*(self: Controller): bool =
proc isUsersListAvailable*(self: Controller): bool =
return self.isUsersListAvailable
method getMyAddedContacts*(self: Controller): seq[ContactsDto] =
proc getMyAddedContacts*(self: Controller): seq[ContactsDto] =
return self.contactService.getAddedContacts()
method muteChat*(self: Controller) =
proc muteChat*(self: Controller) =
self.chatService.muteChat(self.chatId)
method unmuteChat*(self: Controller) =
proc unmuteChat*(self: Controller) =
self.chatService.unmuteChat(self.chatId)
method unblockChat*(self: Controller) =
proc unblockChat*(self: Controller) =
self.contactService.unblockContact(self.chatId)
method markAllMessagesRead*(self: Controller) =
proc markAllMessagesRead*(self: Controller) =
self.messageService.markAllMessagesRead(self.chatId)
method clearChatHistory*(self: Controller) =
proc clearChatHistory*(self: Controller) =
self.chatService.clearChatHistory(self.chatId)
method leaveChat*(self: Controller) =
proc leaveChat*(self: Controller) =
self.chatService.leaveChat(self.chatId)
method getContactById*(self: Controller, contactId: string): ContactsDto =
proc getContactById*(self: Controller, contactId: string): ContactsDto =
return self.contactService.getContactById(contactId)
method getContactDetails*(self: Controller, contactId: string): ContactDetails =
proc getContactDetails*(self: Controller, contactId: string): ContactDetails =
return self.contactService.getContactDetails(contactId)
method getCurrentFleet*(self: Controller): string =
proc getCurrentFleet*(self: Controller): string =
return self.settingsService.getFleetAsString()
method getRenderedText*(self: Controller, parsedTextArray: seq[ParsedText]): string =
proc getRenderedText*(self: Controller, parsedTextArray: seq[ParsedText]): string =
return self.messageService.getRenderedText(parsedTextArray)
method decodeContentHash*(self: Controller, hash: string): string =
proc decodeContentHash*(self: Controller, hash: string): string =
return eth_utils.decodeContentHash(hash)
method getTransactionDetails*(self: Controller, message: MessageDto): (string,string) =
proc getTransactionDetails*(self: Controller, message: MessageDto): (string,string) =
return self.messageService.getTransactionDetails(message)
method getWalletAccounts*(self: Controller): seq[wallet_account_service.WalletAccountDto] =
proc getWalletAccounts*(self: Controller): seq[wallet_account_service.WalletAccountDto] =
return self.messageService.getWalletAccounts()

View File

@ -1,84 +0,0 @@
import ../../../../../app_service/service/contacts/dto/[contacts]
import ../../../../../app_service/service/message/dto/[message, reaction]
import ../../../../../app_service/service/community/dto/[community]
import ../../../../../app_service/service/chat/dto/[chat]
import ../../../../../app_service/service/contacts/service
import ../../../../../app_service/service/wallet_account/[dto]
type
AccessInterface* {.pure inheritable.} = ref object of RootObj
## Abstract class for any input/interaction with this module.
method delete*(self: AccessInterface) {.base.} =
raise newException(ValueError, "No implementation available")
method init*(self: AccessInterface) {.base.} =
raise newException(ValueError, "No implementation available")
method getMyChatId*(self: AccessInterface): string {.base.} =
raise newException(ValueError, "No implementation available")
method getChatDetails*(self: AccessInterface): ChatDto {.base.} =
raise newException(ValueError, "No implementation available")
method getCommunityDetails*(self: AccessInterface): CommunityDto {.base.} =
raise newException(ValueError, "No implementation available")
method getOneToOneChatNameAndImage*(self: AccessInterface): tuple[name: string, image: string, isIdenticon: bool]
{.base.} =
raise newException(ValueError, "No implementation available")
method belongsToCommunity*(self: AccessInterface): bool {.base.} =
raise newException(ValueError, "No implementation available")
method unpinMessage*(self: AccessInterface, messageId: string) {.base.} =
raise newException(ValueError, "No implementation available")
method getMessageDetails*(self: AccessInterface, messageId: string):
tuple[message: MessageDto, reactions: seq[ReactionDto], error: string] {.base.} =
raise newException(ValueError, "No implementation available")
method isUsersListAvailable*(self: AccessInterface): bool {.base.} =
raise newException(ValueError, "No implementation available")
method getMyAddedContacts*(self: AccessInterface): seq[ContactsDto] {.base.} =
raise newException(ValueError, "No implementation available")
method muteChat*(self: AccessInterface) {.base.} =
raise newException(ValueError, "No implementation available")
method unmuteChat*(self: AccessInterface) {.base.} =
raise newException(ValueError, "No implementation available")
method unblockChat*(self: AccessInterface) {.base.} =
raise newException(ValueError, "No implementation available")
method markAllMessagesRead*(self: AccessInterface) {.base.} =
raise newException(ValueError, "No implementation available")
method clearChatHistory*(self: AccessInterface) {.base.} =
raise newException(ValueError, "No implementation available")
method leaveChat*(self: AccessInterface) {.base.} =
raise newException(ValueError, "No implementation available")
method getContactById*(self: AccessInterface, contactId: string): ContactsDto {.base.} =
raise newException(ValueError, "No implementation available")
method getContactDetails*(self: AccessInterface, contactId: string): ContactDetails {.base.} =
raise newException(ValueError, "No implementation available")
method getCurrentFleet*(self: AccessInterface): string {.base.} =
raise newException(ValueError, "No implementation available")
method getRenderedText*(self: AccessInterface, parsedTextArray: seq[ParsedText]): string {.base.} =
raise newException(ValueError, "No implementation available")
method decodeContentHash*(self: AccessInterface, hash: string): string {.base.} =
raise newException(ValueError, "No implementation available")
method getTransactionDetails*(self: AccessInterface, message: MessageDto): (string,string) {.base.} =
raise newException(ValueError, "No implementation available")
method getWalletAccounts*(self: AccessInterface): seq[WalletAccountDto] {.base.} =
raise newException(ValueError, "No implementation available")

View File

@ -1,4 +1,3 @@
import controller_interface
import io_interface
import ../../../../../../app_service/service/community/service as community_service
@ -6,10 +5,8 @@ import ../../../../../../app_service/service/chat/service as chat_service
import ../../../../../../app_service/service/gif/service as gif_service
import ../../../../../../app_service/service/gif/dto
export controller_interface
type
Controller* = ref object of controller_interface.AccessInterface
Controller* = ref object of RootObj
delegate: io_interface.AccessInterface
sectionId: string
chatId: string
@ -36,22 +33,22 @@ proc newController*(
result.communityService = communityService
result.gifService = gifService
method delete*(self: Controller) =
proc delete*(self: Controller) =
discard
method init*(self: Controller) =
proc init*(self: Controller) =
discard
method getChatId*(self: Controller): string =
proc getChatId*(self: Controller): string =
return self.chatId
method belongsToCommunity*(self: Controller): bool =
proc belongsToCommunity*(self: Controller): bool =
return self.belongsToCommunity
method sendImages*(self: Controller, imagePathsJson: string): string =
proc sendImages*(self: Controller, imagePathsJson: string): string =
self.chatService.sendImages(self.chatId, imagePathsJson)
method sendChatMessage*(
proc sendChatMessage*(
self: Controller,
msg: string,
replyTo: string,
@ -60,41 +57,41 @@ method sendChatMessage*(
self.chatService.sendChatMessage(self.chatId, msg, replyTo, contentType, preferredUsername)
method requestAddressForTransaction*(self: Controller, fromAddress: string, amount: string, tokenAddress: string) =
proc requestAddressForTransaction*(self: Controller, fromAddress: string, amount: string, tokenAddress: string) =
self.chatService.requestAddressForTransaction(self.chatId, fromAddress, amount, tokenAddress)
method requestTransaction*(self: Controller, fromAddress: string, amount: string, tokenAddress: string) =
proc requestTransaction*(self: Controller, fromAddress: string, amount: string, tokenAddress: string) =
self.chatService.requestTransaction(self.chatId, fromAddress, amount, tokenAddress)
method declineRequestTransaction*(self: Controller, messageId: string) =
proc declineRequestTransaction*(self: Controller, messageId: string) =
self.chatService.declineRequestTransaction(messageId)
method declineRequestAddressForTransaction*(self: Controller, messageId: string) =
proc declineRequestAddressForTransaction*(self: Controller, messageId: string) =
self.chatService.declineRequestAddressForTransaction(messageId)
method acceptRequestAddressForTransaction*(self: Controller, messageId: string, address: string) =
proc acceptRequestAddressForTransaction*(self: Controller, messageId: string, address: string) =
self.chatService.acceptRequestAddressForTransaction(messageId, address)
method acceptRequestTransaction*(self: Controller, transactionHash: string, messageId: string, signature: string) =
proc acceptRequestTransaction*(self: Controller, transactionHash: string, messageId: string, signature: string) =
self.chatService.acceptRequestTransaction(transactionHash, messageId, signature)
method searchGifs*(self: Controller, query: string): seq[GifDto] =
proc searchGifs*(self: Controller, query: string): seq[GifDto] =
return self.gifService.search(query)
method getTrendingsGifs*(self: Controller): seq[GifDto] =
proc getTrendingsGifs*(self: Controller): seq[GifDto] =
return self.gifService.getTrendings()
method getRecentsGifs*(self: Controller): seq[GifDto] =
proc getRecentsGifs*(self: Controller): seq[GifDto] =
return self.gifService.getRecents()
method getFavoritesGifs*(self: Controller): seq[GifDto] =
proc getFavoritesGifs*(self: Controller): seq[GifDto] =
return self.gifService.getFavorites()
method toggleFavoriteGif*(self: Controller, item: GifDto) =
proc toggleFavoriteGif*(self: Controller, item: GifDto) =
self.gifService.toggleFavorite(item)
method addToRecentsGif*(self: Controller, item: GifDto) =
proc addToRecentsGif*(self: Controller, item: GifDto) =
self.gifService.addToRecents(item)
method isFavorite*(self: Controller, item: GifDto): bool =
proc isFavorite*(self: Controller, item: GifDto): bool =
return self.gifService.isFavorite(item)

View File

@ -1,62 +0,0 @@
import ../../../../../../app_service/service/gif/dto
type
AccessInterface* {.pure inheritable.} = ref object of RootObj
## Abstract class for any input/interaction with this module.
method delete*(self: AccessInterface) {.base.} =
raise newException(ValueError, "No implementation available")
method init*(self: AccessInterface) {.base.} =
raise newException(ValueError, "No implementation available")
method getChatId*(self: AccessInterface): string {.base.} =
raise newException(ValueError, "No implementation available")
method belongsToCommunity*(self: AccessInterface): bool {.base.} =
raise newException(ValueError, "No implementation available")
method sendImages*(self: AccessInterface, imagePathsJson: string): string {.base.} =
raise newException(ValueError, "No implementation available")
method sendChatMessage*(self: AccessInterface, msg: string, replyTo: string, contentType: int, preferredUsername: string = "") {.base.} =
raise newException(ValueError, "No implementation available")
method requestAddressForTransaction*(self: AccessInterface, fromAddress: string, amount: string, tokenAddress: string) {.base.} =
raise newException(ValueError, "No implementation available")
method requestTransaction*(self: AccessInterface, fromAddress: string, amount: string, tokenAddress: string) {.base.} =
raise newException(ValueError, "No implementation available")
method declineRequestTransaction*(self: AccessInterface, messageId: string) {.base.} =
raise newException(ValueError, "No implementation available")
method declineRequestAddressForTransaction*(self: AccessInterface, messageId: string) {.base.} =
raise newException(ValueError, "No implementation available")
method acceptRequestAddressForTransaction*(self: AccessInterface, messageId: string, address: string) {.base.} =
raise newException(ValueError, "No implementation available")
method acceptRequestTransaction*(self: AccessInterface, transactionHash: string, messageId: string, signature: string) {.base.} =
raise newException(ValueError, "No implementation available")
method searchGifs*(self: AccessInterface, query: string): seq[GifDto] {.base.} =
raise newException(ValueError, "No implementation available")
method getTrendingsGifs*(self: AccessInterface): seq[GifDto] {.base.} =
raise newException(ValueError, "No implementation available")
method getRecentsGifs*(self: AccessInterface): seq[GifDto] {.base.} =
raise newException(ValueError, "No implementation available")
method getFavoritesGifs*(self: AccessInterface): seq[GifDto] {.base.} =
raise newException(ValueError, "No implementation available")
method toggleFavoriteGif*(self: AccessInterface, item: GifDto) {.base.} =
raise newException(ValueError, "No implementation available")
method addToRecentsGif*(self: AccessInterface, item: GifDto) {.base.} =
raise newException(ValueError, "No implementation available")
method isFavorite*(self: AccessInterface, item: GifDto): bool {.base.} =
raise newException(ValueError, "No implementation available")

View File

@ -1,12 +1,66 @@
# Defines how parent module accesses this module
include ./private_interfaces/module_base_interface
include ./private_interfaces/module_access_interface
import NimQml
# Defines how this module view communicates with this module
include ./private_interfaces/module_view_delegate_interface
import ../../../../../../app_service/service/gif/dto
# Defines how this controller communicates with this module
include ./private_interfaces/module_controller_delegate_interface
type
AccessInterface* {.pure inheritable.} = ref object of RootObj
# Defines how submodules of this module communicate with this module
# will be added if needed
method delete*(self: AccessInterface) {.base.} =
raise newException(ValueError, "No implementation available")
method load*(self: AccessInterface) {.base.} =
raise newException(ValueError, "No implementation available")
method isLoaded*(self: AccessInterface): bool {.base.} =
raise newException(ValueError, "No implementation available")
method getModuleAsVariant*(self: AccessInterface): QVariant {.base.} =
raise newException(ValueError, "No implementation available")
method sendChatMessage*(self: AccessInterface, msg: string, replyTo: string, contentType: int) {.base.} =
raise newException(ValueError, "No implementation available")
method sendImages*(self: AccessInterface, imagePathsJson: string): string {.base.} =
raise newException(ValueError, "No implementation available")
method requestAddressForTransaction*(self: AccessInterface, fromAddress: string, amount: string, tokenAddress: string) {.base.} =
raise newException(ValueError, "No implementation available")
method requestTransaction*(self: AccessInterface, fromAddress: string, amount: string, tokenAddress: string) {.base.} =
raise newException(ValueError, "No implementation available")
method declineRequestTransaction*(self: AccessInterface, messageId: string) {.base.} =
raise newException(ValueError, "No implementation available")
method declineRequestAddressForTransaction*(self: AccessInterface, messageId: string) {.base.} =
raise newException(ValueError, "No implementation available")
method acceptRequestAddressForTransaction*(self: AccessInterface, messageId: string, address: string) {.base.} =
raise newException(ValueError, "No implementation available")
method acceptRequestTransaction*(self: AccessInterface, transactionHash: string, messageId: string, signature: string) {.base.} =
raise newException(ValueError, "No implementation available")
method searchGifs*(self: AccessInterface, query: string): seq[GifDto] {.base.} =
raise newException(ValueError, "No implementation available")
method getTrendingsGifs*(self: AccessInterface): seq[GifDto] {.base.} =
raise newException(ValueError, "No implementation available")
method getRecentsGifs*(self: AccessInterface): seq[GifDto] {.base.} =
raise newException(ValueError, "No implementation available")
method getFavoritesGifs*(self: AccessInterface): seq[GifDto] {.base.} =
raise newException(ValueError, "No implementation available")
method toggleFavoriteGif*(self: AccessInterface, item: GifDto) {.base.} =
raise newException(ValueError, "No implementation available")
method addToRecentsGif*(self: AccessInterface, item: GifDto) {.base.} =
raise newException(ValueError, "No implementation available")
method isFavorite*(self: AccessInterface, item: GifDto): bool {.base.} =
raise newException(ValueError, "No implementation available")
method viewDidLoad*(self: AccessInterface) {.base.} =
raise newException(ValueError, "No implementation available")

View File

@ -16,7 +16,7 @@ type
delegate: delegate_interface.AccessInterface
view: View
viewVariant: QVariant
controller: controller.AccessInterface
controller: Controller
moduleLoaded: bool
proc newModule*(

View File

@ -1,61 +0,0 @@
import NimQml
import ../../../../../../../app_service/service/gif/dto
method delete*(self: AccessInterface) {.base.} =
raise newException(ValueError, "No implementation available")
method load*(self: AccessInterface) {.base.} =
raise newException(ValueError, "No implementation available")
method isLoaded*(self: AccessInterface): bool {.base.} =
raise newException(ValueError, "No implementation available")
method getModuleAsVariant*(self: AccessInterface): QVariant {.base.} =
raise newException(ValueError, "No implementation available")
method sendChatMessage*(self: AccessInterface, msg: string, replyTo: string, contentType: int) {.base.} =
raise newException(ValueError, "No implementation available")
method sendImages*(self: AccessInterface, imagePathsJson: string): string {.base.} =
raise newException(ValueError, "No implementation available")
method requestAddressForTransaction*(self: AccessInterface, fromAddress: string, amount: string, tokenAddress: string) {.base.} =
raise newException(ValueError, "No implementation available")
method requestTransaction*(self: AccessInterface, fromAddress: string, amount: string, tokenAddress: string) {.base.} =
raise newException(ValueError, "No implementation available")
method declineRequestTransaction*(self: AccessInterface, messageId: string) {.base.} =
raise newException(ValueError, "No implementation available")
method declineRequestAddressForTransaction*(self: AccessInterface, messageId: string) {.base.} =
raise newException(ValueError, "No implementation available")
method acceptRequestAddressForTransaction*(self: AccessInterface, messageId: string, address: string) {.base.} =
raise newException(ValueError, "No implementation available")
method acceptRequestTransaction*(self: AccessInterface, transactionHash: string, messageId: string, signature: string) {.base.} =
raise newException(ValueError, "No implementation available")
method searchGifs*(self: AccessInterface, query: string): seq[GifDto] {.base.} =
raise newException(ValueError, "No implementation available")
method getTrendingsGifs*(self: AccessInterface): seq[GifDto] {.base.} =
raise newException(ValueError, "No implementation available")
method getRecentsGifs*(self: AccessInterface): seq[GifDto] {.base.} =
raise newException(ValueError, "No implementation available")
method getFavoritesGifs*(self: AccessInterface): seq[GifDto] {.base.} =
raise newException(ValueError, "No implementation available")
method toggleFavoriteGif*(self: AccessInterface, item: GifDto) {.base.} =
raise newException(ValueError, "No implementation available")
method addToRecentsGif*(self: AccessInterface, item: GifDto) {.base.} =
raise newException(ValueError, "No implementation available")
method isFavorite*(self: AccessInterface, item: GifDto): bool {.base.} =
raise newException(ValueError, "No implementation available")

View File

@ -1,5 +0,0 @@
type
AccessInterface* {.pure inheritable.} = ref object of RootObj
# Since nim doesn't support using concepts in second level nested types we
# define delegate interfaces within access interface.

View File

@ -1,2 +0,0 @@
method viewDidLoad*(self: AccessInterface) {.base.} =
raise newException(ValueError, "No implementation available")

View File

@ -1,14 +1,110 @@
# Defines how parent module accesses this module
include ./private_interfaces/module_base_interface
include ./private_interfaces/module_access_interface
import NimQml
# Defines how this module view communicates with this module
include ./private_interfaces/module_view_delegate_interface
import ../../../../../app_service/service/message/dto/pinned_message
import ../../../../../app_service/service/chat/dto/chat
# Defines how this controller communicates with this module
include ./private_interfaces/module_controller_delegate_interface
type
AccessInterface* {.pure inheritable.} = ref object of RootObj
# Defines how submodules of this module communicate with this module
include ./private_interfaces/module_input_area_delegate_interface
include ./private_interfaces/module_messages_delegate_interface
include ./private_interfaces/module_users_delegate_interface
method delete*(self: AccessInterface) {.base.} =
raise newException(ValueError, "No implementation available")
method load*(self: AccessInterface) {.base.} =
raise newException(ValueError, "No implementation available")
method isLoaded*(self: AccessInterface): bool {.base.} =
raise newException(ValueError, "No implementation available")
method getModuleAsVariant*(self: AccessInterface): QVariant {.base.} =
raise newException(ValueError, "No implementation available")
method onNotificationsUpdated*(self: AccessInterface, hasUnreadMessages: bool, notificationCount: int) {.base.} =
raise newException(ValueError, "No implementation available")
method newPinnedMessagesLoaded*(self: AccessInterface, pinnedMessages: seq[PinnedMessageDto]) {.base.} =
raise newException(ValueError, "No implementation available")
method onUnpinMessage*(self: AccessInterface, messageId: string) {.base.} =
raise newException(ValueError, "No implementation available")
method onPinMessage*(self: AccessInterface, mmessageId: string, actionInitiatedBy: string) {.base.} =
raise newException(ValueError, "No implementation available")
method onChatMuted*(self: AccessInterface) {.base.} =
raise newException(ValueError, "No implementation available")
method onChatUnmuted*(self: AccessInterface) {.base.} =
raise newException(ValueError, "No implementation available")
method onReactionAdded*(self: AccessInterface, messageId: string, emojiId: int, reactionId: string) {.base.} =
raise newException(ValueError, "No implementation available")
method onReactionRemoved*(self: AccessInterface, messageId: string, emojiId: int, reactionId: string) {.base.} =
raise newException(ValueError, "No implementation available")
method toggleReactionFromOthers*(self: AccessInterface, messageId: string, emojiId: int, reactionId: string,
reactionFrom: string) {.base.} =
raise newException(ValueError, "No implementation available")
method onContactDetailsUpdated*(self: AccessInterface, contactId: string) {.base.} =
raise newException(ValueError, "No implementation available")
method onChatEdited*(self: AccessInterface, chatDto: ChatDto) {.base.} =
raise newException(ValueError, "No implementation available")
method onChatRenamed*(self: AccessInterface, newName: string) {.base.} =
raise newException(ValueError, "No implementation available")
method inputAreaDidLoad*(self: AccessInterface) {.base.} =
raise newException(ValueError, "No implementation available")
method messagesDidLoad*(self: AccessInterface) {.base.} =
raise newException(ValueError, "No implementation available")
method usersDidLoad*(self: AccessInterface) {.base.} =
raise newException(ValueError, "No implementation available")
method viewDidLoad*(self: AccessInterface) {.base.} =
raise newException(ValueError, "No implementation available")
method getInputAreaModule*(self: AccessInterface): QVariant {.base.} =
raise newException(ValueError, "No implementation available")
method getMessagesModule*(self: AccessInterface): QVariant {.base.} =
raise newException(ValueError, "No implementation available")
method getUsersModule*(self: AccessInterface): QVariant {.base.} =
raise newException(ValueError, "No implementation available")
method unpinMessage*(self: AccessInterface, messageId: string) {.base.} =
raise newException(ValueError, "No implementation available")
method getMyChatId*(self: AccessInterface): string {.base.} =
raise newException(ValueError, "No implementation available")
method isMyContact*(self: AccessInterface, contactId: string): bool {.base.} =
raise newException(ValueError, "No implementation available")
method muteChat*(self: AccessInterface) {.base.} =
raise newException(ValueError, "No implementation available")
method unmuteChat*(self: AccessInterface) {.base.} =
raise newException(ValueError, "No implementation available")
method unblockChat*(self: AccessInterface) {.base.} =
raise newException(ValueError, "No implementation available")
method markAllMessagesRead*(self: AccessInterface) {.base.} =
raise newException(ValueError, "No implementation available")
method clearChatHistory*(self: AccessInterface) {.base.} =
raise newException(ValueError, "No implementation available")
method leaveChat*(self: AccessInterface) {.base.} =
raise newException(ValueError, "No implementation available")
method getCurrentFleet*(self: AccessInterface): string {.base.} =
raise newException(ValueError, "No implementation available")
method amIChatAdmin*(self: AccessInterface): bool {.base.} =
raise newException(ValueError, "No implementation available")

View File

@ -1,5 +1,4 @@
import chronicles
import controller_interface
import io_interface
import ../../../../../../app/global/global_singleton
@ -14,13 +13,11 @@ import ../../../../../global/app_signals
import ../../../../../core/signals/types
import ../../../../../core/eventemitter
export controller_interface
logScope:
topics = "messages-controller"
type
Controller* = ref object of controller_interface.AccessInterface
Controller* = ref object of RootObj
delegate: io_interface.AccessInterface
events: EventEmitter
sectionId: string
@ -51,10 +48,10 @@ proc newController*(delegate: io_interface.AccessInterface, events: EventEmitter
result.messageService = messageService
result.mailserversService = mailserversService
method delete*(self: Controller) =
proc delete*(self: Controller) =
discard
method init*(self: Controller) =
proc init*(self: Controller) =
self.events.on(SIGNAL_MESSAGES_LOADED) do(e:Args):
let args = MessagesLoadedArgs(e)
if(self.chatId != args.chatId):
@ -167,97 +164,97 @@ method init*(self: Controller) =
return
self.delegate.onChatMemberUpdated(args.id, args.admin, args.joined)
method getMySectionId*(self: Controller): string =
proc getMySectionId*(self: Controller): string =
return self.sectionId
method getMyChatId*(self: Controller): string =
proc getMyChatId*(self: Controller): string =
return self.chatId
method getChatDetails*(self: Controller): ChatDto =
proc getChatDetails*(self: Controller): ChatDto =
return self.chatService.getChatById(self.chatId)
method getCommunityDetails*(self: Controller): CommunityDto =
proc getCommunityDetails*(self: Controller): CommunityDto =
return self.communityService.getCommunityById(self.sectionId)
method getOneToOneChatNameAndImage*(self: Controller): tuple[name: string, image: string, isIdenticon: bool] =
proc getOneToOneChatNameAndImage*(self: Controller): tuple[name: string, image: string, isIdenticon: bool] =
return self.chatService.getOneToOneChatNameAndImage(self.chatId)
method belongsToCommunity*(self: Controller): bool =
proc belongsToCommunity*(self: Controller): bool =
return self.belongsToCommunity
method loadMoreMessages*(self: Controller) =
proc loadMoreMessages*(self: Controller) =
let limit = self.loadingMessagesPerPageFactor * MESSAGES_PER_PAGE
self.messageService.asyncLoadMoreMessagesForChat(self.chatId, limit)
method addReaction*(self: Controller, messageId: string, emojiId: int) =
proc addReaction*(self: Controller, messageId: string, emojiId: int) =
self.messageService.addReaction(self.chatId, messageId, emojiId)
method removeReaction*(self: Controller, messageId: string, emojiId: int, reactionId: string) =
proc removeReaction*(self: Controller, messageId: string, emojiId: int, reactionId: string) =
self.messageService.removeReaction(reactionId, self.chatId, messageId, emojiId)
method pinUnpinMessage*(self: Controller, messageId: string, pin: bool) =
proc pinUnpinMessage*(self: Controller, messageId: string, pin: bool) =
self.messageService.pinUnpinMessage(self.chatId, messageId, pin)
method getContactById*(self: Controller, contactId: string): ContactsDto =
proc getContactById*(self: Controller, contactId: string): ContactsDto =
return self.contactService.getContactById(contactId)
method getContactDetails*(self: Controller, contactId: string): ContactDetails =
proc getContactDetails*(self: Controller, contactId: string): ContactDetails =
return self.contactService.getContactDetails(contactId)
method getNumOfPinnedMessages*(self: Controller): int =
proc getNumOfPinnedMessages*(self: Controller): int =
return self.messageService.getNumOfPinnedMessages(self.chatId)
method getRenderedText*(self: Controller, parsedTextArray: seq[ParsedText]): string =
proc getRenderedText*(self: Controller, parsedTextArray: seq[ParsedText]): string =
return self.messageService.getRenderedText(parsedTextArray)
method getMessageDetails*(self: Controller, messageId: string):
proc getMessageDetails*(self: Controller, messageId: string):
tuple[message: MessageDto, reactions: seq[ReactionDto], error: string] =
return self.messageService.getDetailsForMessage(self.chatId, messageId)
method deleteMessage*(self: Controller, messageId: string) =
proc deleteMessage*(self: Controller, messageId: string) =
self.messageService.deleteMessage(messageId)
method decodeContentHash*(self: Controller, hash: string): string =
proc decodeContentHash*(self: Controller, hash: string): string =
return eth_utils.decodeContentHash(hash)
method editMessage*(self: Controller, messageId: string, updatedMsg: string) =
proc editMessage*(self: Controller, messageId: string, updatedMsg: string) =
self.messageService.editMessage(messageId, updatedMsg)
method getLinkPreviewData*(self: Controller, link: string, uuid: string): string =
proc getLinkPreviewData*(self: Controller, link: string, uuid: string): string =
self.messageService.asyncGetLinkPreviewData(link, uuid)
method getSearchedMessageId*(self: Controller): string =
proc getSearchedMessageId*(self: Controller): string =
return self.searchedMessageId
method setSearchedMessageId*(self: Controller, searchedMessageId: string) =
proc setSearchedMessageId*(self: Controller, searchedMessageId: string) =
self.searchedMessageId = searchedMessageId
method clearSearchedMessageId*(self: Controller) =
proc clearSearchedMessageId*(self: Controller) =
self.setSearchedMessageId("")
method getLoadingMessagesPerPageFactor*(self: Controller): int =
proc getLoadingMessagesPerPageFactor*(self: Controller): int =
return self.loadingMessagesPerPageFactor
method increaseLoadingMessagesPerPageFactor*(self: Controller) =
proc increaseLoadingMessagesPerPageFactor*(self: Controller) =
self.loadingMessagesPerPageFactor = self.loadingMessagesPerPageFactor + 1
method resetLoadingMessagesPerPageFactor*(self: Controller) =
proc resetLoadingMessagesPerPageFactor*(self: Controller) =
self.loadingMessagesPerPageFactor = 1
method requestMoreMessages*(self: Controller) =
proc requestMoreMessages*(self: Controller) =
self.mailserversService.requestMoreMessages(self.chatId)
method fillGaps*(self: Controller, messageId: string) =
proc fillGaps*(self: Controller, messageId: string) =
self.mailserversService.fillGaps(self.chatId, messageId)
method getTransactionDetails*(self: Controller, message: MessageDto): (string,string) =
proc getTransactionDetails*(self: Controller, message: MessageDto): (string,string) =
return self.messageService.getTransactionDetails(message)
method getWalletAccounts*(self: Controller): seq[wallet_account_service.WalletAccountDto] =
proc getWalletAccounts*(self: Controller): seq[wallet_account_service.WalletAccountDto] =
return self.messageService.getWalletAccounts()
method joinGroupChat*(self: Controller, communityID: string, chatID: string) =
self.chatService.confirmJoiningGroup(communityID, self.chatId)
proc joinGroupChat*(self: Controller) =
self.chatService.confirmJoiningGroup("", self.chatId)
method leaveChat*(self: Controller) =
proc leaveChat*(self: Controller) =
self.chatService.leaveChat(self.chatId)

View File

@ -1,113 +0,0 @@
import ../../../../../../app_service/service/contacts/dto/[contacts, contact_details]
import ../../../../../../app_service/service/community/dto/[community]
import ../../../../../../app_service/service/chat/dto/[chat]
import ../../../../../../app_service/service/message/dto/[message, reaction]
import ../../../../../../app_service/service/wallet_account/[dto]
type
AccessInterface* {.pure inheritable.} = ref object of RootObj
## Abstract class for any input/interaction with this module.
method delete*(self: AccessInterface) {.base.} =
raise newException(ValueError, "No implementation available")
method init*(self: AccessInterface) {.base.} =
raise newException(ValueError, "No implementation available")
method getMySectionId*(self: AccessInterface): string {.base.} =
raise newException(ValueError, "No implementation available")
method getMyChatId*(self: AccessInterface): string {.base.} =
raise newException(ValueError, "No implementation available")
method getChatDetails*(self: AccessInterface): ChatDto {.base.} =
raise newException(ValueError, "No implementation available")
method getCommunityDetails*(self: AccessInterface): CommunityDto {.base.} =
raise newException(ValueError, "No implementation available")
method getOneToOneChatNameAndImage*(self: AccessInterface): tuple[name: string, image: string, isIdenticon: bool]
{.base.} =
raise newException(ValueError, "No implementation available")
method belongsToCommunity*(self: AccessInterface): bool {.base.} =
raise newException(ValueError, "No implementation available")
method loadMoreMessages*(self: AccessInterface) {.base.} =
raise newException(ValueError, "No implementation available")
method addReaction*(self: AccessInterface, messageId: string, emojiId: int) {.base.} =
raise newException(ValueError, "No implementation available")
method removeReaction*(self: AccessInterface, messageId: string, emojiId: int, reactionId: string) {.base.} =
raise newException(ValueError, "No implementation available")
method pinUnpinMessage*(self: AccessInterface, messageId: string, pin: bool) {.base.} =
raise newException(ValueError, "No implementation available")
method getContactById*(self: AccessInterface, contactId: string): ContactsDto {.base.} =
raise newException(ValueError, "No implementation available")
method getContactDetails*(self: AccessInterface, contactId: string): ContactDetails {.base.} =
raise newException(ValueError, "No implementation available")
method getNumOfPinnedMessages*(self: AccessInterface): int {.base.} =
raise newException(ValueError, "No implementation available")
method getRenderedText*(self: AccessInterface, parsedTextArray: seq[ParsedText]): string {.base.} =
raise newException(ValueError, "No implementation available")
method getMessageDetails*(self: AccessInterface, messageId: string):
tuple[message: MessageDto, reactions: seq[ReactionDto], error: string] {.base.} =
raise newException(ValueError, "No implementation available")
method deleteMessage*(self: AccessInterface, messageId: string) {.base.} =
raise newException(ValueError, "No implementation available")
method decodeContentHash*(self: AccessInterface, hash: string): string {.base.} =
raise newException(ValueError, "No implementation available")
method editMessage*(self: AccessInterface, messageId: string, updatedMsg: string) {.base.} =
raise newException(ValueError, "No implementation available")
method getLinkPreviewData*(self: AccessInterface, link: string, uuid: string): string {.base.} =
raise newException(ValueError, "No implementation available")
method getSearchedMessageId*(self: AccessInterface): string {.base.} =
raise newException(ValueError, "No implementation available")
method setSearchedMessageId*(self: AccessInterface, searchedMessageId: string) {.base.} =
raise newException(ValueError, "No implementation available")
method clearSearchedMessageId*(self: AccessInterface) {.base.} =
raise newException(ValueError, "No implementation available")
method getLoadingMessagesPerPageFactor*(self: AccessInterface): int {.base.} =
raise newException(ValueError, "No implementation available")
method increaseLoadingMessagesPerPageFactor*(self: AccessInterface) {.base.} =
raise newException(ValueError, "No implementation available")
method resetLoadingMessagesPerPageFactor*(self: AccessInterface) {.base.} =
raise newException(ValueError, "No implementation available")
method requestMoreMessages*(self: AccessInterface) {.base.} =
raise newException(ValueError, "No implementation available")
method fillGaps*(self: AccessInterface, messageId: string) {.base.} =
raise newException(ValueError, "No implementation available")
method getTransactionDetails*(self: AccessInterface, message: MessageDto): (string,string) {.base.} =
raise newException(ValueError, "No implementation available")
method getWalletAccounts*(self: AccessInterface): seq[WalletAccountDto] =
raise newException(ValueError, "No implementation available")
method joinGroupChat*(self: AccessInterface) {.base.} =
raise newException(ValueError, "No implementation available")
method leaveChat*(self: AccessInterface) {.base.} =
raise newException(ValueError, "No implementation available")
method setLoadingHistoryMessagesInProgress*(self: AccessInterface, isLoading: bool) {.base.} =
raise newException(ValueError, "No implementation available")

View File

@ -1,12 +1,125 @@
# Defines how parent module accesses this module
include ./private_interfaces/module_base_interface
include ./private_interfaces/module_access_interface
import NimQml
# Defines how this module view communicates with this module
include ./private_interfaces/module_view_delegate_interface
import ../../../../../../app_service/service/message/dto/[message, reaction, pinned_message]
# Defines how this controller communicates with this module
include ./private_interfaces/module_controller_delegate_interface
type
AccessInterface* {.pure inheritable.} = ref object of RootObj
# Defines how submodules of this module communicate with this module
# will be added if needed
method delete*(self: AccessInterface) {.base.} =
raise newException(ValueError, "No implementation available")
method load*(self: AccessInterface) {.base.} =
raise newException(ValueError, "No implementation available")
method isLoaded*(self: AccessInterface): bool {.base.} =
raise newException(ValueError, "No implementation available")
method getModuleAsVariant*(self: AccessInterface): QVariant {.base.} =
raise newException(ValueError, "No implementation available")
method updateChatIdentifier*(self: AccessInterface) {.base.} =
raise newException(ValueError, "No implementation available")
method newMessagesLoaded*(self: AccessInterface, messages: seq[MessageDto], reactions: seq[ReactionDto],
pinnedMessages: seq[PinnedMessageDto]) {.base.} =
raise newException(ValueError, "No implementation available")
method onReactionAdded*(self: AccessInterface, messageId: string, emojiId: int, reactionId: string) {.base.} =
raise newException(ValueError, "No implementation available")
method onReactionRemoved*(self: AccessInterface, messageId: string, emojiId: int, reactionId: string) {.base.} =
raise newException(ValueError, "No implementation available")
method toggleReactionFromOthers*(self: AccessInterface, messageId: string, emojiId: int, reactionId: string,
reactionFrom: string) {.base.} =
raise newException(ValueError, "No implementation available")
method onPinMessage*(self: AccessInterface, messageId: string, actionInitiatedBy: string) {.base.} =
raise newException(ValueError, "No implementation available")
method onUnpinMessage*(self: AccessInterface, messageId: string) {.base.} =
raise newException(ValueError, "No implementation available")
method messageAdded*(self: AccessInterface, message: MessageDto) {.base.} =
raise newException(ValueError, "No implementation available")
method onSendingMessageSuccess*(self: AccessInterface, message: MessageDto) {.base.} =
raise newException(ValueError, "No implementation available")
method onSendingMessageError*(self: AccessInterface) {.base.} =
raise newException(ValueError, "No implementation available")
method updateContactDetails*(self: AccessInterface, contactId: string) {.base.} =
raise newException(ValueError, "No implementation available")
method onMessageEdited*(self: AccessInterface, message: MessageDto) {.base.} =
raise newException(ValueError, "No implementation available")
method scrollToMessage*(self: AccessInterface, messageId: string) {.base.} =
raise newException(ValueError, "No implementation available")
method onChatMemberUpdated*(self: AccessInterface, id: string, admin: bool, joined: bool) {.base.} =
raise newException(ValueError, "No implementation available")
method viewDidLoad*(self: AccessInterface) {.base.} =
raise newException(ValueError, "No implementation available")
method loadMoreMessages*(self: AccessInterface) {.base.} =
raise newException(ValueError, "No implementation available")
method toggleReaction*(self: AccessInterface, messageId: string, emojiId: int) {.base.} =
raise newException(ValueError, "No implementation available")
method pinUnpinMessage*(self: AccessInterface, messageId: string, pin: bool) {.base.} =
raise newException(ValueError, "No implementation available")
method getSectionId*(self: AccessInterface): string {.base.} =
raise newException(ValueError, "No implementation available")
method getChatId*(self: AccessInterface): string {.base.} =
raise newException(ValueError, "No implementation available")
method getChatType*(self: AccessInterface): int {.base.} =
raise newException(ValueError, "No implementation available")
method getChatColor*(self: AccessInterface): string {.base.} =
raise newException(ValueError, "No implementation available")
method amIChatAdmin*(self: AccessInterface): bool {.base.} =
raise newException(ValueError, "No implementation available")
method getNumberOfPinnedMessages*(self: AccessInterface): int {.base.} =
raise newException(ValueError, "No implementation available")
method deleteMessage*(self: AccessInterface, messageId: string) {.base.} =
raise newException(ValueError, "No implementation available")
method onMessageDeleted*(self: AccessInterface, messageId: string) {.base.} =
raise newException(ValueError, "No implementation available")
method editMessage*(self: AccessInterface, messageId: string, updatedMsg: string) {.base.} =
raise newException(ValueError, "No implementation available")
method onHistoryCleared*(self: AccessInterface) {.base.} =
raise newException(ValueError, "No implementation available")
method getLinkPreviewData*(self: AccessInterface, link: string, uuid: string): string {.base.} =
raise newException(ValueError, "No implementation available")
method onPreviewDataLoaded*(self: AccessInterface, previewData: string) {.base.} =
raise newException(ValueError, "No implementation available")
method requestMoreMessages*(self: AccessInterface) {.base.} =
raise newException(ValueError, "No implementation available")
method fillGaps*(self: AccessInterface, messageId: string) {.base.} =
raise newException(ValueError, "No implementation available")
method joinGroupChat*(self: AccessInterface) {.base.} =
raise newException(ValueError, "No implementation available")
method leaveChat*(self: AccessInterface) {.base.} =
raise newException(ValueError, "No implementation available")
method didIJoinedChat*(self: AccessInterface): bool {.base.} =
raise newException(ValueError, "No implementation available")

View File

@ -27,7 +27,7 @@ type
delegate: delegate_interface.AccessInterface
view: View
viewVariant: QVariant
controller: controller.AccessInterface
controller: Controller
moduleLoaded: bool
proc newModule*(delegate: delegate_interface.AccessInterface, events: EventEmitter, sectionId: string, chatId: string,

View File

@ -1,16 +0,0 @@
import NimQml
method delete*(self: AccessInterface) {.base.} =
raise newException(ValueError, "No implementation available")
method load*(self: AccessInterface) {.base.} =
raise newException(ValueError, "No implementation available")
method isLoaded*(self: AccessInterface): bool {.base.} =
raise newException(ValueError, "No implementation available")
method getModuleAsVariant*(self: AccessInterface): QVariant {.base.} =
raise newException(ValueError, "No implementation available")
method updateChatIdentifier*(self: AccessInterface) {.base.} =
raise newException(ValueError, "No implementation available")

View File

@ -1,5 +0,0 @@
type
AccessInterface* {.pure inheritable.} = ref object of RootObj
# Since nim doesn't support using concepts in second level nested types we
# define delegate interfaces within access interface.

View File

@ -1,42 +0,0 @@
import ../../../../../../../app_service/service/message/dto/[message, reaction, pinned_message]
method newMessagesLoaded*(self: AccessInterface, messages: seq[MessageDto], reactions: seq[ReactionDto],
pinnedMessages: seq[PinnedMessageDto]) {.base.} =
raise newException(ValueError, "No implementation available")
method onReactionAdded*(self: AccessInterface, messageId: string, emojiId: int, reactionId: string) {.base.} =
raise newException(ValueError, "No implementation available")
method onReactionRemoved*(self: AccessInterface, messageId: string, emojiId: int, reactionId: string) {.base.} =
raise newException(ValueError, "No implementation available")
method toggleReactionFromOthers*(self: AccessInterface, messageId: string, emojiId: int, reactionId: string,
reactionFrom: string) {.base.} =
raise newException(ValueError, "No implementation available")
method onPinMessage*(self: AccessInterface, messageId: string, actionInitiatedBy: string) {.base.} =
raise newException(ValueError, "No implementation available")
method onUnpinMessage*(self: AccessInterface, messageId: string) {.base.} =
raise newException(ValueError, "No implementation available")
method messageAdded*(self: AccessInterface, message: MessageDto) {.base.} =
raise newException(ValueError, "No implementation available")
method onSendingMessageSuccess*(self: AccessInterface, message: MessageDto) {.base.} =
raise newException(ValueError, "No implementation available")
method onSendingMessageError*(self: AccessInterface) {.base.} =
raise newException(ValueError, "No implementation available")
method updateContactDetails*(self: AccessInterface, contactId: string) {.base.} =
raise newException(ValueError, "No implementation available")
method onMessageEdited*(self: AccessInterface, message: MessageDto) {.base.} =
raise newException(ValueError, "No implementation available")
method scrollToMessage*(self: AccessInterface, messageId: string) {.base.} =
raise newException(ValueError, "No implementation available")
method onChatMemberUpdated*(self: AccessInterface, id: string, admin: bool, joined: bool) {.base.} =
raise newException(ValueError, "No implementation available")

View File

@ -1,62 +0,0 @@
method viewDidLoad*(self: AccessInterface) {.base.} =
raise newException(ValueError, "No implementation available")
method loadMoreMessages*(self: AccessInterface) {.base.} =
raise newException(ValueError, "No implementation available")
method toggleReaction*(self: AccessInterface, messageId: string, emojiId: int) {.base.} =
raise newException(ValueError, "No implementation available")
method pinUnpinMessage*(self: AccessInterface, messageId: string, pin: bool) {.base.} =
raise newException(ValueError, "No implementation available")
method getSectionId*(self: AccessInterface): string {.base.} =
raise newException(ValueError, "No implementation available")
method getChatId*(self: AccessInterface): string {.base.} =
raise newException(ValueError, "No implementation available")
method getChatType*(self: AccessInterface): int {.base.} =
raise newException(ValueError, "No implementation available")
method getChatColor*(self: AccessInterface): string {.base.} =
raise newException(ValueError, "No implementation available")
method amIChatAdmin*(self: AccessInterface): bool {.base.} =
raise newException(ValueError, "No implementation available")
method getNumberOfPinnedMessages*(self: AccessInterface): int {.base.} =
raise newException(ValueError, "No implementation available")
method deleteMessage*(self: AccessInterface, messageId: string) {.base.} =
raise newException(ValueError, "No implementation available")
method onMessageDeleted*(self: AccessInterface, messageId: string) {.base.} =
raise newException(ValueError, "No implementation available")
method editMessage*(self: AccessInterface, messageId: string, updatedMsg: string) {.base.} =
raise newException(ValueError, "No implementation available")
method onHistoryCleared*(self: AccessInterface) {.base.} =
raise newException(ValueError, "No implementation available")
method getLinkPreviewData*(self: AccessInterface, link: string, uuid: string): string {.base.} =
raise newException(ValueError, "No implementation available")
method onPreviewDataLoaded*(self: AccessInterface, previewData: string) {.base.} =
raise newException(ValueError, "No implementation available")
method requestMoreMessages*(self: AccessInterface) {.base.} =
raise newException(ValueError, "No implementation available")
method fillGaps*(self: AccessInterface, messageId: string) {.base.} =
raise newException(ValueError, "No implementation available")
method joinGroupChat*(self: AccessInterface) {.base.} =
raise newException(ValueError, "No implementation available")
method leaveChat*(self: AccessInterface) {.base.} =
raise newException(ValueError, "No implementation available")
method didIJoinedChat*(self: AccessInterface): bool {.base.} =
raise newException(ValueError, "No implementation available")

View File

@ -31,7 +31,7 @@ type
delegate: delegate_interface.AccessInterface
view: View
viewVariant: QVariant
controller: controller.AccessInterface
controller: Controller
inputAreaModule: input_area_module.AccessInterface
messagesModule: messages_module.AccessInterface
usersModule: users_module.AccessInterface

View File

@ -1,16 +0,0 @@
import NimQml
method delete*(self: AccessInterface) {.base.} =
raise newException(ValueError, "No implementation available")
method load*(self: AccessInterface) {.base.} =
raise newException(ValueError, "No implementation available")
method isLoaded*(self: AccessInterface): bool {.base.} =
raise newException(ValueError, "No implementation available")
method getModuleAsVariant*(self: AccessInterface): QVariant {.base.} =
raise newException(ValueError, "No implementation available")
method onNotificationsUpdated*(self: AccessInterface, hasUnreadMessages: bool, notificationCount: int) {.base.} =
raise newException(ValueError, "No implementation available")

View File

@ -1,5 +0,0 @@
type
AccessInterface* {.pure inheritable.} = ref object of RootObj
# Since nim doesn't support using concepts in second level nested types we
# define delegate interfaces within access interface.

View File

@ -1,36 +0,0 @@
import ../../../../../../app_service/service/message/dto/pinned_message
import ../../../../../../app_service/service/chat/dto/chat
method newPinnedMessagesLoaded*(self: AccessInterface, pinnedMessages: seq[PinnedMessageDto]) {.base.} =
raise newException(ValueError, "No implementation available")
method onUnpinMessage*(self: AccessInterface, messageId: string) {.base.} =
raise newException(ValueError, "No implementation available")
method onPinMessage*(self: AccessInterface, mmessageId: string, actionInitiatedBy: string) {.base.} =
raise newException(ValueError, "No implementation available")
method onChatMuted*(self: AccessInterface) {.base.} =
raise newException(ValueError, "No implementation available")
method onChatUnmuted*(self: AccessInterface) {.base.} =
raise newException(ValueError, "No implementation available")
method onReactionAdded*(self: AccessInterface, messageId: string, emojiId: int, reactionId: string) {.base.} =
raise newException(ValueError, "No implementation available")
method onReactionRemoved*(self: AccessInterface, messageId: string, emojiId: int, reactionId: string) {.base.} =
raise newException(ValueError, "No implementation available")
method toggleReactionFromOthers*(self: AccessInterface, messageId: string, emojiId: int, reactionId: string,
reactionFrom: string) {.base.} =
raise newException(ValueError, "No implementation available")
method onContactDetailsUpdated*(self: AccessInterface, contactId: string) {.base.} =
raise newException(ValueError, "No implementation available")
method onChatEdited*(self: AccessInterface, chatDto: ChatDto) {.base.} =
raise newException(ValueError, "No implementation available")
method onChatRenamed*(self: AccessInterface, newName: string) {.base.} =
raise newException(ValueError, "No implementation available")

View File

@ -1,2 +0,0 @@
method inputAreaDidLoad*(self: AccessInterface) {.base.} =
raise newException(ValueError, "No implementation available")

View File

@ -1,2 +0,0 @@
method messagesDidLoad*(self: AccessInterface) {.base.} =
raise newException(ValueError, "No implementation available")

View File

@ -1,2 +0,0 @@
method usersDidLoad*(self: AccessInterface) {.base.} =
raise newException(ValueError, "No implementation available")

View File

@ -1,46 +0,0 @@
import NimQml
method viewDidLoad*(self: AccessInterface) {.base.} =
raise newException(ValueError, "No implementation available")
method getInputAreaModule*(self: AccessInterface): QVariant {.base.} =
raise newException(ValueError, "No implementation available")
method getMessagesModule*(self: AccessInterface): QVariant {.base.} =
raise newException(ValueError, "No implementation available")
method getUsersModule*(self: AccessInterface): QVariant {.base.} =
raise newException(ValueError, "No implementation available")
method unpinMessage*(self: AccessInterface, messageId: string) {.base.} =
raise newException(ValueError, "No implementation available")
method getMyChatId*(self: AccessInterface): string {.base.} =
raise newException(ValueError, "No implementation available")
method isMyContact*(self: AccessInterface, contactId: string): bool {.base.} =
raise newException(ValueError, "No implementation available")
method muteChat*(self: AccessInterface) {.base.} =
raise newException(ValueError, "No implementation available")
method unmuteChat*(self: AccessInterface) {.base.} =
raise newException(ValueError, "No implementation available")
method unblockChat*(self: AccessInterface) {.base.} =
raise newException(ValueError, "No implementation available")
method markAllMessagesRead*(self: AccessInterface) {.base.} =
raise newException(ValueError, "No implementation available")
method clearChatHistory*(self: AccessInterface) {.base.} =
raise newException(ValueError, "No implementation available")
method leaveChat*(self: AccessInterface) {.base.} =
raise newException(ValueError, "No implementation available")
method getCurrentFleet*(self: AccessInterface): string {.base.} =
raise newException(ValueError, "No implementation available")
method amIChatAdmin*(self: AccessInterface): bool {.base.} =
raise newException(ValueError, "No implementation available")

View File

@ -1,5 +1,4 @@
import sequtils, sugar
import controller_interface
import io_interface
import ../../../../../../app_service/service/contacts/service as contact_service
@ -9,10 +8,8 @@ import ../../../../../../app_service/service/chat/service as chat_service
import ../../../../../core/eventemitter
export controller_interface
type
Controller* = ref object of controller_interface.AccessInterface
Controller* = ref object of RootObj
delegate: io_interface.AccessInterface
events: EventEmitter
sectionId: string
@ -43,10 +40,10 @@ proc newController*(
result.messageService = messageService
result.chatService = chatService
method delete*(self: Controller) =
proc delete*(self: Controller) =
discard
method handleCommunityOnlyConnections(self: Controller) =
proc handleCommunityOnlyConnections(self: Controller) =
self.events.on(SIGNAL_COMMUNITY_MEMBER_APPROVED) do(e: Args):
let args = CommunityMemberArgs(e)
if (args.communityId == self.sectionId):
@ -60,7 +57,7 @@ method handleCommunityOnlyConnections(self: Controller) =
let membersPubKeys = community.members.map(x => x.id)
self.delegate.onChatMembersAdded(membersPubKeys)
method init*(self: Controller) =
proc init*(self: Controller) =
if(self.isUsersListAvailable):
self.events.on(SIGNAL_MESSAGES_LOADED) do(e:Args):
let args = MessagesLoadedArgs(e)
@ -124,10 +121,10 @@ method init*(self: Controller) =
if (args.communityId == self.sectionId):
self.delegate.onChatMemberRemoved(args.pubKey)
method getChat*(self: Controller): ChatDto =
proc getChat*(self: Controller): ChatDto =
return self.chatService.getChatById(self.chatId)
method getChatMemberInfo*(self: Controller, id: string): (bool, bool) =
proc getChatMemberInfo*(self: Controller, id: string): (bool, bool) =
let chat = self.getChat()
for member in chat.members:
if (member.id == id):
@ -135,7 +132,7 @@ method getChatMemberInfo*(self: Controller, id: string): (bool, bool) =
return (false, false)
method getMembersPublicKeys*(self: Controller): seq[string] =
proc getMembersPublicKeys*(self: Controller): seq[string] =
if(self.belongsToCommunity):
let communityDto = self.communityService.getCommunityById(self.sectionId)
return communityDto.members.map(x => x.id)
@ -143,12 +140,12 @@ method getMembersPublicKeys*(self: Controller): seq[string] =
let chatDto = self.getChat()
return chatDto.members.map(x => x.id)
method getContactNameAndImage*(self: Controller, contactId: string):
proc getContactNameAndImage*(self: Controller, contactId: string):
tuple[name: string, image: string, isIdenticon: bool] =
return self.contactService.getContactNameAndImage(contactId)
method getContactDetails*(self: Controller, contactId: string): ContactDetails =
proc getContactDetails*(self: Controller, contactId: string): ContactDetails =
return self.contactService.getContactDetails(contactId)
method getStatusForContact*(self: Controller, contactId: string): StatusUpdateDto =
proc getStatusForContact*(self: Controller, contactId: string): StatusUpdateDto =
return self.contactService.getStatusForContactWithId(contactId)

View File

@ -1,34 +0,0 @@
import ../../../../../../app_service/service/contacts/service as contacts_service
import ../../../../../../app_service/service/chat/service as chat_service
type
AccessInterface* {.pure inheritable.} = ref object of RootObj
## Abstract class for any input/interaction with this module.
method delete*(self: AccessInterface) {.base.} =
raise newException(ValueError, "No implementation available")
method init*(self: AccessInterface) {.base.} =
raise newException(ValueError, "No implementation available")
method getChatId*(self: AccessInterface): string {.base.} =
raise newException(ValueError, "No implementation available")
method getMembersPublicKeys*(self: AccessInterface): seq[string] {.base.} =
raise newException(ValueError, "No implementation available")
method getContactNameAndImage*(self: AccessInterface, contactId: string):
tuple[name: string, image: string, isIdenticon: bool] {.base.} =
raise newException(ValueError, "No implementation available")
method getContactDetails*(self: AccessInterface, contactId: string): ContactDetails {.base.} =
raise newException(ValueError, "No implementation available")
method getStatusForContact*(self: AccessInterface, contactId: string): StatusUpdateDto {.base.} =
raise newException(ValueError, "No implementation available")
method getChat*(self: AccessInterface): ChatDto {.base.} =
raise newException(ValueError, "No implementation available")
method getChatMemberInfo*(self: AccessInterface, id: string): (bool, bool) =
raise newException(ValueError, "No implementation available")

View File

@ -1,12 +1,49 @@
# Defines how parent module accesses this module
include ./private_interfaces/module_base_interface
include ./private_interfaces/module_access_interface
import NimQml
# Defines how this module view communicates with this module
include ./private_interfaces/module_view_delegate_interface
import ../../../../../../app_service/service/message/dto/[message]
import ../../../../../../app_service/service/contacts/dto/[status_update]
# Defines how this controller communicates with this module
include ./private_interfaces/module_controller_delegate_interface
type
AccessInterface* {.pure inheritable.} = ref object of RootObj
# Defines how submodules of this module communicate with this module
# will be added if needed
method delete*(self: AccessInterface) {.base.} =
raise newException(ValueError, "No implementation available")
method load*(self: AccessInterface) {.base.} =
raise newException(ValueError, "No implementation available")
method isLoaded*(self: AccessInterface): bool {.base.} =
raise newException(ValueError, "No implementation available")
method getModuleAsVariant*(self: AccessInterface): QVariant {.base.} =
raise newException(ValueError, "No implementation available")
method newMessagesLoaded*(self: AccessInterface, messages: seq[MessageDto]) {.base.} =
raise newException(ValueError, "No implementation available")
method contactNicknameChanged*(self: AccessInterface, publicKey: string) {.base.} =
raise newException(ValueError, "No implementation available")
method contactsStatusUpdated*(self: AccessInterface, statusUpdates: seq[StatusUpdateDto]) {.base.} =
raise newException(ValueError, "No implementation available")
method contactUpdated*(self: AccessInterface, publicKey: string) {.base.} =
raise newException(ValueError, "No implementation available")
method loggedInUserImageChanged*(self: AccessInterface) {.base.} =
raise newException(ValueError, "No implementation available")
method onChatMembersAdded*(self: AccessInterface, ids: seq[string]) {.base.} =
raise newException(ValueError, "No implementation available")
method onChatMemberRemoved*(self: AccessInterface, ids: string) {.base.} =
raise newException(ValueError, "No implementation available")
method onChatMemberUpdated*(self: AccessInterface, id: string, admin: bool, joined: bool) {.base.} =
raise newException(ValueError, "No implementation available")
method viewDidLoad*(self: AccessInterface) {.base.} =
raise newException(ValueError, "No implementation available")
method getMembersPublicKeys*(self: AccessInterface): string {.base.} =
raise newException(ValueError, "No implementation available")

View File

@ -17,7 +17,7 @@ type
delegate: delegate_interface.AccessInterface
view: View
viewVariant: QVariant
controller: controller.AccessInterface
controller: Controller
moduleLoaded: bool
proc newModule*(

View File

@ -1,13 +0,0 @@
import NimQml
method delete*(self: AccessInterface) {.base.} =
raise newException(ValueError, "No implementation available")
method load*(self: AccessInterface) {.base.} =
raise newException(ValueError, "No implementation available")
method isLoaded*(self: AccessInterface): bool {.base.} =
raise newException(ValueError, "No implementation available")
method getModuleAsVariant*(self: AccessInterface): QVariant {.base.} =
raise newException(ValueError, "No implementation available")

View File

@ -1,5 +0,0 @@
type
AccessInterface* {.pure inheritable.} = ref object of RootObj
# Since nim doesn't support using concepts in second level nested types we
# define delegate interfaces within access interface.

View File

@ -1,26 +0,0 @@
import ../../../../../../../app_service/service/message/dto/[message]
import ../../../../../../../app_service/service/contacts/dto/[status_update]
method newMessagesLoaded*(self: AccessInterface, messages: seq[MessageDto]) {.base.} =
raise newException(ValueError, "No implementation available")
method contactNicknameChanged*(self: AccessInterface, publicKey: string) {.base.} =
raise newException(ValueError, "No implementation available")
method contactsStatusUpdated*(self: AccessInterface, statusUpdates: seq[StatusUpdateDto]) {.base.} =
raise newException(ValueError, "No implementation available")
method contactUpdated*(self: AccessInterface, publicKey: string) {.base.} =
raise newException(ValueError, "No implementation available")
method loggedInUserImageChanged*(self: AccessInterface) {.base.} =
raise newException(ValueError, "No implementation available")
method onChatMembersAdded*(self: AccessInterface, ids: seq[string]) {.base.} =
raise newException(ValueError, "No implementation available")
method onChatMemberRemoved*(self: AccessInterface, ids: string) {.base.} =
raise newException(ValueError, "No implementation available")
method onChatMemberUpdated*(self: AccessInterface, id: string, admin: bool, joined: bool) {.base.} =
raise newException(ValueError, "No implementation available")

View File

@ -1,5 +0,0 @@
method viewDidLoad*(self: AccessInterface) {.base.} =
raise newException(ValueError, "No implementation available")
method getMembersPublicKeys*(self: AccessInterface): string {.base.} =
raise newException(ValueError, "No implementation available")

View File

@ -1,6 +1,5 @@
import Tables
import controller_interface
import io_interface
import ../../../../app_service/service/settings/service as settings_service
@ -15,10 +14,9 @@ import ../../../core/signals/types
import ../../../global/app_signals
import ../../../core/eventemitter
export controller_interface
type
Controller* = ref object of controller_interface.AccessInterface
Controller* = ref object of RootObj
delegate: io_interface.AccessInterface
sectionId: string
isCommunitySection: bool
@ -51,10 +49,10 @@ proc newController*(delegate: io_interface.AccessInterface, sectionId: string, i
result.gifService = gifService
result.mailserversService = mailserversService
method delete*(self: Controller) =
proc delete*(self: Controller) =
discard
method init*(self: Controller) =
proc init*(self: Controller) =
self.events.on(SIGNAL_NEW_MESSAGE_RECEIVED) do(e: Args):
let args = MessagesArgs(e)
if(self.isCommunitySection and args.chatType != ChatType.CommunityChat or
@ -184,38 +182,38 @@ method init*(self: Controller) =
self.events.on(SignalType.HistoryRequestFailed.event) do(e:Args):
discard
method getMySectionId*(self: Controller): string =
proc getMySectionId*(self: Controller): string =
return self.sectionId
method getActiveChatId*(self: Controller): string =
proc getActiveChatId*(self: Controller): string =
if(self.activeSubItemId.len > 0):
return self.activeSubItemId
else:
return self.activeItemId
method isCommunity*(self: Controller): bool =
proc isCommunity*(self: Controller): bool =
return self.isCommunitySection
method getJoinedCommunities*(self: Controller): seq[CommunityDto] =
proc getJoinedCommunities*(self: Controller): seq[CommunityDto] =
return self.communityService.getJoinedCommunities()
method getMyCommunity*(self: Controller): CommunityDto =
proc getMyCommunity*(self: Controller): CommunityDto =
return self.communityService.getCommunityById(self.sectionId)
method getCategories*(self: Controller, communityId: string): seq[Category] =
proc getCategories*(self: Controller, communityId: string): seq[Category] =
return self.communityService.getCategories(communityId)
method getChats*(self: Controller, communityId: string, categoryId: string): seq[Chat] =
proc getChats*(self: Controller, communityId: string, categoryId: string): seq[Chat] =
return self.communityService.getChats(communityId, categoryId)
method getChatDetails*(self: Controller, communityId, chatId: string): ChatDto =
proc getChatDetails*(self: Controller, communityId, chatId: string): ChatDto =
let fullId = communityId & chatId
return self.chatService.getChatById(fullId)
method getChatDetailsForChatTypes*(self: Controller, types: seq[ChatType]): seq[ChatDto] =
proc getChatDetailsForChatTypes*(self: Controller, types: seq[ChatType]): seq[ChatDto] =
return self.chatService.getChatsOfChatTypes(types)
method setActiveItemSubItem*(self: Controller, itemId: string, subItemId: string) =
proc setActiveItemSubItem*(self: Controller, itemId: string, subItemId: string) =
self.activeItemId = itemId
self.activeSubItemId = subItemId
@ -225,95 +223,95 @@ method setActiveItemSubItem*(self: Controller, itemId: string, subItemId: string
self.delegate.activeItemSubItemSet(self.activeItemId, self.activeSubItemId)
method removeCommunityChat*(self: Controller, itemId: string) =
proc removeCommunityChat*(self: Controller, itemId: string) =
self.communityService.deleteCommunityChat(self.getMySectionId(), itemId)
method getOneToOneChatNameAndImage*(self: Controller, chatId: string):
proc getOneToOneChatNameAndImage*(self: Controller, chatId: string):
tuple[name: string, image: string, isIdenticon: bool] =
return self.chatService.getOneToOneChatNameAndImage(chatId)
method createPublicChat*(self: Controller, chatId: string) =
proc createPublicChat*(self: Controller, chatId: string) =
let response = self.chatService.createPublicChat(chatId)
if(response.success):
self.delegate.addNewChat(response.chatDto, false, self.events, self.settingsService, self.contactService, self.chatService,
self.communityService, self.messageService, self.gifService, self.mailserversService)
method createOneToOneChat*(self: Controller, communityID: string, chatId: string, ensName: string) =
proc createOneToOneChat*(self: Controller, communityID: string, chatId: string, ensName: string) =
let response = self.chatService.createOneToOneChat(communityID, chatId, ensName)
if(response.success):
self.delegate.addNewChat(response.chatDto, false, self.events, self.settingsService, self.contactService, self.chatService,
self.communityService, self.messageService, self.gifService, self.mailserversService)
method switchToOrCreateOneToOneChat*(self: Controller, chatId: string, ensName: string) =
proc switchToOrCreateOneToOneChat*(self: Controller, chatId: string, ensName: string) =
self.chatService.switchToOrCreateOneToOneChat(chatId, ensName)
method leaveChat*(self: Controller, chatId: string) =
proc leaveChat*(self: Controller, chatId: string) =
self.chatService.leaveChat(chatId)
method muteChat*(self: Controller, chatId: string) =
proc muteChat*(self: Controller, chatId: string) =
self.chatService.muteChat(chatId)
method unmuteChat*(self: Controller, chatId: string) =
proc unmuteChat*(self: Controller, chatId: string) =
self.chatService.unmuteChat(chatId)
method markAllMessagesRead*(self: Controller, chatId: string) =
proc markAllMessagesRead*(self: Controller, chatId: string) =
self.messageService.markAllMessagesRead(chatId)
method clearChatHistory*(self: Controller, chatId: string) =
proc clearChatHistory*(self: Controller, chatId: string) =
self.chatService.clearChatHistory(chatId)
method getCurrentFleet*(self: Controller): string =
proc getCurrentFleet*(self: Controller): string =
return self.settingsService.getFleetAsString()
method getContacts*(self: Controller): seq[ContactsDto] =
proc getContacts*(self: Controller): seq[ContactsDto] =
return self.contactService.getContacts()
method getContactDetails*(self: Controller, id: string): ContactDetails =
proc getContactDetails*(self: Controller, id: string): ContactDetails =
return self.contactService.getContactDetails(id)
method addContact*(self: Controller, publicKey: string) =
proc addContact*(self: Controller, publicKey: string) =
self.contactService.addContact(publicKey)
method rejectContactRequest*(self: Controller, publicKey: string) =
proc rejectContactRequest*(self: Controller, publicKey: string) =
self.contactService.rejectContactRequest(publicKey)
method blockContact*(self: Controller, publicKey: string) =
proc blockContact*(self: Controller, publicKey: string) =
self.contactService.blockContact(publicKey)
method addGroupMembers*(self: Controller, communityID: string, chatId: string, pubKeys: seq[string]) =
proc addGroupMembers*(self: Controller, communityID: string, chatId: string, pubKeys: seq[string]) =
self.chatService.addGroupMembers(communityID, chatId, pubKeys)
method removeMemberFromGroupChat*(self: Controller, communityID: string, chatId: string, pubKey: string) =
proc removeMemberFromGroupChat*(self: Controller, communityID: string, chatId: string, pubKey: string) =
self.chatService.removeMemberFromGroupChat(communityID, chatId, pubKey)
method renameGroupChat*(self: Controller, communityID: string, chatId: string, newName: string) =
proc renameGroupChat*(self: Controller, communityID: string, chatId: string, newName: string) =
self.chatService.renameGroupChat(communityID, chatId, newName)
method makeAdmin*(self: Controller, communityID: string, chatId: string, pubKey: string) =
proc makeAdmin*(self: Controller, communityID: string, chatId: string, pubKey: string) =
self.chatService.makeAdmin(communityID, chatId, pubKey)
method createGroupChat*(self: Controller, communityID: string, groupName: string, pubKeys: seq[string]) =
proc createGroupChat*(self: Controller, communityID: string, groupName: string, pubKeys: seq[string]) =
let response = self.chatService.createGroupChat(communityID, groupName, pubKeys)
if(response.success):
self.delegate.addNewChat(response.chatDto, false, self.events, self.settingsService, self.contactService, self.chatService,
self.communityService, self.messageService, self.gifService, self.mailserversService)
method confirmJoiningGroup*(self: Controller, communityID: string, chatID: string) =
proc confirmJoiningGroup*(self: Controller, communityID: string, chatID: string) =
self.chatService.confirmJoiningGroup(communityID, self.getActiveChatId())
method joinGroupChatFromInvitation*(self: Controller, groupName: string, chatId: string, adminPK: string) =
proc joinGroupChatFromInvitation*(self: Controller, groupName: string, chatId: string, adminPK: string) =
let response = self.chatService.createGroupChatFromInvitation(groupName, chatId, adminPK)
if(response.success):
self.delegate.addNewChat(response.chatDto, false, self.events, self.settingsService, self.contactService, self.chatService,
self.communityService, self.messageService, self.gifService, self.mailserversService)
method acceptRequestToJoinCommunity*(self: Controller, requestId: string) =
proc acceptRequestToJoinCommunity*(self: Controller, requestId: string) =
self.communityService.acceptRequestToJoinCommunity(self.sectionId, requestId)
method declineRequestToJoinCommunity*(self: Controller, requestId: string) =
proc declineRequestToJoinCommunity*(self: Controller, requestId: string) =
self.communityService.declineRequestToJoinCommunity(self.sectionId, requestId)
method createCommunityChannel*(
proc createCommunityChannel*(
self: Controller,
name: string,
description: string,
@ -323,7 +321,7 @@ method createCommunityChannel*(
self.communityService.createCommunityChannel(self.sectionId, name, description, emoji, color,
categoryId)
method editCommunityChannel*(
proc editCommunityChannel*(
self: Controller,
channelId: string,
name: string,
@ -342,22 +340,22 @@ method editCommunityChannel*(
categoryId,
position)
method createCommunityCategory*(self: Controller, name: string, channels: seq[string]) =
proc createCommunityCategory*(self: Controller, name: string, channels: seq[string]) =
self.communityService.createCommunityCategory(self.sectionId, name, channels)
method editCommunityCategory*(self: Controller, categoryId: string, name: string, channels: seq[string]) =
proc editCommunityCategory*(self: Controller, categoryId: string, name: string, channels: seq[string]) =
self.communityService.editCommunityCategory(self.sectionId, categoryId, name, channels)
method deleteCommunityCategory*(self: Controller, categoryId: string) =
proc deleteCommunityCategory*(self: Controller, categoryId: string) =
self.communityService.deleteCommunityCategory(self.sectionId, categoryId)
method leaveCommunity*(self: Controller) =
proc leaveCommunity*(self: Controller) =
self.communityService.leaveCommunity(self.sectionId)
method removeUserFromCommunity*(self: Controller, pubKey: string) =
proc removeUserFromCommunity*(self: Controller, pubKey: string) =
self.communityService.removeUserFromCommunity(self.sectionId, pubKey)
method editCommunity*(
proc editCommunity*(
self: Controller,
name: string,
description: string,
@ -376,20 +374,20 @@ method editCommunity*(
imageUrl,
aX, aY, bX, bY)
method exportCommunity*(self: Controller): string =
proc exportCommunity*(self: Controller): string =
self.communityService.exportCommunity(self.sectionId)
method setCommunityMuted*(self: Controller, muted: bool) =
proc setCommunityMuted*(self: Controller, muted: bool) =
self.communityService.setCommunityMuted(self.sectionId, muted)
method inviteUsersToCommunity*(self: Controller, pubKeys: string): string =
proc inviteUsersToCommunity*(self: Controller, pubKeys: string): string =
result = self.communityService.inviteUsersToCommunityById(self.sectionId, pubKeys)
method reorderCommunityCategories*(self: Controller, categoryId: string, position: int) =
proc reorderCommunityCategories*(self: Controller, categoryId: string, position: int) =
self.communityService.reorderCommunityCategories(self.sectionId, categoryId, position)
method reorderCommunityChat*(self: Controller, categoryId: string, chatId: string, position: int): string =
proc reorderCommunityChat*(self: Controller, categoryId: string, chatId: string, position: int): string =
self.communityService.reorderCommunityChat(self.sectionId, categoryId, chatId, position)
method getRenderedText*(self: Controller, parsedTextArray: seq[ParsedText]): string =
proc getRenderedText*(self: Controller, parsedTextArray: seq[ParsedText]): string =
return self.messageService.getRenderedText(parsedTextArray)

View File

@ -1,164 +0,0 @@
import ../../../../app_service/service/contacts/dto/[contacts, contact_details]
import ../../../../app_service/service/chat/dto/[chat]
import ../../../../app_service/service/community/dto/[community]
import ../../../../app_service/service/message/dto/[message]
type
AccessInterface* {.pure inheritable.} = ref object of RootObj
## Abstract class for any input/interaction with this module.
method delete*(self: AccessInterface) {.base.} =
raise newException(ValueError, "No implementation available")
method init*(self: AccessInterface) {.base.} =
raise newException(ValueError, "No implementation available")
method getMySectionId*(self: AccessInterface): string {.base.} =
raise newException(ValueError, "No implementation available")
method getActiveChatId*(self: AccessInterface): string {.base.} =
raise newException(ValueError, "No implementation available")
method isCommunity*(self: AccessInterface): bool {.base.} =
raise newException(ValueError, "No implementation available")
method getJoinedCommunities*(self: AccessInterface): seq[CommunityDto] {.base.} =
raise newException(ValueError, "No implementation available")
method getMyCommunity*(self: AccessInterface): CommunityDto {.base.} =
raise newException(ValueError, "No implementation available")
method getCategories*(self: AccessInterface, communityId: string): seq[Category] {.base.} =
raise newException(ValueError, "No implementation available")
method getChats*(self: AccessInterface, communityId: string, categoryId: string): seq[Chat] {.base.} =
raise newException(ValueError, "No implementation available")
method getChatDetails*(self: AccessInterface, communityId, chatId: string): ChatDto {.base.} =
raise newException(ValueError, "No implementation available")
method getChatDetailsForChatTypes*(self: AccessInterface, types: seq[ChatType]): seq[ChatDto] {.base.} =
raise newException(ValueError, "No implementation available")
method setActiveItemSubItem*(self: AccessInterface, itemId: string, subItemId: string) {.base.} =
raise newException(ValueError, "No implementation available")
method removeCommunityChat*(self: AccessInterface, itemId: string) {.base.} =
raise newException(ValueError, "No implementation available")
method getOneToOneChatNameAndImage*(self: AccessInterface, chatId: string):
tuple[name: string, image: string, isIdenticon: bool] {.base.} =
raise newException(ValueError, "No implementation available")
method createPublicChat*(self: AccessInterface, chatId: string) {.base.} =
raise newException(ValueError, "No implementation available")
method createOneToOneChat*(self: AccessInterface, communityID: string, chatId: string, ensName: string) {.base.} =
raise newException(ValueError, "No implementation available")
method switchToOrCreateOneToOneChat*(self: AccessInterface, chatId: string, ensName: string) {.base.} =
raise newException(ValueError, "No implementation available")
method leaveChat*(self: AccessInterface, chatId: string) {.base.} =
raise newException(ValueError, "No implementation available")
method muteChat*(self: AccessInterface, chatId: string) {.base.} =
raise newException(ValueError, "No implementation available")
method unmuteChat*(self: AccessInterface, chatId: string) {.base.} =
raise newException(ValueError, "No implementation available")
method markAllMessagesRead*(self: AccessInterface, chatId: string) {.base.} =
raise newException(ValueError, "No implementation available")
method clearChatHistory*(self: AccessInterface, chatId: string) {.base.} =
raise newException(ValueError, "No implementation available")
method getCurrentFleet*(self: AccessInterface): string {.base.} =
raise newException(ValueError, "No implementation available")
method getContacts*(self: AccessInterface): seq[ContactsDto] {.base.} =
raise newException(ValueError, "No implementation available")
method getContactDetails*(self: AccessInterface, id: string): ContactDetails {.base.} =
raise newException(ValueError, "No implementation available")
method addContact*(self: AccessInterface, publicKey: string): void {.base.} =
raise newException(ValueError, "No implementation available")
method rejectContactRequest*(self: AccessInterface, publicKey: string): void {.base.} =
raise newException(ValueError, "No implementation available")
method blockContact*(self: AccessInterface, publicKey: string): void {.base.} =
raise newException(ValueError, "No implementation available")
method addGroupMembers*(self: AccessInterface, communityID: string, chatId: string, pubKeys: seq[string]) {.base.} =
raise newException(ValueError, "No implementation available")
method removeMemberFromGroupChat*(self: AccessInterface, communityID: string, chatId: string, pubKey: string) {.base.} =
raise newException(ValueError, "No implementation available")
method renameGroupChat*(self: AccessInterface, communityID: string, chatId: string, newName: string) {.base.} =
raise newException(ValueError, "No implementation available")
method makeAdmin*(self: AccessInterface, communityID: string, chatId: string, pubKey: string) {.base.} =
raise newException(ValueError, "No implementation available")
method createGroupChat*(self: AccessInterface, communityID: string, groupName: string, pubKeys: seq[string]) {.base.} =
raise newException(ValueError, "No implementation available")
method joinGroup*(self: AccessInterface) {.base.} =
raise newException(ValueError, "No implementation available")
method joinGroupChatFromInvitation*(self: AccessInterface, groupName: string, chatId: string, adminPK: string) {.base.} =
raise newException(ValueError, "No implementation available")
method acceptRequestToJoinCommunity*(self: AccessInterface, requestId: string) {.base.} =
raise newException(ValueError, "No implementation available")
method declineRequestToJoinCommunity*(self: AccessInterface, requestId: string) {.base.} =
raise newException(ValueError, "No implementation available")
method createCommunityChannel*(self: AccessInterface, name: string, description: string,
emoji: string, color: string, categoryId: string) {.base.} =
raise newException(ValueError, "No implementation available")
method editCommunityChannel*(self: AccessInterface, channelId: string, name: string,
description: string, emoji: string, color: string, categoryId: string, position: int) {.base.} =
raise newException(ValueError, "No implementation available")
method createCommunityCategory*(self: AccessInterface, name: string, channels: seq[string]) {.base.} =
raise newException(ValueError, "No implementation available")
method editCommunityCategory*(self: AccessInterface, categoryId: string, name: string, channels: seq[string]) {.base.} =
raise newException(ValueError, "No implementation available")
method deleteCommunityCategory*(self: AccessInterface, categoryId: string) {.base.} =
raise newException(ValueError, "No implementation available")
method leaveCommunity*(self: AccessInterface) {.base.} =
raise newException(ValueError, "No implementation available")
method removeUserFromCommunity*(self: AccessInterface, pubKey: string) {.base.} =
raise newException(ValueError, "No implementation available")
method editCommunity*(self: AccessInterface, name: string, description: string, access: int, ensOnly: bool, color: string, imageUrl: string, aX: int, aY: int, bX: int, bY: int) {.base.} =
raise newException(ValueError, "No implementation available")
method exportCommunity*(self: AccessInterface): string {.base.} =
raise newException(ValueError, "No implementation available")
method setCommunityMuted*(self: AccessInterface, muted: bool) {.base.} =
raise newException(ValueError, "No implementation available")
method inviteUsersToCommunity*(self: AccessInterface, pubKeys: string): string {.base.} =
raise newException(ValueError, "No implementation available")
method reorderCommunityCategories*(self: AccessInterface, categoryId: string, position: int) {.base.} =
raise newException(ValueError, "No implementation available")
method reorderCommunityChat*(self: AccessInterface, categoryId: string, chatId: string, position: int): string {.base.} =
raise newException(ValueError, "No implementation available")
method getRenderedText*(self: AccessInterface, parsedTextArray: seq[ParsedText]): string {.base.} =
raise newException(ValueError, "No implementation available")

View File

@ -1,12 +1,269 @@
# Defines how parent module accesses this module
include ./private_interfaces/module_base_interface
include ./private_interfaces/module_access_interface
import NimQml
# Defines how this module view communicates with this module
include ./private_interfaces/module_view_delegate_interface
import ../../../../app_service/service/settings/service as settings_service
import ../../../../app_service/service/contacts/service as contact_service
import ../../../../app_service/service/chat/service as chat_service
import ../../../../app_service/service/community/service as community_service
import ../../../../app_service/service/message/service as message_service
import ../../../../app_service/service/gif/service as gif_service
import ../../../../app_service/service/mailservers/service as mailservers_service
# Defines how this controller communicates with this module
include ./private_interfaces/module_controller_delegate_interface
import model as chats_model
# Defines how submodules of this module communicate with this module
include ./private_interfaces/module_chat_content_delegate_interface
import ../../../core/eventemitter
type
AccessInterface* {.pure inheritable.} = ref object of RootObj
method delete*(self: AccessInterface) {.base.} =
raise newException(ValueError, "No implementation available")
method load*(self: AccessInterface, events: EventEmitter,
settingsService: settings_service.Service,
contactService: contact_service.Service,
chatService: chat_service.Service,
communityService: community_service.Service,
messageService: message_service.Service,
gifService: gif_service.Service,
mailserversService: mailservers_service.Service) {.base.} =
raise newException(ValueError, "No implementation available")
method isLoaded*(self: AccessInterface): bool {.base.} =
raise newException(ValueError, "No implementation available")
method getModuleAsVariant*(self: AccessInterface): QVariant {.base.} =
raise newException(ValueError, "No implementation available")
method onActiveSectionChange*(self: AccessInterface, sectionId: string) {.base.} =
raise newException(ValueError, "No implementation available")
method chatsModel*(self: AccessInterface): chats_model.Model {.base.} =
raise newException(ValueError, "No implementation available")
method setFirstChannelAsActive*(self: AccessInterface) {.base.} =
raise newException(ValueError, "No implementation available")
method chatContentDidLoad*(self: AccessInterface) {.base.} =
raise newException(ValueError, "No implementation available")
method activeItemSubItemSet*(self: AccessInterface, itemId: string, subItemId: string) {.base.} =
raise newException(ValueError, "No implementation available")
method makeChatWithIdActive*(self: AccessInterface, chatId: string) {.base.} =
raise newException(ValueError, "No implementation available")
method addNewChat*(self: AccessInterface, chatDto: ChatDto, belongsToCommunity: bool, events: EventEmitter,
settingsService: settings_service.Service, contactService: contact_service.Service,
chatService: chat_service.Service, communityService: community_service.Service,
messageService: message_service.Service, gifService: gif_service.Service,
mailserversService: mailservers_service.Service, setChatAsActive: bool = true) {.base.} =
raise newException(ValueError, "No implementation available")
method doesCatOrChatExist*(self: AccessInterface, chatId: string): bool {.base.} =
raise newException(ValueError, "No implementation available")
method doesTopLevelChatExist*(self: AccessInterface, chatId: string): bool {.base.} =
raise newException(ValueError, "No implementation available")
method addChatIfDontExist*(self: AccessInterface,
chat: ChatDto,
belongsToCommunity: bool,
events: EventEmitter,
settingsService: settings_service.Service,
contactService: contact_service.Service,
chatService: chat_service.Service,
communityService: community_service.Service,
messageService: message_service.Service,
gifService: gif_service.Service,
mailserversService: mailservers_service.Service,
setChatAsActive: bool = true) {.base.} =
raise newException(ValueError, "No implementation available")
method onNewMessagesReceived*(self: AccessInterface, chatId: string, unviewedMessagesCount: int,
unviewedMentionsCount: int, messages: seq[MessageDto]) {.base.} =
raise newException(ValueError, "No implementation available")
method onChatMuted*(self: AccessInterface, chatId: string) {.base.} =
raise newException(ValueError, "No implementation available")
method onChatUnmuted*(self: AccessInterface, chatId: string) {.base.} =
raise newException(ValueError, "No implementation available")
method onMarkAllMessagesRead*(self: AccessInterface, chatId: string) {.base.} =
raise newException(ValueError, "No implementation available")
method onContactAccepted*(self: AccessInterface, publicKey: string) {.base.} =
raise newException(ValueError, "No implementation available")
method onContactRejected*(self: AccessInterface, publicKey: string) {.base.} =
raise newException(ValueError, "No implementation available")
method onContactBlocked*(self: AccessInterface, publicKey: string) {.base.} =
raise newException(ValueError, "No implementation available")
method onContactUnblocked*(self: AccessInterface, publicKey: string) {.base.} =
raise newException(ValueError, "No implementation available")
method onContactDetailsUpdated*(self: AccessInterface, contactId: string) {.base.} =
raise newException(ValueError, "No implementation available")
method onCommunityChannelDeletedOrChatLeft*(self: AccessInterface, chatId: string) {.base.} =
raise newException(ValueError, "No implementation available")
method onChatRenamed*(self: AccessInterface, chatId: string, newName: string) {.base.} =
raise newException(ValueError, "No implementation available")
method onCommunityChannelEdited*(self: AccessInterface, chat: ChatDto) {.base.} =
raise newException(ValueError, "No implementation available")
method onReorderChatOrCategory*(self: AccessInterface, chatOrCatId: string, position: int) {.base.} =
raise newException(ValueError, "No implementation available")
method onCommunityCategoryCreated*(self: AccessInterface, category: Category, chats: seq[ChatDto]) {.base.} =
raise newException(ValueError, "No implementation available")
method onCommunityCategoryDeleted*(self: AccessInterface, category: Category) {.base.} =
raise newException(ValueError, "No implementation available")
method onCommunityCategoryEdited*(self: AccessInterface, category: Category, chats: seq[ChatDto]) {.base.} =
raise newException(ValueError, "No implementation available")
method onCategoryNameChanged*(self: AccessInterface, category: Category) {.base.} =
raise newException(ValueError, "No implementation available")
method setLoadingHistoryMessagesInProgress*(self: AccessInterface, isLoading: bool) {.base.} =
raise newException(ValueError, "No implementation available")
method viewDidLoad*(self: AccessInterface) {.base.} =
raise newException(ValueError, "No implementation available")
method setActiveItemSubItem*(self: AccessInterface, itemId: string, subItemId: string) {.base.} =
raise newException(ValueError, "No implementation available")
method getChatContentModule*(self: AccessInterface, chatId: string): QVariant {.base.} =
raise newException(ValueError, "No implementation available")
method isCommunity*(self: AccessInterface): bool {.base.} =
raise newException(ValueError, "No implementation available")
method getMySectionId*(self: AccessInterface): string {.base.} =
raise newException(ValueError, "No implementation available")
method createPublicChat*(self: AccessInterface, chatId: string) {.base.} =
raise newException(ValueError, "No implementation available")
method createOneToOneChat*(self: AccessInterface, communityID: string, chatId: string, ensName: string) {.base.} =
raise newException(ValueError, "No implementation available")
method leaveChat*(self: AccessInterface, chatId: string) {.base.} =
raise newException(ValueError, "No implementation available")
method removeCommunityChat*(self: AccessInterface, chatId: string) {.base.} =
raise newException(ValueError, "No implementation available")
method getActiveChatId*(self: AccessInterface): string {.base.} =
raise newException(ValueError, "No implementation available")
method muteChat*(self: AccessInterface, chatId: string) {.base.} =
raise newException(ValueError, "No implementation available")
method unmuteChat*(self: AccessInterface, chatId: string) {.base.} =
raise newException(ValueError, "No implementation available")
method markAllMessagesRead*(self: AccessInterface, chatId: string) {.base.} =
raise newException(ValueError, "No implementation available")
method clearChatHistory*(self: AccessInterface, chatId: string) {.base.} =
raise newException(ValueError, "No implementation available")
method getCurrentFleet*(self: AccessInterface): string {.base.} =
raise newException(ValueError, "No implementation available")
method acceptContactRequest*(self: AccessInterface, publicKey: string) {.base.} =
raise newException(ValueError, "No implementation available")
method acceptAllContactRequests*(self: AccessInterface) {.base.} =
raise newException(ValueError, "No implementation available")
method rejectContactRequest*(self: AccessInterface, publicKey: string) {.base.} =
raise newException(ValueError, "No implementation available")
method rejectAllContactRequests*(self: AccessInterface) {.base.} =
raise newException(ValueError, "No implementation available")
method blockContact*(self: AccessInterface, publicKey: string) {.base.} =
raise newException(ValueError, "No implementation available")
method addGroupMembers*(self: AccessInterface, communityID: string, chatId: string, pubKeys: string) {.base.} =
raise newException(ValueError, "No implementation available")
method removeMemberFromGroupChat*(self: AccessInterface, communityID: string, chatId: string, pubKey: string) {.base.} =
raise newException(ValueError, "No implementation available")
method renameGroupChat*(self: AccessInterface, communityID: string, chatId: string, newName: string) {.base.} =
raise newException(ValueError, "No implementation available")
method makeAdmin*(self: AccessInterface, communityID: string, chatId: string, pubKey: string) {.base.} =
raise newException(ValueError, "No implementation available")
method createGroupChat*(self: AccessInterface, communityID: string, groupName: string, pubKeys: string) {.base.} =
raise newException(ValueError, "No implementation available")
method joinGroupChatFromInvitation*(self: AccessInterface, groupName: string, chatId: string, adminPK: string) {.base.} =
raise newException(ValueError, "No implementation available")
method initListOfMyContacts*(self: AccessInterface, pubKeys: string) {.base.} =
raise newException(ValueError, "No implementation available")
method clearListOfMyContacts*(self: AccessInterface) {.base.} =
raise newException(ValueError, "No implementation available")
method acceptRequestToJoinCommunity*(self: AccessInterface, requestId: string) {.base.} =
raise newException(ValueError, "No implementation available")
method declineRequestToJoinCommunity*(self: AccessInterface, requestId: string) {.base.} =
raise newException(ValueError, "No implementation available")
method createCommunityChannel*(self: AccessInterface, name: string, description: string,
emoji: string, color: string, categoryId: string) {.base.} =
raise newException(ValueError, "No implementation available")
method editCommunityChannel*(self: AccessInterface, channelId, name, description, emoji, color,
categoryId: string, position: int) {.base.} =
raise newException(ValueError, "No implementation available")
method leaveCommunity*(self: AccessInterface) {.base.} =
raise newException(ValueError, "No implementation available")
method removeUserFromCommunity*(self: AccessInterface, pubKey: string) {.base.} =
raise newException(ValueError, "No implementation available")
method editCommunity*(self: AccessInterface, name: string, description: string, access: int, ensOnly: bool, color: string, imagePath: string, aX: int, aY: int, bX: int, bY: int) {.base.} =
raise newException(ValueError, "No implementation available")
method exportCommunity*(self: AccessInterface): string {.base.} =
raise newException(ValueError, "No implementation available")
method setCommunityMuted*(self: AccessInterface, muted: bool) {.base.} =
raise newException(ValueError, "No implementation available")
method inviteUsersToCommunity*(self: AccessInterface, pubKeysJSON: string): string {.base.} =
raise newException(ValueError, "No implementation available")
method createCommunityCategory*(self: AccessInterface, name: string, channels: seq[string]) {.base.} =
raise newException(ValueError, "No implementation available")
method editCommunityCategory*(self: AccessInterface, categoryId: string, name: string, channels: seq[string]) {.base.} =
raise newException(ValueError, "No implementation available")
method deleteCommunityCategory*(self: AccessInterface, categoryId: string) {.base.} =
raise newException(ValueError, "No implementation available")
method prepareEditCategoryModel*(self: AccessInterface, categoryId: string) {.base.} =
raise newException(ValueError, "No implementation available")
method reorderCommunityCategories*(self: AccessInterface, categoryId: string, position: int) =
raise newException(ValueError, "No implementation available")
method reorderCommunityChat*(self: AccessInterface, categoryId: string, chatId: string, position: int): string =
raise newException(ValueError, "No implementation available")

View File

@ -30,7 +30,7 @@ type
delegate: delegate_interface.AccessInterface
view: View
viewVariant: QVariant
controller: controller.AccessInterface
controller: Controller
chatContentModules: OrderedTable[string, chat_content_module.AccessInterface]
moduleLoaded: bool
@ -680,9 +680,6 @@ method makeAdmin*(self: Module, communityID: string, chatId: string, pubKey: str
method createGroupChat*(self: Module, communityID: string, groupName: string, pubKeys: string) =
self.controller.createGroupChat(communityID, groupName, self.convertPubKeysToJson(pubKeys))
method joinGroup*(self: Module) =
self.controller.joinGroup()
method joinGroupChatFromInvitation*(self: Module, groupName: string, chatId: string, adminPK: string) =
self.controller.joinGroupChatFromInvitation(groupName, chatId, adminPK)

View File

@ -1,41 +0,0 @@
import NimQml
import ../../../../../app_service/service/settings/service as settings_service
import ../../../../../app_service/service/contacts/service as contact_service
import ../../../../../app_service/service/chat/service as chat_service
import ../../../../../app_service/service/community/service as community_service
import ../../../../../app_service/service/message/service as message_service
import ../../../../../app_service/service/gif/service as gif_service
import ../../../../../app_service/service/mailservers/service as mailservers_service
import ../model as chats_model
import ../../../../core/eventemitter
method delete*(self: AccessInterface) {.base.} =
raise newException(ValueError, "No implementation available")
method load*(self: AccessInterface, events: EventEmitter,
settingsService: settings_service.Service,
contactService: contact_service.Service,
chatService: chat_service.Service,
communityService: community_service.Service,
messageService: message_service.Service,
gifService: gif_service.Service,
mailserversService: mailservers_service.Service) {.base.} =
raise newException(ValueError, "No implementation available")
method isLoaded*(self: AccessInterface): bool {.base.} =
raise newException(ValueError, "No implementation available")
method getModuleAsVariant*(self: AccessInterface): QVariant {.base.} =
raise newException(ValueError, "No implementation available")
method onActiveSectionChange*(self: AccessInterface, sectionId: string) {.base.} =
raise newException(ValueError, "No implementation available")
method chatsModel*(self: AccessInterface): chats_model.Model {.base.} =
raise newException(ValueError, "No implementation available")
method setFirstChannelAsActive*(self: AccessInterface) {.base.} =
raise newException(ValueError, "No implementation available")

View File

@ -1,5 +0,0 @@
type
AccessInterface* {.pure inheritable.} = ref object of RootObj
# Since nim doesn't support using concepts in second level nested types we
# define delegate interfaces within access interface.

View File

@ -1,2 +0,0 @@
method chatContentDidLoad*(self: AccessInterface) {.base.} =
raise newException(ValueError, "No implementation available")

View File

@ -1,87 +0,0 @@
method activeItemSubItemSet*(self: AccessInterface, itemId: string, subItemId: string) {.base.} =
raise newException(ValueError, "No implementation available")
method makeChatWithIdActive*(self: AccessInterface, chatId: string) {.base.} =
raise newException(ValueError, "No implementation available")
method addNewChat*(self: AccessInterface, chatDto: ChatDto, belongsToCommunity: bool, events: EventEmitter,
settingsService: settings_service.Service, contactService: contact_service.Service,
chatService: chat_service.Service, communityService: community_service.Service,
messageService: message_service.Service, gifService: gif_service.Service,
mailserversService: mailservers_service.Service, setChatAsActive: bool = true) {.base.} =
raise newException(ValueError, "No implementation available")
method doesCatOrChatExist*(self: AccessInterface, chatId: string): bool {.base.} =
raise newException(ValueError, "No implementation available")
method doesTopLevelChatExist*(self: AccessInterface, chatId: string): bool {.base.} =
raise newException(ValueError, "No implementation available")
method addChatIfDontExist*(self: AccessInterface,
chat: ChatDto,
belongsToCommunity: bool,
events: EventEmitter,
settingsService: settings_service.Service,
contactService: contact_service.Service,
chatService: chat_service.Service,
communityService: community_service.Service,
messageService: message_service.Service,
gifService: gif_service.Service,
mailserversService: mailservers_service.Service,
setChatAsActive: bool = true) {.base.} =
raise newException(ValueError, "No implementation available")
method onNewMessagesReceived*(self: AccessInterface, chatId: string, unviewedMessagesCount: int,
unviewedMentionsCount: int, messages: seq[MessageDto]) {.base.} =
raise newException(ValueError, "No implementation available")
method onChatMuted*(self: AccessInterface, chatId: string) {.base.} =
raise newException(ValueError, "No implementation available")
method onChatUnmuted*(self: AccessInterface, chatId: string) {.base.} =
raise newException(ValueError, "No implementation available")
method onMarkAllMessagesRead*(self: AccessInterface, chatId: string) {.base.} =
raise newException(ValueError, "No implementation available")
method onContactAccepted*(self: AccessInterface, publicKey: string) {.base.} =
raise newException(ValueError, "No implementation available")
method onContactRejected*(self: AccessInterface, publicKey: string) {.base.} =
raise newException(ValueError, "No implementation available")
method onContactBlocked*(self: AccessInterface, publicKey: string) {.base.} =
raise newException(ValueError, "No implementation available")
method onContactUnblocked*(self: AccessInterface, publicKey: string) {.base.} =
raise newException(ValueError, "No implementation available")
method onContactDetailsUpdated*(self: AccessInterface, contactId: string) {.base.} =
raise newException(ValueError, "No implementation available")
method onCommunityChannelDeletedOrChatLeft*(self: AccessInterface, chatId: string) {.base.} =
raise newException(ValueError, "No implementation available")
method onChatRenamed*(self: AccessInterface, chatId: string, newName: string) {.base.} =
raise newException(ValueError, "No implementation available")
method onCommunityChannelEdited*(self: AccessInterface, chat: ChatDto) {.base.} =
raise newException(ValueError, "No implementation available")
method onReorderChatOrCategory*(self: AccessInterface, chatOrCatId: string, position: int) {.base.} =
raise newException(ValueError, "No implementation available")
method onCommunityCategoryCreated*(self: AccessInterface, category: Category, chats: seq[ChatDto]) {.base.} =
raise newException(ValueError, "No implementation available")
method onCommunityCategoryDeleted*(self: AccessInterface, category: Category) {.base.} =
raise newException(ValueError, "No implementation available")
method onCommunityCategoryEdited*(self: AccessInterface, category: Category, chats: seq[ChatDto]) {.base.} =
raise newException(ValueError, "No implementation available")
method onCategoryNameChanged*(self: AccessInterface, category: Category) {.base.} =
raise newException(ValueError, "No implementation available")
method setLoadingHistoryMessagesInProgress*(self: AccessInterface, isLoading: bool) {.base.} =
raise newException(ValueError, "No implementation available")

View File

@ -1,139 +0,0 @@
import NimQml
method viewDidLoad*(self: AccessInterface) {.base.} =
raise newException(ValueError, "No implementation available")
method setActiveItemSubItem*(self: AccessInterface, itemId: string, subItemId: string) {.base.} =
raise newException(ValueError, "No implementation available")
method getChatContentModule*(self: AccessInterface, chatId: string): QVariant {.base.} =
raise newException(ValueError, "No implementation available")
method isCommunity*(self: AccessInterface): bool {.base.} =
raise newException(ValueError, "No implementation available")
method getMySectionId*(self: AccessInterface): string {.base.} =
raise newException(ValueError, "No implementation available")
method createPublicChat*(self: AccessInterface, chatId: string) {.base.} =
raise newException(ValueError, "No implementation available")
method createOneToOneChat*(self: AccessInterface, communityID: string, chatId: string, ensName: string) {.base.} =
raise newException(ValueError, "No implementation available")
method leaveChat*(self: AccessInterface, chatId: string) {.base.} =
raise newException(ValueError, "No implementation available")
method removeCommunityChat*(self: AccessInterface, chatId: string) {.base.} =
raise newException(ValueError, "No implementation available")
method getActiveChatId*(self: AccessInterface): string {.base.} =
raise newException(ValueError, "No implementation available")
method muteChat*(self: AccessInterface, chatId: string) {.base.} =
raise newException(ValueError, "No implementation available")
method unmuteChat*(self: AccessInterface, chatId: string) {.base.} =
raise newException(ValueError, "No implementation available")
method markAllMessagesRead*(self: AccessInterface, chatId: string) {.base.} =
raise newException(ValueError, "No implementation available")
method clearChatHistory*(self: AccessInterface, chatId: string) {.base.} =
raise newException(ValueError, "No implementation available")
method getCurrentFleet*(self: AccessInterface): string {.base.} =
raise newException(ValueError, "No implementation available")
method acceptContactRequest*(self: AccessInterface, publicKey: string) {.base.} =
raise newException(ValueError, "No implementation available")
method acceptAllContactRequests*(self: AccessInterface) {.base.} =
raise newException(ValueError, "No implementation available")
method rejectContactRequest*(self: AccessInterface, publicKey: string) {.base.} =
raise newException(ValueError, "No implementation available")
method rejectAllContactRequests*(self: AccessInterface) {.base.} =
raise newException(ValueError, "No implementation available")
method blockContact*(self: AccessInterface, publicKey: string) {.base.} =
raise newException(ValueError, "No implementation available")
method addGroupMembers*(self: AccessInterface, communityID: string, chatId: string, pubKeys: string) {.base.} =
raise newException(ValueError, "No implementation available")
method removeMemberFromGroupChat*(self: AccessInterface, communityID: string, chatId: string, pubKey: string) {.base.} =
raise newException(ValueError, "No implementation available")
method renameGroupChat*(self: AccessInterface, communityID: string, chatId: string, newName: string) {.base.} =
raise newException(ValueError, "No implementation available")
method makeAdmin*(self: AccessInterface, communityID: string, chatId: string, pubKey: string) {.base.} =
raise newException(ValueError, "No implementation available")
method createGroupChat*(self: AccessInterface, communityID: string, groupName: string, pubKeys: string) {.base.} =
raise newException(ValueError, "No implementation available")
method joinGroup*(self: AccessInterface) {.base.} =
raise newException(ValueError, "No implementation available")
method joinGroupChatFromInvitation*(self: AccessInterface, groupName: string, chatId: string, adminPK: string) {.base.} =
raise newException(ValueError, "No implementation available")
method initListOfMyContacts*(self: AccessInterface, pubKeys: string) {.base.} =
raise newException(ValueError, "No implementation available")
method clearListOfMyContacts*(self: AccessInterface) {.base.} =
raise newException(ValueError, "No implementation available")
method acceptRequestToJoinCommunity*(self: AccessInterface, requestId: string) {.base.} =
raise newException(ValueError, "No implementation available")
method declineRequestToJoinCommunity*(self: AccessInterface, requestId: string) {.base.} =
raise newException(ValueError, "No implementation available")
method createCommunityChannel*(self: AccessInterface, name: string, description: string,
emoji: string, color: string, categoryId: string) {.base.} =
raise newException(ValueError, "No implementation available")
method editCommunityChannel*(self: AccessInterface, channelId, name, description, emoji, color,
categoryId: string, position: int) {.base.} =
raise newException(ValueError, "No implementation available")
method leaveCommunity*(self: AccessInterface) {.base.} =
raise newException(ValueError, "No implementation available")
method removeUserFromCommunity*(self: AccessInterface, pubKey: string) {.base.} =
raise newException(ValueError, "No implementation available")
method editCommunity*(self: AccessInterface, name: string, description: string, access: int, ensOnly: bool, color: string, imagePath: string, aX: int, aY: int, bX: int, bY: int) {.base.} =
raise newException(ValueError, "No implementation available")
method exportCommunity*(self: AccessInterface): string {.base.} =
raise newException(ValueError, "No implementation available")
method setCommunityMuted*(self: AccessInterface, muted: bool) {.base.} =
raise newException(ValueError, "No implementation available")
method inviteUsersToCommunity*(self: AccessInterface, pubKeysJSON: string): string {.base.} =
raise newException(ValueError, "No implementation available")
method createCommunityCategory*(self: AccessInterface, name: string, channels: seq[string]) {.base.} =
raise newException(ValueError, "No implementation available")
method editCommunityCategory*(self: AccessInterface, categoryId: string, name: string, channels: seq[string]) {.base.} =
raise newException(ValueError, "No implementation available")
method deleteCommunityCategory*(self: AccessInterface, categoryId: string) {.base.} =
raise newException(ValueError, "No implementation available")
method prepareEditCategoryModel*(self: AccessInterface, categoryId: string) {.base.} =
raise newException(ValueError, "No implementation available")
method reorderCommunityCategories*(self: AccessInterface, categoryId: string, position: int) =
raise newException(ValueError, "No implementation available")
method reorderCommunityChat*(self: AccessInterface, categoryId: string, chatId: string, position: int): string =
raise newException(ValueError, "No implementation available")

View File

@ -196,9 +196,6 @@ QtObject:
proc createGroupChat*(self: View, communityID: string, groupName: string, pubKeys: string) {.slot.} =
self.delegate.createGroupChat(communityID, groupName, pubKeys)
proc joinGroup*(self: View) {.slot.} =
self.delegate.joinGroup()
proc joinGroupChatFromInvitation*(self: View, groupName: string, chatId: string, adminPK: string) {.slot.} =
self.delegate.joinGroupChatFromInvitation(groupName, chatId, adminPK)

View File

@ -1,5 +1,4 @@
import Tables, stint
import ./controller_interface
import ./io_interface
import ../../../core/signals/types
@ -7,10 +6,8 @@ import ../../../core/eventemitter
import ../../../../app_service/service/community/service as community_service
import ../../../../app_service/service/contacts/service as contacts_service
export controller_interface
type
Controller* = ref object of controller_interface.AccessInterface
Controller* = ref object of RootObj
delegate: io_interface.AccessInterface
events: EventEmitter
communityService: community_service.Service
@ -28,10 +25,10 @@ proc newController*(
result.communityService = communityService
result.contactsService = contactsService
method delete*(self: Controller) =
proc delete*(self: Controller) =
discard
method init*(self: Controller) =
proc init*(self: Controller) =
self.events.on(SIGNAL_COMMUNITY_CREATED) do(e:Args):
let args = CommunityArgs(e)
self.delegate.communityAdded(args.community)
@ -56,16 +53,16 @@ method init*(self: Controller) =
for community in args.communities:
self.delegate.communityEdited(community)
method getAllCommunities*(self: Controller): seq[CommunityDto] =
proc getAllCommunities*(self: Controller): seq[CommunityDto] =
result = self.communityService.getAllCommunities()
method joinCommunity*(self: Controller, communityId: string): string =
proc joinCommunity*(self: Controller, communityId: string): string =
self.communityService.joinCommunity(communityId)
method requestToJoinCommunity*(self: Controller, communityId: string, ensName: string) =
proc requestToJoinCommunity*(self: Controller, communityId: string, ensName: string) =
self.communityService.requestToJoinCommunity(communityId, ensName)
method createCommunity*(
proc createCommunity*(
self: Controller,
name: string,
description: string,
@ -83,7 +80,7 @@ method createCommunity*(
imageUrl,
aX, aY, bX, bY)
method reorderCommunityChat*(
proc reorderCommunityChat*(
self: Controller,
communityId: string,
categoryId: string,
@ -95,42 +92,42 @@ method reorderCommunityChat*(
chatId,
position)
method deleteCommunityChat*(
proc deleteCommunityChat*(
self: Controller,
communityId: string,
chatId: string) =
self.communityService.deleteCommunityChat(communityId, chatId)
method deleteCommunityCategory*(
proc deleteCommunityCategory*(
self: Controller,
communityId: string,
categoryId: string) =
self.communityService.deleteCommunityCategory(communityId, categoryId)
method requestCommunityInfo*(self: Controller, communityId: string) =
proc requestCommunityInfo*(self: Controller, communityId: string) =
self.communityService.requestCommunityInfo(communityId)
method importCommunity*(self: Controller, communityKey: string) =
proc importCommunity*(self: Controller, communityKey: string) =
self.communityService.importCommunity(communityKey)
method banUserFromCommunity*(self: Controller, communityId: string, pubKey: string) =
proc banUserFromCommunity*(self: Controller, communityId: string, pubKey: string) =
self.communityService.removeUserFromCommunity(communityId, pubKey)
method setCommunityMuted*(self: Controller, communityId: string, muted: bool) =
proc setCommunityMuted*(self: Controller, communityId: string, muted: bool) =
self.communityService.setCommunityMuted(communityId, muted)
method getContactNameAndImage*(self: Controller, contactId: string):
proc getContactNameAndImage*(self: Controller, contactId: string):
tuple[name: string, image: string, isIdenticon: bool] =
return self.contactsService.getContactNameAndImage(contactId)
method getContactDetails*(self: Controller, contactId: string): ContactDetails =
proc getContactDetails*(self: Controller, contactId: string): ContactDetails =
return self.contactsService.getContactDetails(contactId)
method isUserMemberOfCommunity*(self: Controller, communityId: string): bool =
proc isUserMemberOfCommunity*(self: Controller, communityId: string): bool =
return self.communityService.isUserMemberOfCommunity(communityId)
method userCanJoin*(self: Controller, communityId: string): bool =
proc userCanJoin*(self: Controller, communityId: string): bool =
return self.communityService.userCanJoin(communityId)
method isCommunityRequestPending*(self: Controller, communityId: string): bool =
proc isCommunityRequestPending*(self: Controller, communityId: string): bool =
return self.communityService.isCommunityRequestPending(communityId)

View File

@ -1,69 +0,0 @@
import ../../../../app_service/service/community/service as community_service
import ../../../../app_service/service/contacts/service as contacts_service
type
AccessInterface* {.pure inheritable.} = ref object of RootObj
## Abstract class for any input/interaction with this module.
method delete*(self: AccessInterface) {.base.} =
raise newException(ValueError, "No implementation available")
method init*(self: AccessInterface) {.base.} =
raise newException(ValueError, "No implementation available")
method getAllCommunities*(self: AccessInterface): seq[CommunityDto] {.base.} =
raise newException(ValueError, "No implementation available")
method joinCommunity*(self: AccessInterface, communityId: string): string {.base.} =
raise newException(ValueError, "No implementation available")
method requestToJoinCommunity*(self: AccessInterface, communityId: string, ensName: string) {.base.} =
raise newException(ValueError, "No implementation available")
method createCommunity*(self: AccessInterface, name: string, description: string, access: int, ensOnly: bool, color: string, imageUrl: string, aX: int, aY: int, bX: int, bY: int) {.base.} =
raise newException(ValueError, "No implementation available")
method editCommunityChannel*(self: AccessInterface, communityId: string, chatId: string, name: string, description: string, categoryId: string, position: int) {.base.} =
raise newException(ValueError, "No implementation available")
method reorderCommunityChat*(self: AccessInterface, communityId: string, categoryId: string, chatId: string, position: int) {.base.} =
raise newException(ValueError, "No implementation available")
method deleteCommunityChat*(self: AccessInterface, communityId: string, chatId: string) {.base.} =
raise newException(ValueError, "No implementation available")
method deleteCommunityCategory*(self: AccessInterface, communityId: string, categoryId: string) {.base.} =
raise newException(ValueError, "No implementation available")
method requestCommunityInfo*(self: AccessInterface, communityId: string) {.base.} =
raise newException(ValueError, "No implementation available")
method isUserMemberOfCommunity*(self: AccessInterface, communityId: string): bool {.base.} =
raise newException(ValueError, "No implementation available")
method userCanJoin*(self: AccessInterface, communityId: string): bool {.base.} =
raise newException(ValueError, "No implementation available")
method isCommunityRequestPending*(self: AccessInterface, communityId: string): bool {.base.} =
raise newException(ValueError, "No implementation available")
method importCommunity*(self: AccessInterface, communityKey: string) {.base.} =
raise newException(ValueError, "No implementation available")
method banUserFromCommunity*(self: AccessInterface, communityId: string, pubKey: string) {.base.} =
raise newException(ValueError, "No implementation available")
method setCommunityMuted*(self: AccessInterface, communityId: string, muted: bool) {.base.} =
raise newException(ValueError, "No implementation available")
method getContactNameAndImage*(self: AccessInterface, contactId: string):
tuple[name: string, image: string, isIdenticon: bool] {.base.} =
raise newException(ValueError, "No implementation available")
method getContactDetails*(self: AccessInterface, contactId: string): ContactDetails {.base.} =
raise newException(ValueError, "No implementation available")
type
## Abstract class (concept) which must be implemented by object/s used in this
## module.
DelegateInterface* = concept c

View File

@ -1,9 +1,95 @@
# Defines how parent module accesses this module
include ./private_interfaces/module_base_interface
include ./private_interfaces/module_access_interface
import ../../../../app_service/service/community/service as community_service
import ../../shared_models/section_item
# Defines how this module view communicates with this module
include ./private_interfaces/module_view_delegate_interface
type
AccessInterface* {.pure inheritable.} = ref object of RootObj
# Defines how this controller communicates with this module
include ./private_interfaces/module_controller_delegate_interface
method delete*(self: AccessInterface) {.base.} =
raise newException(ValueError, "No implementation available")
method load*(self: AccessInterface) {.base.} =
raise newException(ValueError, "No implementation available")
method isLoaded*(self: AccessInterface): bool {.base.} =
raise newException(ValueError, "No implementation available")
method setAllCommunities*(self: AccessInterface, communities: seq[CommunityDto]) {.base.} =
raise newException(ValueError, "No implementation available")
method getCommunityItem*(self: AccessInterface, community: CommunityDto): SectionItem {.base.} =
raise newException(ValueError, "No implementation available")
method joinCommunity*(self: AccessInterface, communityId: string): string {.base.} =
raise newException(ValueError, "No implementation available")
method createCommunity*(self: AccessInterface, name: string, description: string, access: int, ensOnly: bool, color: string, imagePath: string, aX: int, aY: int, bX: int, bY: int) {.base.} =
raise newException(ValueError, "No implementation available")
method deleteCommunityCategory*(self: AccessInterface, communityId: string, categoryId: string) {.base.} =
raise newException(ValueError, "No implementation available")
method reorderCommunityCategories*(self: AccessInterface, communityId: string, categoryId: string, position: int) {.base} =
raise newException(ValueError, "No implementation available")
method reorderCommunityChannel*(self: AccessInterface, communityId: string, categoryId: string, chatId: string, position: int) {.base} =
raise newException(ValueError, "No implementation available")
method banUserFromCommunity*(self: AccessInterface, pubKey: string, communityId: string) {.base.} =
raise newException(ValueError, "No implementation available")
method isUserMemberOfCommunity*(self: AccessInterface, communityId: string): bool {.base.} =
raise newException(ValueError, "No implementation available")
method userCanJoin*(self: AccessInterface, communityId: string): bool {.base.} =
raise newException(ValueError, "No implementation available")
method isCommunityRequestPending*(self: AccessInterface, communityId: string): bool {.base.} =
raise newException(ValueError, "No implementation available")
method requestToJoinCommunity*(self: AccessInterface, communityId: string, ensName: string) {.base.} =
raise newException(ValueError, "No implementation available")
method requestCommunityInfo*(self: AccessInterface, communityId: string) {.base.} =
raise newException(ValueError, "No implementation available")
method deleteCommunityChat*(self: AccessInterface, communityId: string, channelId: string) {.base.} =
raise newException(ValueError, "No implementation available")
method importCommunity*(self: AccessInterface, communityKey: string) {.base.} =
raise newException(ValueError, "No implementation available")
method myRequestAdded*(self: AccessInterface) {.base.} =
raise newException(ValueError, "No implementation available")
method communityLeft*(self: AccessInterface) {.base.} =
raise newException(ValueError, "No implementation available")
method communityChannelReordered*(self: AccessInterface) {.base.} =
raise newException(ValueError, "No implementation available")
method communityChannelDeleted*(self: AccessInterface) {.base.} =
raise newException(ValueError, "No implementation available")
method communityCategoryCreated*(self: AccessInterface) {.base.} =
raise newException(ValueError, "No implementation available")
method communityCategoryEdited*(self: AccessInterface) {.base.} =
raise newException(ValueError, "No implementation available")
method communityCategoryDeleted*(self: AccessInterface) {.base.} =
raise newException(ValueError, "No implementation available")
method communityEdited*(self: AccessInterface, community: CommunityDto) {.base.} =
raise newException(ValueError, "No implementation available")
method communityAdded*(self: AccessInterface, community: CommunityDto) {.base.} =
raise newException(ValueError, "No implementation available")
method communityImported*(self: AccessInterface, community: CommunityDto) {.base.} =
raise newException(ValueError, "No implementation available")
method onImportCommunityErrorOccured*(self: AccessInterface, error: string) {.base.} =
raise newException(ValueError, "No implementation available")
method viewDidLoad*(self: AccessInterface) {.base.} =
raise newException(ValueError, "No implementation available")

View File

@ -21,7 +21,7 @@ type
type
Module* = ref object of io_interface.AccessInterface
delegate: delegate_interface.AccessInterface
controller: controller.AccessInterface
controller: Controller
view: View
viewVariant: QVariant
moduleLoaded: bool

View File

@ -1,56 +0,0 @@
import ../../../../../app_service/service/community/service as community_service
import ../../../shared_models/section_item
method delete*(self: AccessInterface) {.base.} =
raise newException(ValueError, "No implementation available")
method load*(self: AccessInterface) {.base.} =
raise newException(ValueError, "No implementation available")
method isLoaded*(self: AccessInterface): bool {.base.} =
raise newException(ValueError, "No implementation available")
method setAllCommunities*(self: AccessInterface, communities: seq[CommunityDto]) {.base.} =
raise newException(ValueError, "No implementation available")
method getCommunityItem*(self: AccessInterface, community: CommunityDto): SectionItem {.base.} =
raise newException(ValueError, "No implementation available")
method joinCommunity*(self: AccessInterface, communityId: string): string {.base.} =
raise newException(ValueError, "No implementation available")
method createCommunity*(self: AccessInterface, name: string, description: string, access: int, ensOnly: bool, color: string, imagePath: string, aX: int, aY: int, bX: int, bY: int) {.base.} =
raise newException(ValueError, "No implementation available")
method deleteCommunityCategory*(self: AccessInterface, communityId: string, categoryId: string) {.base.} =
raise newException(ValueError, "No implementation available")
method reorderCommunityCategories*(self: AccessInterface, communityId: string, categoryId: string, position: int) {.base} =
raise newException(ValueError, "No implementation available")
method reorderCommunityChannel*(self: AccessInterface, communityId: string, categoryId: string, chatId: string, position: int) {.base} =
raise newException(ValueError, "No implementation available")
method banUserFromCommunity*(self: AccessInterface, pubKey: string, communityId: string) {.base.} =
raise newException(ValueError, "No implementation available")
method isUserMemberOfCommunity*(self: AccessInterface, communityId: string): bool {.base.} =
raise newException(ValueError, "No implementation available")
method userCanJoin*(self: AccessInterface, communityId: string): bool {.base.} =
raise newException(ValueError, "No implementation available")
method isCommunityRequestPending*(self: AccessInterface, communityId: string): bool {.base.} =
raise newException(ValueError, "No implementation available")
method requestToJoinCommunity*(self: AccessInterface, communityId: string, ensName: string) {.base.} =
raise newException(ValueError, "No implementation available")
method requestCommunityInfo*(self: AccessInterface, communityId: string) {.base.} =
raise newException(ValueError, "No implementation available")
method deleteCommunityChat*(self: AccessInterface, communityId: string, channelId: string) {.base.} =
raise newException(ValueError, "No implementation available")
method importCommunity*(self: AccessInterface, communityKey: string) {.base.} =
raise newException(ValueError, "No implementation available")

View File

@ -1,5 +0,0 @@
type
AccessInterface* {.pure inheritable.} = ref object of RootObj
# Since nim doesn't support using concepts in second level nested types we
# define delegate interfaces within access interface.

View File

@ -1,33 +0,0 @@
method myRequestAdded*(self: AccessInterface) {.base.} =
raise newException(ValueError, "No implementation available")
method communityLeft*(self: AccessInterface) {.base.} =
raise newException(ValueError, "No implementation available")
method communityChannelReordered*(self: AccessInterface) {.base.} =
raise newException(ValueError, "No implementation available")
method communityChannelDeleted*(self: AccessInterface) {.base.} =
raise newException(ValueError, "No implementation available")
method communityCategoryCreated*(self: AccessInterface) {.base.} =
raise newException(ValueError, "No implementation available")
method communityCategoryEdited*(self: AccessInterface) {.base.} =
raise newException(ValueError, "No implementation available")
method communityCategoryDeleted*(self: AccessInterface) {.base.} =
raise newException(ValueError, "No implementation available")
method communityEdited*(self: AccessInterface, community: CommunityDto) {.base.} =
raise newException(ValueError, "No implementation available")
method communityAdded*(self: AccessInterface, community: CommunityDto) {.base.} =
raise newException(ValueError, "No implementation available")
method communityImported*(self: AccessInterface, community: CommunityDto) {.base.} =
raise newException(ValueError, "No implementation available")
method onImportCommunityErrorOccured*(self: AccessInterface, error: string) {.base.} =
raise newException(ValueError, "No implementation available")

View File

@ -1,2 +0,0 @@
method viewDidLoad*(self: AccessInterface) {.base.} =
raise newException(ValueError, "No implementation available")

Some files were not shown because too many files have changed in this diff Show More