5
138
Fork
You've already forked goguma
18

Don't insert buffer.name into mode params unless needed. #85

Open
technomancy wants to merge 1 commit from technomancy/goguma:mode-command-2-args into master
pull from: technomancy/goguma:mode-command-2-args
merge into: emersion:master
emersion:master
emersion:irc-socket
emersion:webcrypto-0.6.1
emersion:high-level-message
emersion:blocked
emersion:web
emersion:scrollable-positioned-list
emersion:l10n
emersion:ci-jvm-size
emersion:extended-isupport
emersion:drop-flutter-background
emersion:dup-main
emersion:android-decl-plugins
First-time contributor
Copy link

If given a single mode param, then the buffer name should be added,
but normally it should just let all the params thru and pass them to
the server.

Fixes https://todo.sr.ht/~emersion/goguma/200

I've never used Dart before so pardon me if I'm making any dumb mistakes.

If given a single mode param, then the buffer name should be added, but normally it should just let all the params thru and pass them to the server. Fixes https://todo.sr.ht/~emersion/goguma/200 I've never used Dart before so pardon me if I'm making any dumb mistakes.
technomancy force-pushed mode-command-2-args from 3798b0a103
Some checks reported errors
builds.sr.ht/android Job failed
to eb03ded8d3
All checks were successful
builds.sr.ht/android Job completed
2025年12月25日 00:33:55 +01:00
Compare
@ -99,2 +99,3 @@
var buffer = context.read<BufferModel>();
client.send(IrcMessage('MODE', [buffer.name, ..._requireParam(param).split('')]));
var params = _requireParam(param).split('');
if (params.length == 1) {
Owner
Copy link

I don't think this works correctly with modes which take params, e.g. /mode +o foo?

I don't think this works correctly with modes which take params, e.g. `/mode +o foo`?
Author
First-time contributor
Copy link

Sure; it's maybe not the best solution but it still seems like an improvement over the way it works today.

Do you have an idea for a better criteria for determining whether to silently inject the extra argument?

Sure; it's maybe not the best solution but it still seems like an improvement over the way it works today. Do you have an idea for a better criteria for determining whether to silently inject the extra argument?
Owner
Copy link

My main issue is that this regresses current usage: commands which work and are in use today will not work once this patch is merged.

There is no perfect way to solve this indeed, gamja checks whether the first argument starts with + or - and inserts the channel name in that case only:

if (!target || target.startsWith("+") || target.startsWith("-")) {
My main issue is that this regresses current usage: commands which work and are in use today will not work once this patch is merged. There is no perfect way to solve this indeed, gamja checks whether the first argument starts with `+` or `-` and inserts the channel name in that case only: https://codeberg.org/emersion/gamja/src/commit/8aae4a2b07d4ba3ceda9b1182a9a4c86e6048210/commands.js#L237
All checks were successful
builds.sr.ht/android Job completed
This pull request can be merged automatically.
This branch is out-of-date with the base branch
You are not authorized to merge this pull request.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u mode-command-2-args:technomancy-mode-command-2-args
git switch technomancy-mode-command-2-args

Merge

Merge the changes and update on Forgejo.

Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.

git switch master
git merge --no-ff technomancy-mode-command-2-args
git switch technomancy-mode-command-2-args
git rebase master
git switch master
git merge --ff-only technomancy-mode-command-2-args
git switch technomancy-mode-command-2-args
git rebase master
git switch master
git merge --no-ff technomancy-mode-command-2-args
git switch master
git merge --squash technomancy-mode-command-2-args
git switch master
git merge --ff-only technomancy-mode-command-2-args
git switch master
git merge technomancy-mode-command-2-args
git push origin master
Sign in to join this conversation.
No reviewers
Milestone
Clear milestone
No items
No milestone
Projects
Clear projects
No items
No project
Assignees
Clear assignees
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
emersion/goguma!85
Reference in a new issue
emersion/goguma
No description provided.
Delete branch "technomancy/goguma:mode-command-2-args"

Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?