MCPcopy Create free account
hub / github.com/bttv-android/bttv / addOurEmotes

Method addOurEmotes

mod/app/src/main/java/bttv/Autocomplete.java:14–41  ·  view source on GitHub ↗
(List<EmoteSet> list)

Source from the content-addressed store, hash-verified

12public class Autocomplete {
13
14 public static void addOurEmotes(List<EmoteSet> list) {
15 for (EmoteSet set : list) {
16 if (set.getSetId().equals("bttv_emote_set_id")) {
17 return;
18 }
19 }
20 int channelId = Data.currentBroadcasterId;
21 if (list.isEmpty()) {
22 return;
23 }
24 ArrayList<String> codes = Emotes.getAllEmotes(channelId);
25 List<EmoteModel.Generic> generics = new ArrayList<>(codes.size());
26
27 for (String code : codes) {
28 Emote e = Emotes.getEmote(channelId, code);
29 if (e == null)
30 continue; // should not happen
31 generics.add(
32 new EmoteModel.Generic(
33 "BTTV-" + e.id,
34 e.code,
35 e.getAssetType(),
36 EmoteModelType.OTHER)
37 );
38 }
39 EmoteSet set = new EmoteSet.GenericEmoteSet("bttv_emote_set_id", generics);
40 list.add(set);
41 }
42}

Callers

nothing calls this directly

Calls 6

getSetIdMethod · 0.95
getAllEmotesMethod · 0.95
getEmoteMethod · 0.95
getAssetTypeMethod · 0.95
isEmptyMethod · 0.80
addMethod · 0.80

Tested by

no test coverage detected