Chatterino / chatterino2

Chat client for https://twitch.tv
MIT License
2.02k stars 445 forks source link

feat: report duration for multi-month anon sub gifts #5293

Closed iProdigy closed 5 months ago

iProdigy commented 5 months ago

Similar to #2026 but for subgift (and these irc tags are actually documented)

Before Screenshot_20240401_163359

After image

Felanbird commented 5 months ago

can you put one of these in src/util/SampleData.cpp so it can be tested with the respective fake-sub-messages button (or the command)

iProdigy commented 5 months ago

actually the system message is good when the gift is not anonymous, will adjust my patch

@badge-info=subscriber/32;badges=subscriber/3030,sub-gift-leader/2;color=#FF8EA3;display-name=iNatsuFN;emotes=;flags=;id=0d0decbd-b8f4-4e83-9e18-eca9cab69153;login=inatsufn;mod=0;msg-id=subgift;msg-param-gift-months=6;msg-param-goal-contribution-type=SUBS;msg-param-goal-current-contributions=881;msg-param-goal-target-contributions=900;msg-param-goal-user-contributions=1;msg-param-months=16;msg-param-origin-id=2524053421157386961;msg-param-recipient-display-name=kimmi_tm;msg-param-recipient-id=225806893;msg-param-recipient-user-name=kimmi_tm;msg-param-sender-count=334;msg-param-sub-plan-name=Channel\sSubscription\s(mxddy);msg-param-sub-plan=1000;room-id=210915729;subscriber=1;system-msg=iNatsuFN\sgifted\s6\smonths\sof\sTier\s1\sto\skimmi_tm.\sThey've\sgifted\s334\smonths\sin\sthe\schannel!;tmi-sent-ts=1712034497332;user-id=218205938;user-type=;vip=0 :tmi.twitch.tv USERNOTICE #mxddy
iProdigy commented 4 months ago

actually the system message is good when the gift is not anonymous, will adjust my patch

hm, not quite; observed a broadcaster gift a 12 month sub and the system-msg didn't include the number of months. may be related to msg-param-sender-count=0 (twitch doesn't appear to count the total number of subs gifted by the broadcaster) so They've gifted X months in the channel can't be populated (see quoted example above) => could adjust patch again to workaround this (or we can ignore this edge case)

 

@user-id=broadcasterId;msg-param-origin-id=2862055070165643340;display-name=broadcasterLogin;id=eeb3cdb8-337c-413a-9521-3a884ff78754;msg-param-gift-months=12;msg-param-sub-plan=1000;vip=0;emotes=;badges=broadcaster/1,subscriber/3042,partner/1;msg-param-recipient-user-name=ogprodigy;msg-param-recipient-id=53888434;badge-info=subscriber/71;room-id=broadcasterId;msg-param-recipient-display-name=OGprodigy;msg-param-sub-plan-name=Silver\sPackage;subscriber=1;system-msg=broadcasterLogin\sgifted\sa\sTier\s1\ssub\sto\sOGprodigy!;login=broadcasterLogin;msg-param-sender-count=0;user-type=;mod=0;flags=;rm-received-ts=1712803947891;color=#EB078D;msg-param-months=15;tmi-sent-ts=1712803947773;msg-id=subgift :tmi.twitch.tv USERNOTICE #broadcasterLogin

(removed broadcaster info)