24 Commits
Author SHA1 Message Date
NerixyzandGitHub 514ff0b42c feat(plugins): Add signal for context menus (#6961)
This PR adds the ability for plugins to add actions to context menus of
ChannelViews. They can add actions, submenus and separators.

I added the signal to the `WindowManager` to allow plugins to listen to
these events in any channel.

Here's an example plugin:

```lua
c2.windows:on_channelview_context_menu_requested(function(args)
	args.menu:add_action("Testing", function()
		args.channel:add_system_message("Clicked!")
	end)
	args.menu:insert_action(1, "First!", function()
		local msg = "text='" .. args.message.message_text .. "'"
		if args.message_element then
			msg = msg .. " element=" .. args.message_element.type
		end
		if args.split then
			msg = msg .. " split={channel=" .. args.split.channel:get_name() .. "}"
		end
		args.channel:add_system_message(msg)
	end)
	local sub = args.menu:add_menu("Submenu")
	sub:add_action("An action", function() end)
	sub:add_separator()
	sub:add_action("Second one", function() end)
end)
```

Reviewed-by: Mm2PL <mm2pl+gh@kotmisia.pl>
Reviewed-by: pajlada <rasmus.karlsson@pajlada.com>
2026-08-09 10:32:03 +00:00
NerixyzandGitHub d853137820 feat(plugins): Add c2.DateTime (#7096)
This adds the `DateTime` API described in #7021.

Reviewed-by: Mm2PL <mm2pl+gh@kotmisia.pl>
Reviewed-by: pajlada <rasmus.karlsson@pajlada.com>
2026-07-19 13:26:21 +00:00
NerixyzandGitHub 490bfdac07 feat(plugins): add readonly window layout access (#6687)
This implements the second part for
https://github.com/Chatterino/chatterino2/issues/5978 - read-only access
to the window layout.

This allows plugins to query the open channels and how they're
presented.

Reviewed-by: Mm2PL <mm2pl+gh@kotmisia.pl>
Reviewed-by: pajlada <rasmus.karlsson@pajlada.com>
2026-04-17 14:46:33 +00:00
NerixyzandGitHub cbf7893a8e feat(plugins): Add images and image sets (#6792)
You can query them and on sets, you can change the images. Note that
sets are value types, so getting an image set in Lua will always refer
to a copy, not a reference.

Images are special, because plugin authors can specify a URL that
Chatterino will load if the image is shown. While the plugin can't see
the response, it still causes Chatterino to issue a request, so
_creating_ images will require the network permission.

Tested-by: Mm2PL <mm2pl+gh@kotmisia.pl>
Tested-by: pajlada <rasmus.karlsson@pajlada.com>
Reviewed-by: Mm2PL <mm2pl+gh@kotmisia.pl>
Reviewed-by: pajlada <rasmus.karlsson@pajlada.com>
2026-04-04 23:37:40 +00:00
NerixyzandGitHub a869cd4bd1 feat(plugins): add display name change event to Channel (#6594)
Reviewed-by: Mm2PL <mm2pl+gh@kotmisia.pl>
2026-01-29 18:25:39 +01:00
pajladaandGitHub eaeeaf004d chore(reuse): annotate our source files with our license (#6719) 2026-01-07 00:45:57 +01:00
c67953d14f feat(plugins): minimal account API (#6554)
Co-authored-by: Mm2PL <mm2pl+gh@kotmisia.pl>
Reviewed-by: Mm2PL <mm2pl+gh@kotmisia.pl>
2025-12-05 14:56:51 +00:00
nerixandGitHub a4478748f7 feat(plugins): add basic message construction (#5754) 2025-07-31 15:36:39 +02:00
nerixandGitHub ab66be21b3 feat(plugins): add c2.WebSocket (#6076) 2025-04-07 17:38:10 +00:00
Mm2PLandGitHub ea02a42162 Fixed a potential way to escape the Lua Plugin sandbox (#5846) 2025-01-22 01:35:52 +00:00
352a4ec132 Move plugins to Sol (#5622)
Co-authored-by: Nerixyz <nerixdev@outlook.de>
Co-authored-by: Rasmus Karlsson <rasmus.karlsson@pajlada.com>
2024-10-20 11:57:05 +02:00
2547technoandGitHub 93fbcbbe5f fix plugin http types & docs (#5494) 2024-07-06 00:02:21 +00:00
Mm2PLandGitHub c980162656 Introduce HTTP API for plugins (#5383) 2024-06-22 10:04:30 +00:00
ec6b1ef24d fix(luals-meta): generate globals in c2 and echo @lua commands (#5385)
Co-authored-by: Mm2PL <miau@mail.kotmisia.pl>
2024-05-22 15:23:33 +02:00
nerixandGitHub c1bd5d11d0 refactor: improve LuaLS generator (#5283) 2024-03-30 22:11:52 +01:00
Mm2PLandGitHub d4b8feac7d lua: Change CompletionRequested handler to use an event table. (#5280) 2024-03-30 14:23:02 +00:00
pajladaandGitHub 3563ecb3a5 fix: Compile Lua as a C library (#5251) 2024-03-16 14:15:05 +00:00
Mm2PLandGitHub a737d4b755 Introduce c2.later() function to Lua API. (#5154) 2024-02-25 11:45:59 +00:00
Mm2PLandGitHub 4a4f62dc4a Make Lua CommandContext use a ChannelRef (#5184) 2024-02-18 19:55:00 +00:00
Mm2PLandGitHub 8e9aa87a08 Add a new Channel API for experimental plugins feature (#5141) 2024-02-03 19:12:00 +01:00
Mm2PLandGitHub 69a54d944d Autogenerate docs/plugin-meta.lua (#5055) 2023-12-30 10:26:19 +00:00
Mm2PLandGitHub 5f8c4c6b66 BREAKING: Replace custom import() with normal Lua require(). (#5014)
* Use require() instead of a custom import()

* Also search relative to the current file

* Update documentation
2023-12-16 12:16:54 +00:00
fd4cac2c2c Add a new completion API for experimental plugins feature. (#5000)
Co-authored-by: Rasmus Karlsson <rasmus.karlsson@pajlada.com>
2023-12-10 13:41:05 +00:00
5ba809804e Add basic lua scripting capabilities (#4341)
The scripting capabilities is locked behind a cmake flag, and is not enabled by default.

Co-authored-by: nerix <nerixdev@outlook.de>
Co-authored-by: pajlada <rasmus.karlsson@pajlada.com>
2023-04-02 15:31:53 +02:00