~emersion/public-inbox

This thread contains a patchset. You're looking at the original emails, but you may wish to use the patch review UI. Review patch
3 2

[PATCH gamja v2] commands: Add LIST command

Cara Salter <cara@devcara.com>
Details
Message ID
<20211116163846.239940-1-cara@devcara.com>
DKIM signature
pass
Download raw message
Patch: +9 -0
Signed-off-by: Cara Salter <cara@devcara.com>
---
Incorporates changes from the review.
 commands.js | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/commands.js b/commands.js
index 7f13792..26178e7 100644
--- a/commands.js
+++ b/commands.js
@@ -411,4 +411,13 @@ export default {
			markServerBufferUnread(app);
		},
	},
	"list": {
		usage: "[filter]",
		description: "Retrieve a list of channels from a network",
		execute: (app, args) => {
			let filter = args[0];
			getActiveClient(app).send({ command: "LIST", params: [filter] });
			markServerBufferUnread(app);
		},
	},
};
-- 
2.33.1
Details
Message ID
<FMD2n-L3u6Q-dASsiIEw0Sw-ERqhq_b9cJSUEfSECD5H8R385yyy_CBLR90IOBhKIxbBTbMbJfyKw14hiCUT2dNMSykADTvSkz9VAG2dYGI=@emersion.fr>
In-Reply-To
<20211116163846.239940-1-cara@devcara.com> (view parent)
DKIM signature
pass
Download raw message
On Tuesday, November 16th, 2021 at 17:38, Cara Salter <cara@devcara.com> wrote:

> +	"list": {
> +		usage: "[filter]",
> +		description: "Retrieve a list of channels from a network",
> +		execute: (app, args) => {
> +			let filter = args[0];
> +			getActiveClient(app).send({ command: "LIST", params: [filter] });

Hm, I think this doesn't let the user execute `/list` without any argument?
`params: [filter]` vs. `params: args`.

> +			markServerBufferUnread(app);

Good idea: marking the server buffer as unread indicates to the user that the
reply to their command will be displayed there.
Cara Salter <cara@devcara.com>
Details
Message ID
<a6e25bfc-16c4-1d28-5f27-5bd5a34b853e@devcara.com>
In-Reply-To
<FMD2n-L3u6Q-dASsiIEw0Sw-ERqhq_b9cJSUEfSECD5H8R385yyy_CBLR90IOBhKIxbBTbMbJfyKw14hiCUT2dNMSykADTvSkz9VAG2dYGI=@emersion.fr> (view parent)
DKIM signature
pass
Download raw message
On 11/16/21 14:38, Simon Ser wrote:
> Hm, I think this doesn't let the user execute `/list` without any argument?
> `params: [filter]` vs. `params: args`.
When I tested it locally it worked both with and without an argument
> Good idea: marking the server buffer as unread indicates to the user that the
> reply to their command will be displayed there.
Yeah, I took it from the commands further up.
Details
Message ID
<50o5igsQInWEfmjVFfjF1fj7lwlKz0Z8VAikDvZ7gVyihaIV8KsOGLez7ebspQ8q6CFz9x-A5NjhYNwKZ-U03okbA3x2nsOAnSM8pcfoM7g=@emersion.fr>
In-Reply-To
<a6e25bfc-16c4-1d28-5f27-5bd5a34b853e@devcara.com> (view parent)
DKIM signature
pass
Download raw message
On Tuesday, November 16th, 2021 at 22:32, Cara Salter <cara@devcara.com> wrote:

> On 11/16/21 14:38, Simon Ser wrote:
> > Hm, I think this doesn't let the user execute `/list` without any argument?
> > `params: [filter]` vs. `params: args`.
>
> When I tested it locally it worked both with and without an argument

My guess is that this is sent as "LIST :" on the wire, instead of just "LIST".
Might work by chance on some servers, but better to avoid this.
Reply to thread Export thread (mbox)