<commit_before>hexchat.register('MyMessage', '2', 'Properly show your own messages in ZNC playback')

hexchat.hook_print('Capability List', function (args)
	if args[2]:find('znc.in/self%-message') then
		hexchat.command('CAP REQ znc.in/self-message')

		local ctx = hexchat.props.context<commit_msg>mymsg.lua: Fix cap request printing in wrong tab<commit_after>hexchat.register('MyMessage', '2', 'Properly show your own messages in ZNC playback')

local function get_server_ctx()
	local id = hexchat.prefs['id']
	for chan in hexchat.iterate('channels') do
		if chan.type == 1 and chan.id == id then
			return chan.context
		end
	end
	return hexchat.props.context
end

hexchat.hook_print('Capability List', function (args)
	if args[2]:find('znc.in/self%-message') then
		hexchat.command('CAP REQ znc.in/self-message')

		local ctx = get_server_ctx()
{'fraction_non_alphanumeric': 0.12971698113207547, 'fraction_numerical': 0.00589622641509434, 'mean_word_length': 5.242647058823529, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3345455', 'n_tokens_mistral': 302, 'n_tokens_neox': 281, 'n_words': 77}