Commit Graph
10 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
0a10fa1c3e plugins: added cloning of message elements (#6909)
Co-authored-by: Nerixyz <nerixdev@outlook.de>
Reviewed-by: pajlada <rasmus.karlsson@pajlada.com>
2026-04-25 11:40:02 +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
pajladaandGitHub eaeeaf004d chore(reuse): annotate our source files with our license (#6719) 2026-01-07 00:45:57 +01:00
Rasmus Karlssonandpajlada 57d6583a2b refactor: add explicit this-> where possible
I have knowingly skipped some files/portions of files where this would
create merge conflicts for other open PRs.
2025-12-30 14:59:12 +01:00
nerixandGitHub 74b4674c6b feat(plugins): allow message introspection (#6353)
This allows users to introspect messages (i.e. look at the elements they're made up of).

Reviewed-by: Mm2PL <mm2pl+gh@kotmisia.pl>
2025-12-07 14:52:59 +00:00
nerixandGitHub 7214c49e79 fix: Get rid of warnings on clang-cl (#6528) 2025-10-25 14:14:20 +00:00
Mm2PLandGitHub 6e443cd767 Plugin links pt 2: Link::InsertText (#6527) 2025-10-25 13:30:49 +00:00
33f6383122 Add support for plugin links (#6386)
Co-authored-by: Nerixyz <nerixdev@outlook.de>
2025-10-02 18:56:51 +00:00
nerixandGitHub a4478748f7 feat(plugins): add basic message construction (#5754) 2025-07-31 15:36:39 +02:00