Skip to content

Commit

Permalink
feat(Coommunity): Add ephemeral notification when request to join was…
Browse files Browse the repository at this point in the history
… sent

Part of: #7072
  • Loading branch information
borismelnik committed Sep 7, 2022
1 parent 255341e commit 0595bd3
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/app/modules/main/controller.nim
Original file line number Diff line number Diff line change
Expand Up @@ -225,6 +225,9 @@ proc init*(self: Controller) =
self.events.on(chat_service.SIGNAL_CHAT_LEFT) do(e: Args):
let args = chat_service.ChatArgs(e)
self.delegate.onChatLeft(args.chatId)

self.events.on(SIGNAL_COMMUNITY_MY_REQUEST_ADDED) do(e: Args):
self.delegate.onMyRequestAdded();

proc isConnected*(self: Controller): bool =
return self.nodeService.isConnected()
Expand Down
3 changes: 3 additions & 0 deletions src/app/modules/main/io_interface.nim
Original file line number Diff line number Diff line change
Expand Up @@ -205,6 +205,9 @@ method onStatusUrlRequested*(self: AccessInterface, action: StatusUrlAction, com
method getVerificationRequestFrom*(self: AccessInterface, publicKey: string): VerificationRequest {.base.} =
raise newException(ValueError, "No implementation available")

method onMyRequestAdded*(self: AccessInterface) {.base.} =
raise newException(ValueError, "No implementation available")

# This way (using concepts) is used only for the modules managed by AppController
type
DelegateInterface* = concept c
Expand Down
4 changes: 4 additions & 0 deletions src/app/modules/main/module.nim
Original file line number Diff line number Diff line change
Expand Up @@ -874,6 +874,10 @@ method ephemeralNotificationClicked*[T](self: Module[T], id: int64) =
else:
self.osNotificationClicked(item.details)

method onMyRequestAdded*[T](self: Module[T]) =
self.displayEphemeralNotification("Your Request has been submitted", "" , "checkmark-circle", false, EphemeralNotificationType.Success.int, "")


method onStatusUrlRequested*[T](self: Module[T], action: StatusUrlAction, communityId: string, chatId: string,
url: string, userId: string, groupName: string, listOfUserIds: seq[string]) =

Expand Down

0 comments on commit 0595bd3

Please sign in to comment.