Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: improve automod blocked term messaging #5699

Draft
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

pajlada
Copy link
Member

@pajlada pajlada commented Nov 5, 2024

wip :)

@pajlada pajlada force-pushed the feat/improve-automod-blocked-term-messaging branch 2 times, most recently from 6a2979b to 12fa816 Compare November 6, 2024 16:00
Copy link
Contributor

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

clang-tidy made some suggestions

action.reason =
u"matches %1 blocked term%2"_s.arg(
numBlockedTermsMatched,
numBlockedTermsMatched > 1 ? 's'
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

warning: incompatible operand types ('char' and 'const char *') [clang-diagnostic-error]

                                            numBlockedTermsMatched > 1 ? 's'
                                                                       ^
Additional context

/usr/include/c++/13/type_traits:2557: in instantiation of function template specialization 'chatterino::TwitchIrcServer::initialize()::(anonymous class)::operator()chatterino::PubSubAutoModQueueMessage' requested here

      std::declval<_Fn>()(std::declval<_Args>()...)
      ^

/usr/include/c++/13/type_traits:2568: while substituting deduced template arguments into function template '_S_test' [with _Fn = (lambda at /github/workspace/src/providers/twitch/TwitchIrcServer.cpp:482:9) &, _Args = (no value)]

      typedef decltype(_S_test<_Functor, _ArgTypes...>(0)) type;
                       ^

/usr/include/c++/13/type_traits:2574: in instantiation of template class 'std::__result_of_impl<false, false, (lambda at /github/workspace/src/providers/twitch/TwitchIrcServer.cpp:482:9) &, chatterino::PubSubAutoModQueueMessage, QString>' requested here

    : public __result_of_impl<
             ^

/usr/include/c++/13/type_traits:2935: in instantiation of template class 'std::__invoke_result<(lambda at /github/workspace/src/providers/twitch/TwitchIrcServer.cpp:482:9) &, chatterino::PubSubAutoModQueueMessage, QString>' requested here

			       __void_t<typename _Result::type>>
                            ^

/usr/include/c++/13/bits/std_function.h:348: during template argument deduction for class template partial specialization '__is_invocable_impl<_Result, _Ret, true, __void_t>' [with _Result = std::__invoke_result<(lambda at /github/workspace/src/providers/twitch/TwitchIrcServer.cpp:482:9) &, chatterino::PubSubAutoModQueueMessage, QString>, _Ret = void]

	: __is_invocable_impl<_Res2, _Res>::type
   ^

/usr/include/c++/13/bits/std_function.h:348: (skipping 1 context in backtrace; use -ftemplate-backtrace-limit=0 to see all)

	: __is_invocable_impl<_Res2, _Res>::type
   ^

/usr/include/c++/13/bits/std_function.h:352: in instantiation of template class 'std::function<void (chatterino::PubSubAutoModQueueMessage, QString)>::_Callable<(lambda at /github/workspace/src/providers/twitch/TwitchIrcServer.cpp:482:9) &>' requested here

	using _Requires = __enable_if_t<_Cond::value, _Tp>;
                                 ^

/usr/include/c++/13/bits/std_function.h:433: in instantiation of template type alias '_Requires' requested here

	       typename _Constraints = _Requires<_Callable<_Functor>>>
                                ^

/usr/include/c++/13/bits/std_function.h:434: in instantiation of default argument for 'function<(lambda at /github/workspace/src/providers/twitch/TwitchIrcServer.cpp:482:9) &>' required here

	function(_Functor&& __f)
 ^

lib/signals/include/pajlada/signals/signalholder.hpp:48: while substituting deduced template arguments into function template 'function' [with _Functor = (lambda at /github/workspace/src/providers/twitch/TwitchIrcServer.cpp:482:9) &, _Constraints = (no value)]

        this->add(std::move(signal.connect(cb)));
                                           ^

src/providers/twitch/TwitchIrcServer.cpp:479: in instantiation of function template specialization 'pajlada::Signals::SignalHolder::managedConnect<pajlada::Signals::Signal<chatterino::PubSubAutoModQueueMessage, QString>, (lambda at /github/workspace/src/providers/twitch/TwitchIrcServer.cpp:482:9)>' requested here

    this->connections_.managedConnect(
                       ^

Copy link
Contributor

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

clang-tidy made some suggestions

action.reason =
u"matches %1 blocked term%2"_s.arg(
numBlockedTermsMatched,
numBlockedTermsMatched > 1 ? u"s"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

warning: incompatible operand types ('const char16_t *' and 'const char *') [clang-diagnostic-error]

                                            numBlockedTermsMatched > 1 ? u"s"
                                                                       ^
Additional context

/usr/include/c++/13/type_traits:2557: in instantiation of function template specialization 'chatterino::TwitchIrcServer::initialize()::(anonymous class)::operator()chatterino::PubSubAutoModQueueMessage' requested here

      std::declval<_Fn>()(std::declval<_Args>()...)
      ^

/usr/include/c++/13/type_traits:2568: while substituting deduced template arguments into function template '_S_test' [with _Fn = (lambda at /github/workspace/src/providers/twitch/TwitchIrcServer.cpp:481:9) &, _Args = (no value)]

      typedef decltype(_S_test<_Functor, _ArgTypes...>(0)) type;
                       ^

/usr/include/c++/13/type_traits:2574: in instantiation of template class 'std::__result_of_impl<false, false, (lambda at /github/workspace/src/providers/twitch/TwitchIrcServer.cpp:481:9) &, chatterino::PubSubAutoModQueueMessage, QString>' requested here

    : public __result_of_impl<
             ^

/usr/include/c++/13/type_traits:2935: in instantiation of template class 'std::__invoke_result<(lambda at /github/workspace/src/providers/twitch/TwitchIrcServer.cpp:481:9) &, chatterino::PubSubAutoModQueueMessage, QString>' requested here

			       __void_t<typename _Result::type>>
                            ^

/usr/include/c++/13/bits/std_function.h:348: during template argument deduction for class template partial specialization '__is_invocable_impl<_Result, _Ret, true, __void_t>' [with _Result = std::__invoke_result<(lambda at /github/workspace/src/providers/twitch/TwitchIrcServer.cpp:481:9) &, chatterino::PubSubAutoModQueueMessage, QString>, _Ret = void]

	: __is_invocable_impl<_Res2, _Res>::type
   ^

/usr/include/c++/13/bits/std_function.h:348: (skipping 1 context in backtrace; use -ftemplate-backtrace-limit=0 to see all)

	: __is_invocable_impl<_Res2, _Res>::type
   ^

/usr/include/c++/13/bits/std_function.h:352: in instantiation of template class 'std::function<void (chatterino::PubSubAutoModQueueMessage, QString)>::_Callable<(lambda at /github/workspace/src/providers/twitch/TwitchIrcServer.cpp:481:9) &>' requested here

	using _Requires = __enable_if_t<_Cond::value, _Tp>;
                                 ^

/usr/include/c++/13/bits/std_function.h:433: in instantiation of template type alias '_Requires' requested here

	       typename _Constraints = _Requires<_Callable<_Functor>>>
                                ^

/usr/include/c++/13/bits/std_function.h:434: in instantiation of default argument for 'function<(lambda at /github/workspace/src/providers/twitch/TwitchIrcServer.cpp:481:9) &>' required here

	function(_Functor&& __f)
 ^

lib/signals/include/pajlada/signals/signalholder.hpp:48: while substituting deduced template arguments into function template 'function' [with _Functor = (lambda at /github/workspace/src/providers/twitch/TwitchIrcServer.cpp:481:9) &, _Constraints = (no value)]

        this->add(std::move(signal.connect(cb)));
                                           ^

src/providers/twitch/TwitchIrcServer.cpp:478: in instantiation of function template specialization 'pajlada::Signals::SignalHolder::managedConnect<pajlada::Signals::Signal<chatterino::PubSubAutoModQueueMessage, QString>, (lambda at /github/workspace/src/providers/twitch/TwitchIrcServer.cpp:481:9)>' requested here

    this->connections_.managedConnect(
                       ^

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant