Fix 7TV zero-width emotes not working (#292)

Use flags to determine 7TV zero width emote
This commit is contained in:
Tommy Chow 2023-11-01 18:16:57 -04:00 • committed by GitHub
parent bc67aad670
commit 1cb04bed2d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 1 deletions

View file

@ -109,10 +109,12 @@ class EmoteFFZ {
class Emote7TV {
final String id;
final String name;
final int flags;
final Emote7TVData data;
const Emote7TV(
this.id,
this.flags,
this.name,
this.data,
);
@ -231,7 +233,7 @@ class Emote {
realName: emote.name != emote.data.name ? emote.data.name : null,
width: emote.data.host.files.first.width,
height: emote.data.host.files.first.height,
zeroWidth: emote.data.tags?.contains('zerowidth') ?? false,
zeroWidth: emote.flags == 1,
url: 'https:$url/${file.name}',
type: type,
);

View file

@ -53,6 +53,7 @@ EmoteFFZ _$EmoteFFZFromJson(Map<String, dynamic> json) => EmoteFFZ(
Emote7TV _$Emote7TVFromJson(Map<String, dynamic> json) => Emote7TV(
json['id'] as String,
json['flags'] as int,
json['name'] as String,
Emote7TVData.fromJson(json['data'] as Map<String, dynamic>),
);