mirror of
https://github.com/aziascreations/BakaShrot.git
synced 2026-11-23 20:58:46 +01:00
Added the list_topics and list_nodes role flags, Filtered the nodes listed by the roles
- `list_topics` / `list_nodes`: listing answers every topic, every node with messages, without reading any (`query` gives both). - Without them, listing nodes only answers those with messages in the topics the roles may read (every node until now). Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
This commit is contained in:
@@ -227,13 +227,14 @@ ptrdiff_t BakaShrot_GetMessageNodeW(uint16_t *buffer, ptrdiff_t size);
|
||||
|
||||
/**
|
||||
* Lists the topics with messages that this client may push to or read
|
||||
* (every one if it may query): how many, -1 on failure. Then
|
||||
* `BakaShrot_GetNamesList()`.
|
||||
* (every one if its roles have `list_topics` or `query`): how many, -1 on
|
||||
* failure. Then `BakaShrot_GetNamesList()`.
|
||||
*/
|
||||
int32_t BakaShrot_ListTopics(void);
|
||||
|
||||
/**
|
||||
* Lists every node with messages: how many, -1 on failure. Then
|
||||
* Lists the nodes with messages in the topics this client may read (every
|
||||
* one if its roles have `list_nodes` or `query`): how many, -1 on failure. Then
|
||||
* `BakaShrot_GetNamesList()`.
|
||||
*/
|
||||
int32_t BakaShrot_ListNodes(void);
|
||||
|
||||
@@ -542,11 +542,11 @@ class Client:
|
||||
time.sleep(interval)
|
||||
|
||||
def list_topics(self) -> NamesList:
|
||||
"""The topics with messages that the client may push to or read (every one if it may query)."""
|
||||
"""The topics with messages that the client may push to or read (every one with list_topics or query)."""
|
||||
return self._list(self._dll.ListTopics, "List topics")
|
||||
|
||||
def list_nodes(self) -> NamesList:
|
||||
"""Every node with messages."""
|
||||
"""The nodes with messages in the topics the client may read (every one with list_nodes or query)."""
|
||||
return self._list(self._dll.ListNodes, "List nodes")
|
||||
|
||||
def _list(self, function, what: str) -> NamesList:
|
||||
|
||||
Reference in New Issue
Block a user