Skip to content

Commit 527a835

Browse files
authored
feat: don't award analytics data for messages not in l2 (#1686)
1 parent 49e586a commit 527a835

File tree

1 file changed

+5
-8
lines changed

1 file changed

+5
-8
lines changed

lib/pangea/events/models/representation_content_model.dart

+5-8
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,8 @@ class PangeaRepresentation {
103103
ChoreoRecord? choreo,
104104
}) {
105105
final List<OneConstructUse> uses = [];
106+
final l2 = MatrixState.pangeaController.languageController.activeL2Code();
107+
if (langCode != l2) return uses;
106108

107109
// missing vital info so return
108110
if (event?.roomId == null && metadata?.roomId == null) {
@@ -151,14 +153,9 @@ class PangeaRepresentation {
151153
final content = token.text.content;
152154

153155
if (choreo == null) {
154-
final bool inUserL2 = langCode ==
155-
MatrixState.pangeaController.languageController.activeL2Code();
156-
final useType =
157-
inUserL2 ? ConstructUseTypeEnum.wa : ConstructUseTypeEnum.unk;
158-
159156
uses.add(
160157
OneConstructUse(
161-
useType: useType,
158+
useType: ConstructUseTypeEnum.wa,
162159
lemma: token.pos,
163160
form: token.text.content,
164161
category: "POS",
@@ -170,7 +167,7 @@ class PangeaRepresentation {
170167
for (final entry in token.morph.entries) {
171168
uses.add(
172169
OneConstructUse(
173-
useType: useType,
170+
useType: ConstructUseTypeEnum.wa,
174171
lemma: entry.value,
175172
form: token.text.content,
176173
category: entry.key,
@@ -183,7 +180,7 @@ class PangeaRepresentation {
183180
if (lemma.saveVocab) {
184181
uses.add(
185182
token.toVocabUse(
186-
useType,
183+
ConstructUseTypeEnum.wa,
187184
metadata,
188185
),
189186
);

0 commit comments

Comments
 (0)