Skip to content

Commit

Permalink
add callback for welcome help message event
Browse files Browse the repository at this point in the history
Signed-off-by: hwipl <33433250+hwipl@users.noreply.github.com>
  • Loading branch information
hwipl committed Nov 29, 2020
1 parent e3522ff commit 5e9d541
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
3 changes: 3 additions & 0 deletions nuqql_based/callback.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,9 @@ class Callback(Enum):
BASED_INTERRUPT = "BASED_INTERRUPT"
BASED_QUIT = "BASED_QUIT"

# help events
HELP_WELCOME = "HELP_WELCOME"

# nuqql commands
QUIT = "QUIT"
DISCONNECT = "DISCONNECT"
Expand Down
3 changes: 3 additions & 0 deletions nuqql_based/server.py
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,9 @@ async def _handle_client(self, reader: asyncio.StreamReader, writer:
return
self.connected = True

# trigger welcome event to enable custom welcome message
await self.callbacks.call(Callback.HELP_WELCOME, None, ())

# send accounts to new client if "push accounts" is enabled
if self.config.get_push_accounts():
accounts = self.handle_account_list()
Expand Down

0 comments on commit 5e9d541

Please sign in to comment.