3
0
mirror of https://github.com/pragma-/pbot.git synced 2024-11-28 23:09:39 +01:00
Commit Graph

50 Commits

Author SHA1 Message Date
Pragmatic Software
7a7730d039
Interpreter: improve processing of embedded and split commands 2024-11-21 20:31:28 -08:00
Pragmatic Software
dbff4bc2f7
Interpreter: reset split_result after processing it
This fixes e.g.:

    <pragma-> ,{echo foo ;;; echo bar}  ,{echo baz}
       <PBot> foo bar
       <PBot> foo baz

To instead produce the expected:

    <PBot> foo bar
    <PBot> baz
2024-11-10 17:45:33 -08:00
Pragmatic Software
a11dc12861
Interpreter: remove debug message 2024-11-07 19:47:02 -08:00
Pragmatic Software
54ef6b14ce
Plugin/Date: use existing context when launching date applet
This preserves the pipe/cmd-substitution/etc to allow post-processing
of the `date` output.

Interpreter: Reset `interpreted` contextual metadata when handling
result to allow recursion for continued command processing.
2024-11-05 23:57:48 -08:00
Pragmatic Software
9ebc77f4da
Replace preserve_whitespace metadata with condense-whitespace
PBot now preserves whitespace by default. The `preserve_whitespace`
metadata field is now redundant. It has now been replaced with
`condense-whitespace`, which when set to a true value will collapse
adjacent whitespace to a single space.
2024-11-04 00:25:36 -08:00
Pragmatic Software
4c866d39b6
Fix white-space handling; add suppress-no-output 2024-11-03 19:26:56 -08:00
Pragmatic Software
1f232a9455
Applets: Add $context->{interpreted} to exit interpreter loop 2024-11-03 19:22:45 -08:00
Pragmatic Software
c6f6823df9
Fix misc white-spacing issues
* func sed no longer trims leading whitespace
* quoted text no longer trims leading whitespace
* no longer convert tabs to spaces in output
* no longer condense adjacent whitespace together in output
2024-11-02 17:57:19 -07:00
Pragmatic Software
af2d9844b8
Interpreter: allow processing of empty result
This fixes .e.g.:

    <pragma-> !echo foo &{echo bar | { sed s/bar// }} baz

such that it produces the output "foo  baz" instead of no output at all.
2024-11-02 17:53:37 -07:00
Pragmatic Software
d8a284e9c1
Core/Interpreter: preserve newlines in commands 2024-10-30 16:37:20 -07:00
Pragmatic Software
f4caf44eb0
split_line(): Remove no longer used next_ch/last_ch 2024-10-29 12:49:19 -07:00
Pragmatic Software
4287cb9fa2
Fix split_line() quoting to be more sh-like
E.g.:

<pragma-> show testcargs
   <PBot> [global] testcargs: /code c11 printf("/say args: " ); while (*++argv) printf("[%s] " , *argv);
<pragma-> testcargs 'hello''world' 'how are 'you today
   <PBot> args: [helloworld] [how are you] [today]

Previously, adjacent 'foo''bar' would end up as 2 args like [foo] [bar]. Now
they are properly concatenated into one [foobar] argument.

This also fixes the cases of whitespace being inserted after quoted arguments.
2024-10-29 10:19:46 -07:00
Pragmatic Software
755d7bd6c0
Bug fixes
general.debugcontext: filter out cmdlist and arglist

Core/Applets: log applet start/stop and duration

Core/ProcessManager: fix potential race-condition with $context object

Core/Interpreter:

    * expand pronouns before command-substitution
    * attempt to find current channel's factoid instance for metadata
    * remove duplication of command history in command-substition
    * terminate pipe/substitution processing when protecting self

Core/Factoids: limit -url contents to 250kb
2024-10-22 09:50:10 -07:00
Pragmatic Software
04209e4b7e
Interpreter: restore preserve_escapes in make_args() to fix sed
Update factoids
2024-06-03 09:07:53 -07:00
Pragmatic Software
80f9ea1acd
Interpreter: escaped spaces behave better 2024-05-26 17:44:59 -07:00
Pragmatic Software
5d3f188a09
Multiple bugfixes
* obtain bot nick from connection details instead of registry where appropriate

* irc.random_nick works again

* record own hostmask when connecting

* fix web-paste truncation by subtracting length of own hostmask from message length

* set irc.max_msg_len back to 510

* updated IRC numeric 378 to whoishost

* add sprunge.us to WebPaste
2024-04-07 20:55:04 -07:00
Pragmatic Software
5d3507421e
Plugin/Wordle: fix not detecting duplicate letters 2024-03-09 20:29:25 -08:00
Pragmatic Software
5ffde32d46
Factoids: disregard error messages when not explicitly invoked 2023-09-23 13:52:10 -07:00
Pragmatic Software
fe3e7c80cb
Interpreter: disallow /msg from vm-client 2023-08-19 16:36:26 -07:00
Pragmatic Software
f3ad345340 Core/Interpreter: require whitespace in front of bot name for suffix-trigger 2023-05-21 16:16:06 -07:00
Pragmatic Software
2b36286c22 Interpreter: extract_bracketed: missed a state change 2023-05-11 11:02:16 -07:00
Pragmatic Software
bc05915905 Interpreter: improve parsing of embedded commands 2023-05-11 08:08:38 -07:00
Pragmatic Software
bd6af472e8 Interpreter: remove left-over malformed section 2023-05-11 06:08:26 -07:00
Pragmatic Software
7ddb32ea16 Update core to use subroutine signatures 2023-04-13 21:04:12 -07:00
Pragmatic Software
05cf63e00c Interpreter: fix $0 in commands that use &{subs} 2023-03-23 08:56:58 -07:00
Pragmatic Software
8d5b992b4c Update copyright 2023-02-20 21:31:52 -08:00
Pragmatic Software
999c07f237 Support IRCv3 message tags; misc refactoring
PBot now finally supports IRCv3 message tags. The `account-tag`
capability is now enabled for improved NickServ account tracking.

Refactored CAP negotiation. Minor clean-ups in AntiFlood.pm (which ought to
be completely rewritten from the ground-up).

Misc clean-ups and refactoring of various things.
2023-01-27 11:48:01 -08:00
Pragmatic Software
74380f2a72 Core: Use EXIT_SUCCESS/EXIT_FAILURE; misc clean-ups 2022-07-10 12:45:27 -07:00
Pragmatic Software
e421f9b6bc Replace U+200b (zwsp) with U+feff (zwnbsp)
U+feff is now used instead of U+200b for nick-dehighlighting.

U+feff is non-breaking; it will not break-up the word when wrapping. It also
appears to be much more widely supported. In fact, some terminals will simply
strip the bytes -- this allows copying the text as-is, etc.

Additionally, an exclude-list was added to prevent dehighlighting of specific
nicknames. This is because several terminals do not fully support Unicode's
zero-width spaces -- they show up as plain spaces. Certain words for the #c
channel have been added to this exclude list since they are also somewhat
popular as nicknames there.
2022-01-18 10:32:21 -08:00
Pragmatic Software
74401977e1 Factoids: look-up use_output_queue/preserve_whitespace properly 2021-09-10 11:03:20 -07:00
Pragmatic Software
c3e16410c2 Whoops, execute_process() cannot return undef
If ProcessManager::execute_process() returns undef,
then the loop in Interpreter::interpret() thinks that
the command didn't get handled, and so goes on to look
for other commands. This is now corrected.
2021-09-07 10:18:12 -07:00
Pragmatic Software
169a4c9fc7 Fix minor issue with command piping; misc clean-ups 2021-09-04 20:53:02 -07:00
Pragmatic Software
731d795c03 Interpreter: log bot output in message history
Bot output now appears in `recall` and can be `grab`bed.

Moved truncate_result() a bit further down to truncate after target nick
is prefixed to output.
2021-08-26 10:47:59 -07:00
Pragmatic Software
fd1c5b66c9 Interpreter: move dehighlight/truncate to output_result() 2021-08-25 19:40:38 -07:00
Pragmatic Software
d9a9ef0cc0 Interpreter: fix truncated text with multiple nicks
dehighlight_nicks() was being invoked after truncate_result(), therefore
inserting \x200b zero-width space Unicode characters AFTER the message
was truncated.

Solution: moved dehighlight_nicks() to immediately preceding truncate_result().
2021-08-24 20:27:12 -07:00
Pragmatic Software
b7ce503a8d Interpreter: stop processing at the right spot 2021-08-23 22:11:33 -07:00
Pragmatic Software
a9eb7cc24b Interpreter: minor clean-up 2021-08-23 21:54:07 -07:00
Pragmatic Software
50d4a2a94d Interpreter: don't stop processing on empty result 2021-08-23 21:51:26 -07:00
Pragmatic Software
b638757f92 Interpreter: fix-up a/an article in front of &{cmdsub}s 2021-08-23 13:23:12 -07:00
Pragmatic Software
d1df2d325c Improve output of truncation text
Instead of "... [truncated; see http://xxx for full text.]" it more
concisely says "... <truncated; http://...>".

Increased irc.max_msg_len from a very conservative 425 to a more
generous 460. If you have very long channel names or nicknames, or if
you see things being truncated incorrectly, reduce this value.
2021-08-12 22:30:56 -07:00
Pragmatic Software
a0e2ba3610 Interpreter: minor comments about getopt 2021-08-02 04:57:52 -07:00
Pragmatic Software
483984754a Simplify use of getopt() throughout 2021-07-30 15:01:38 -07:00
Pragmatic Software
7c4c5847ab Interpreter: find factoid channel for dont-replace-pronouns metadata 2021-07-28 18:05:14 -07:00
Pragmatic Software
62a477b7c4 Fix rare case where dont-replace-pronouns was ignored 2021-07-27 23:25:38 -07:00
Pragmatic Software
59140d4096 Remove add_nick mess from ProcessManager 2021-07-27 21:27:03 -07:00
Pragmatic Software
c75be8b4b0 Refactor PBot::Core::Factoids into PBot::Core::Factoids::* 2021-07-26 21:39:44 -07:00
Pragmatic Software
baa726bec6 WebPaste: paste as text/plain to 0x0.st (prevents .bin pastes) 2021-07-24 14:18:19 -07:00
Pragmatic Software
7b703ccffe Move Storage and Utils into Core 2021-07-23 19:22:25 -07:00
Pragmatic Software
2b0201343f Progress on polishing things 2021-07-23 18:26:45 -07:00
Pragmatic Software
f0e617fef7 Move core packages into PBot/Core 2021-07-20 22:44:51 -07:00