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: add shared chat badge #5661

Merged
merged 20 commits into from
Oct 22, 2024

Conversation

iProdigy
Copy link
Contributor

@iProdigy iProdigy commented Oct 19, 2024

image

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

src/messages/MessageBuilder.cpp Outdated Show resolved Hide resolved
@iProdigy iProdigy marked this pull request as ready for review October 20, 2024 00:29
@iProdigy
Copy link
Contributor Author

technically we could reduce the number of helix requests made by using https://dev.twitch.tv/docs/api/reference/#get-shared-chat-session

e.g., if shared chat has 6 channels, the current approach could make up to 5 helix requests while the alternate approach would just do 1 - but not a big deal in the context of the full app lifetime

# Conflicts:
#	src/messages/MessageBuilder.cpp
#	src/messages/MessageBuilder.hpp
Copy link
Member

@pajlada pajlada left a comment

Choose a reason for hiding this comment

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

small nits, not tested yet - overall looks good. badge looks good

TODO for myself: test right-click actions on shared channel badges

src/messages/MessageBuilder.cpp Show resolved Hide resolved
src/messages/MessageBuilder.cpp Outdated Show resolved Hide resolved
src/providers/twitch/TwitchIrcServer.cpp Outdated Show resolved Hide resolved
Copy link
Member

@pajlada pajlada left a comment

Choose a reason for hiding this comment

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

Copying works as expected

I'm not fond of the badge being a mention element - I think I would prefer it to have no left-click action and instead a right-click action for some actions for the user (which I'm fine to leave out of this PR)

@8thony
Copy link
Contributor

8thony commented Oct 21, 2024

I got a crash with all settings set to default and then joined a channel with Shared Chat enabled.
Tested on a9b446f

Another option could be that instead of a badge, we put the channel profile picture in front of the message.

@pajlada
Copy link
Member

pajlada commented Oct 21, 2024

Another option could be that instead of a badge, we put the channel profile picture in front of the message.

I'd rather that be part of a follow-up PR as a "polish pass", which would let us discuss it first too

@iProdigy
Copy link
Contributor Author

@8thony could you share the channel name (& the other channels that were in the shared chat session & whether you were also connected to any of those channels)

also the stacktrace from the crash dump would be very helpful

@8thony
Copy link
Contributor

8thony commented Oct 21, 2024

The Shared Chat Session had 2 People and I opened only one channel from those.
c2 had no settings, no account, no cache files, nothing setup.
You can rename your %appdata%\chatterino2 folder to something else to test this.

Stack

Stack:

Qt6Core.dll!00007ffb7ac88ae0() Unknown
chatterino.exe!qHash(const QString & key, unsigned __int64 seed) Line 153 C++
[Inline Frame] chatterino.exe!std::hash::operator()(const QString &) Line 324 C++
[Inline Frame] chatterino.exe!std::_Uhash_compare<QString,std::hash,std::equal_to>::operator()(const QString &) Line 145 C++
[Inline Frame] chatterino.exe!std::_Hash<std::_Umap_traits<QString,std::_List_iterator<std::_List_val<std::_List_simple_types<std::pair<QString,QString>>>>,std::_Uhash_compare<QString,std::hash,std::equal_to>,std::allocator<std::pair<QString const ,std::_List_iterator<std::_List_val<std::_List_simple_types<std::pair<QString,QString>>>>>>,0>>::find(const QString &) Line 1230 C++
[Inline Frame] chatterino.exe!cache::lru_cache<QString,QString>::exists(const QString &) Line 102 C++
[Inline Frame] chatterino.exe!chatterino::TwitchIrcServer::getOrPopulateChannelCache::__l2::<lambda_2>::operator()() Line 1154 C++
[Inline Frame] chatterino.exe!std::invoke(chatterino::TwitchIrcServer::getOrPopulateChannelCache::__l2::<lambda_2> &) Line 1704 C++
chatterino.exe!std::_Func_impl_no_alloc<chatterino::TwitchIrcServer::getOrPopulateChannelCache'::2'::<lambda_2>,void>::_Do_call() Line 874 C++
[Inline Frame] chatterino.exe!std::_Func_class::operator()() Line 920 C++
[Inline Frame] chatterino.exe!chatterino::Helix::blockUser::__l2::<lambda_2>::operator()(chatterino::NetworkResult) Line 594 C++
[Inline Frame] chatterino.exe!std::invoke(chatterino::Helix::blockUser::__l2::<lambda_2> &) Line 1714 C++
chatterino.exe!std::_Func_impl_no_alloc<chatterino::Helix::blockUser'::2'::<lambda_2>,void,chatterino::NetworkResult>::_Do_call(chatterino::NetworkResult && <_Args_0>) Line 874 C++
> [Inline Frame] chatterino.exe!std::_Func_class<void,chatterino::NetworkResult>::operator()(chatterino::NetworkResult) Line 920 C++
chatterino.exe!chatterino::NetworkData::emitError::__l2::<lambda_1>::operator()() Line 162 C++
[Inline Frame] chatterino.exe!chatterino::postToThread::__l2::Event::{dtor}() Line 30 C++
chatterino.exe!chatterino::postToThread<chatterino::NetworkData::emitError'::2'::<lambda_1> &>'::2'::Event::`scalar deleting destructor'(unsigned int) C++
Qt6Core.dll!00007ffb7ad10dc2() Unknown
Qt6Gui.dll!00007ffb7b61e2df() Unknown
Qt6Core.dll!00007ffb7ae9d360() Unknown
Qt6Gui.dll!00007ffb7b61e259() Unknown
Qt6Core.dll!00007ffb7ad1552f() Unknown
Qt6Core.dll!00007ffb7ad0b17d() Unknown
chatterino.exe!chatterino::runGui(QApplication & a, const chatterino::Paths & paths, chatterino::Settings & settings, const chatterino::Args & args, chatterino::Updates & updates) Line 267 C++
chatterino.exe!main(int argc, char * * argv) Line 122 C++
chatterino.exe!qtEntryPoint() Line 50 C++
[Inline Frame] chatterino.exe!invoke_main() Line 102 C++
chatterino.exe!__scrt_common_main_seh() Line 288 C++
kernel32.dll!00007ffbadf87374() Unknown
ntdll.dll!00007ffbaf83cc91() Unknown

src/providers/twitch/TwitchIrcServer.hpp Outdated Show resolved Hide resolved
resources/twitch/sharedChat.png Outdated Show resolved Hide resolved
src/messages/MessageBuilder.cpp Outdated Show resolved Hide resolved
src/messages/MessageBuilder.cpp Outdated Show resolved Hide resolved
@iProdigy
Copy link
Contributor Author

@8thony could you confirm the crash is now fixed?

@iProdigy iProdigy requested a review from pajlada October 22, 2024 09:11
@8thony
Copy link
Contributor

8thony commented Oct 22, 2024

Yes, no crash anymore.

@pajlada pajlada merged commit 18c4815 into Chatterino:master Oct 22, 2024
18 checks passed
@iProdigy iProdigy deleted the feature/shared-chat-badge branch October 22, 2024 17:05
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.

4 participants