From b951db774e3a3935ec1a345a9f0e0935d8eb4a0f Mon Sep 17 00:00:00 2001 From: megrogan Date: Tue, 16 Jul 2024 16:42:01 +0100 Subject: [PATCH 1/5] Handle new achievements on FE --- .../impl/src/updates/send_message.rs | 5 +- .../group/impl/src/updates/send_message.rs | 5 +- .../user/impl/src/updates/send_message.rs | 2 +- backend/libraries/types/src/achievement.rs | 10 +- .../home/profile/LearnToEarn.svelte | 30 +++++- frontend/app/src/i18n/cn.json | 55 ++++++++++- frontend/app/src/i18n/de.json | 55 ++++++++++- frontend/app/src/i18n/en.json | 55 ++++++++++- frontend/app/src/i18n/es.json | 55 ++++++++++- frontend/app/src/i18n/fr.json | 55 ++++++++++- frontend/app/src/i18n/hi.json | 55 ++++++++++- frontend/app/src/i18n/it.json | 55 ++++++++++- frontend/app/src/i18n/iw.json | 55 ++++++++++- frontend/app/src/i18n/jp.json | 55 ++++++++++- frontend/app/src/i18n/ru.json | 55 ++++++++++- frontend/app/src/i18n/uk.json | 55 ++++++++++- frontend/app/src/i18n/vi.json | 55 ++++++++++- .../src/services/common/chatMappers.ts | 9 ++ .../src/services/community/candid/idl.js | 28 ++++-- .../src/services/community/candid/types.d.ts | 8 ++ .../services/community/community.client.ts | 14 ++- .../src/services/group/candid/idl.js | 26 +++-- .../src/services/group/candid/types.d.ts | 6 ++ .../src/services/group/group.client.ts | 22 +++-- .../src/services/groupIndex/candid/idl.js | 25 +++-- .../src/services/groupIndex/candid/types.d.ts | 5 + .../src/services/localUserIndex/candid/idl.js | 26 +++-- .../services/localUserIndex/candid/types.d.ts | 5 + .../services/notifications/candid/types.d.ts | 5 + .../src/services/online/candid/types.d.ts | 5 + .../src/services/openchatAgent.ts | 51 +++++++--- .../src/services/proposalsBot/candid/idl.js | 27 +++++ .../services/proposalsBot/candid/types.d.ts | 21 ++++ .../src/services/registry/candid/types.d.ts | 5 + .../services/storageBucket/candid/types.d.ts | 5 + .../services/storageIndex/candid/types.d.ts | 5 + .../services/translations/candid/types.d.ts | 5 + .../src/services/user/candid/idl.js | 79 +++++++++++++-- .../src/services/user/candid/types.d.ts | 7 ++ .../src/services/user/mappers.ts | 2 +- .../src/services/user/user.client.ts | 4 +- .../src/services/userIndex/candid/idl.js | 17 ++++ .../src/services/userIndex/candid/types.d.ts | 14 +++ frontend/openchat-client/src/openchat.ts | 91 +++++++++++++++++ frontend/openchat-shared/src/domain/chit.ts | 99 ++++++++++--------- frontend/openchat-shared/src/domain/worker.ts | 6 +- frontend/openchat-worker/src/worker.ts | 4 + 47 files changed, 1179 insertions(+), 159 deletions(-) diff --git a/backend/canisters/community/impl/src/updates/send_message.rs b/backend/canisters/community/impl/src/updates/send_message.rs index 420af3bd8e..5e38e56a2d 100644 --- a/backend/canisters/community/impl/src/updates/send_message.rs +++ b/backend/canisters/community/impl/src/updates/send_message.rs @@ -240,7 +240,10 @@ fn process_send_message_result( ); if new_achievement { - state.notify_user_of_achievements(sender, Achievement::from_message(false, &result.message_event.event)); + state.notify_user_of_achievements( + sender, + Achievement::from_message(false, &result.message_event.event, thread_root_message_index.is_some()), + ); } Success(SuccessResult { diff --git a/backend/canisters/group/impl/src/updates/send_message.rs b/backend/canisters/group/impl/src/updates/send_message.rs index e38aa6dae2..511e89a0e9 100644 --- a/backend/canisters/group/impl/src/updates/send_message.rs +++ b/backend/canisters/group/impl/src/updates/send_message.rs @@ -171,7 +171,10 @@ fn process_send_message_result( handle_activity_notification(state); if new_achievement { - state.notify_user_of_achievements(sender, Achievement::from_message(false, &result.message_event.event)); + state.notify_user_of_achievements( + sender, + Achievement::from_message(false, &result.message_event.event, thread_root_message_index.is_some()), + ); } Success(SuccessResult { diff --git a/backend/canisters/user/impl/src/updates/send_message.rs b/backend/canisters/user/impl/src/updates/send_message.rs index 62b716a3c3..7d033dd762 100644 --- a/backend/canisters/user/impl/src/updates/send_message.rs +++ b/backend/canisters/user/impl/src/updates/send_message.rs @@ -291,7 +291,7 @@ fn send_message_impl( state .data - .award_achievements_and_notify(Achievement::from_message(true, &message_event.event), now) + .award_achievements_and_notify(Achievement::from_message(true, &message_event.event, false), now) } register_timer_jobs( diff --git a/backend/libraries/types/src/achievement.rs b/backend/libraries/types/src/achievement.rs index d0c4abe6a9..fe59796b4b 100644 --- a/backend/libraries/types/src/achievement.rs +++ b/backend/libraries/types/src/achievement.rs @@ -20,7 +20,6 @@ pub enum Achievement { Streak30, SentPoll, - VotedOnPoll, SentText, SentImage, SentVideo, @@ -29,10 +28,9 @@ pub enum Achievement { SentGiphy, SentPrize, SentMeme, - SentReminder, - StartedCall, SentCrypto, SentP2PSwapOffer, + StartedCall, ReactedToMessage, EditedMessage, RepliedInThread, @@ -41,6 +39,8 @@ pub enum Achievement { DeletedMessage, ForwardedMessage, + SentReminder, + VotedOnPoll, ReceivedCrypto, HadMessageReactedTo, HadMessageTipped, @@ -145,7 +145,7 @@ impl Achievement { } } - pub fn from_message(direct: bool, message: &Message) -> Vec { + pub fn from_message(direct: bool, message: &Message, is_thread: bool) -> Vec { let mut achievements = Vec::new(); if let Some(achievement) = message.content.to_achievement() { @@ -162,7 +162,7 @@ impl Achievement { if message.replies_to.is_some() { achievements.push(Achievement::QuoteReplied); - } else if message.thread_summary.is_some() && message.message_index == MessageIndex::from(0) { + } else if is_thread && message.message_index == MessageIndex::from(0) { achievements.push(Achievement::RepliedInThread); } diff --git a/frontend/app/src/components/home/profile/LearnToEarn.svelte b/frontend/app/src/components/home/profile/LearnToEarn.svelte index 1970ae7db2..9f15e05405 100644 --- a/frontend/app/src/components/home/profile/LearnToEarn.svelte +++ b/frontend/app/src/components/home/profile/LearnToEarn.svelte @@ -1,11 +1,12 @@ diff --git a/frontend/app/src/i18n/cn.json b/frontend/app/src/i18n/cn.json index 63f4216d86..7b80567a37 100644 --- a/frontend/app/src/i18n/cn.json +++ b/frontend/app/src/i18n/cn.json @@ -519,21 +519,72 @@ "joinGroupFailed": "无法加入{level}", "lastOnline": "上次在线 {duration} 前", "learnToEarn": { + "accepted_swap_offer": "接受了您的第一个掉期报价", + "appointed_as_group_admin": "被任命为第一个群组/频道的管理员", + "appointed_as_group_mod": "被任命为第一个群组/频道的版主", + "appointed_as_group_owner": "被任命为第一个群组/频道的所有者", + "appointed_group_admin": "任命了您的第一个群组/频道管理员", + "appointed_group_mod": "任命了您的第一位群组/频道管理员", + "appointed_group_owner": "指定了您的第一个群组/频道所有者", + "changed_theme": "第一次更换主题", + "deleted_message": "删除了第一条消息", + "direct_chat_5": "进行 5 次直接聊天", + "direct_chats_10": "进行 10 次直接聊天", + "direct_chats_20": "进行 20 次直接聊天", + "edited_message": "编辑第一条消息", + "enabled_disappearing_messages": "首次启用“消失的消息”", + "favourited_chat": "将你的第一次聊天标记为收藏", + "followed_thread": "第一次关注帖子", + "forwarded_message": "转发第一条消息", + "had_message_tipped": "你的第一条信息被泄露", + "joined_call": "加入了你的第一次通话", "joined_community": "加入你的第一个社区", + "joined_gated_group_or_community": "加入你的第一个封闭群组/频道", "joined_group": "加入了你的第一个群组", + "own_group_with_10_diamond_members": "拥有第一个群组/社区,其中有 10 名经过验证的成员", + "own_group_with_100_diamond_members": "拥有第一个拥有 100 名经过验证的成员的群组/社区", + "owned_group_with_1_diamond_member": "拥有第一个群组/社区,其中有 1 名经过验证的成员", + "owned_group_with_1000_diamond_members": "拥有第一个拥有 1000 名经过验证的成员的群组/社区", "percentageComplete": "{perc}% 完成", + "pinned_message": "已置顶您的第一条消息", + "proved_unique_personhood": "证明了你独特的人性", + "quote_replied": "引用对第一条消息的回复", + "reacted_to_message": "对第一条消息做出回应", + "received_crypto": "收到你的第一个加密消息", "received_direct_message": "收到你的第一条私信", + "received_reaction": "收到你对消息的第一反应", + "replied_in_thread": "开始在主题中回复第一条消息", + "sent_audio": "发送了你的第一条音频", + "sent_crypto": "发送了第一条加密消息", "sent_direct_message": "发送了第一条私信", + "sent_file": "发送了你的第一个文件", + "sent_giphy": "发送了你的第一个 giphy", + "sent_image": "发送了你的第一张图片", + "sent_meme": "发送了你的第一条 meme 消息", + "sent_poll": "发送了您的第一个投票", + "sent_prize": "已发送您的一等奖", + "sent_swap_offer": "发送第一个 P2P 交换要约", + "sent_text": "发送了第一条短信", + "sent_video": "发送了你的第一个视频", "set_avatar": "已上传您的个人资料头像", "set_bio": "更新了您的个人简介", + "set_community_access_gate": "设置您的第一个社区出入口", + "set_community_display_name": "设置您的第一个社区显示名称", "set_display_name": "已更新您的显示名称", + "set_group_access_gate": "设置第一个群组/通道访问门", "showChitPopup": "通知我我的成就", + "started_call": "开始第一次通话", "streak_14": "已连续 14 天", "streak_3": "已连续 3 天", "streak_30": "已连续 30 天", "streak_7": "已连续 7 天", + "suggested_translation": "建议你的第一个翻译", + "swapped_from_wallet": "从钱包中兑换了第一个代币", + "tipped_message": "已给小费的第一条消息", + "translation_accepted": "你的第一个翻译是否被接受", "upgrade_to_gold_diamond": "升级为终身钻石会员", - "upgraded_to_diamond": "升级为钻石会员" + "upgraded_to_diamond": "升级为钻石会员", + "voted_on_poll": "首次投票" }, "leave": "退出", "leaveGroup": "离开{level}", @@ -1110,8 +1161,8 @@ "send": "发送", "sendGif": "发送动图", "sendMessage": "发信息", - "sendTextDisabled": "短信已禁用", "sendMessageDisabledAnon": "请登录以发送消息", + "sendTextDisabled": "短信已禁用", "sendTo": "发给...", "sessionExpired": "登录状态已过期", "sessionExpiredBlurb": "请重新登录", diff --git a/frontend/app/src/i18n/de.json b/frontend/app/src/i18n/de.json index 00e57959fb..217f91de04 100644 --- a/frontend/app/src/i18n/de.json +++ b/frontend/app/src/i18n/de.json @@ -519,21 +519,72 @@ "joinGroupFailed": "Beitritt zu {level} nicht möglich", "lastOnline": "Zuletzt online vor {duration}", "learnToEarn": { + "accepted_swap_offer": "Ihr erstes Tauschangebot angenommen", + "appointed_as_group_admin": "Wurde zum Administrator Ihrer ersten Gruppe/Ihres ersten Kanals ernannt", + "appointed_as_group_mod": "Wurde zum Moderator Ihrer ersten Gruppe/Ihres ersten Kanals ernannt", + "appointed_as_group_owner": "Wurde zum Eigentümer Ihrer ersten Gruppe/Ihres ersten Kanals ernannt", + "appointed_group_admin": "Dein erster Gruppen-/Kanaladministrator wurde ernannt", + "appointed_group_mod": "Ernennung Ihres ersten Gruppen-/Kanalmoderators", + "appointed_group_owner": "Den ersten Gruppen-/Kanalbesitzer ernannt", + "changed_theme": "Zum ersten Mal das Thema ändern", + "deleted_message": "Erste Nachricht gelöscht", + "direct_chat_5": "Führen Sie 5 direkte Chats", + "direct_chats_10": "Führen Sie 10 direkte Chats", + "direct_chats_20": "Führen Sie 20 direkte Chats", + "edited_message": "Erste Nachricht bearbeitet", + "enabled_disappearing_messages": "Zum ersten Mal verschwindende Nachrichten aktivieren", + "favourited_chat": "Den ersten Chat als Favorit markiert", + "followed_thread": "Das erste Mal, dass ich einem Thread folge", + "forwarded_message": "Erste Nachricht weitergeleitet", + "had_message_tipped": "Ihre erste Nachricht wurde getippt", + "joined_call": "Bei Ihrem ersten Anruf dabei", "joined_community": "Ihrer ersten Community beigetreten", + "joined_gated_group_or_community": "Ihrer ersten geschlossenen Gruppe/Ihrem ersten geschlossenen Kanal beigetreten", "joined_group": "Ihrer ersten Gruppe beigetreten", + "own_group_with_10_diamond_members": "Besitzen Sie Ihre erste Gruppe/Community mit 10 verifizierten Mitgliedern.", + "own_group_with_100_diamond_members": "Besitzen Sie Ihre erste Gruppe/Community mit 100 verifizierten Mitgliedern.", + "owned_group_with_1_diamond_member": "Besitzen Sie Ihre erste Gruppe/Community mit 1 verifiziertem Mitglied.", + "owned_group_with_1000_diamond_members": "Besitzen Sie Ihre erste Gruppe/Community mit 1000 verifizierten Mitgliedern.", "percentageComplete": "{perc} % abgeschlossen", + "pinned_message": "Deine erste Nachricht angepinnt", + "proved_unique_personhood": "Deine einzigartige Menschlichkeit unter Beweis gestellt", + "quote_replied": "Zitat: Antwort auf erste Nachricht", + "reacted_to_message": "Auf die erste Nachricht reagiert", + "received_crypto": "Ihre erste Kryptonachricht erhalten", "received_direct_message": "Deine erste Direktnachricht erhalten", + "received_reaction": "Ihre erste Reaktion auf eine Nachricht erhalten", + "replied_in_thread": "Habe mit der ersten Antwort im Thread begonnen", + "sent_audio": "Sende dein erstes Audio", + "sent_crypto": "Ihre erste Kryptonachricht gesendet", "sent_direct_message": "Deine erste Direktnachricht gesendet", + "sent_file": "Ihre erste Datei gesendet", + "sent_giphy": "Dein erstes Giphy gesendet", + "sent_image": "Ihr erstes Bild gesendet", + "sent_meme": "Deine erste Meme-Nachricht gesendet", + "sent_poll": "Senden Sie Ihre erste Umfrage", + "sent_prize": "Versendet Ihren ersten Preis", + "sent_swap_offer": "Erstes P2P-Tauschangebot gesendet", + "sent_text": "Deine erste Textnachricht gesendet", + "sent_video": "Dein erstes Video gesendet", "set_avatar": "Dein Profil-Avatar wurde hochgeladen", "set_bio": "Ihre Profilbiografie wurde aktualisiert", + "set_community_access_gate": "Richten Sie Ihr erstes Gemeinschaftszugangstor ein", + "set_community_display_name": "Legen Sie Ihren ersten Community-Anzeigenamen fest", "set_display_name": "Deinen Anzeigenamen hast du aktualisiert", + "set_group_access_gate": "Richten Sie Ihr erstes Gruppen-/Kanalzugriffstor ein", "showChitPopup": "Benachrichtigen Sie mich über meine Erfolge", + "started_call": "Ersten Anruf gestartet", "streak_14": "Eine 14-tägige Erfolgsserie erreicht", "streak_3": "3 Tage lang erfolgreich gewesen", "streak_30": "30 Tage lang erfolgreich gewesen", "streak_7": "Eine 7-Tage-Serie erreicht", + "suggested_translation": "Ihre erste Übersetzung wurde vorgeschlagen", + "swapped_from_wallet": "Dein erstes Token aus der Wallet getauscht", + "tipped_message": "Erste Nachricht mit Trinkgeld", + "translation_accepted": "Ihre erste Übersetzung wurde akzeptiert", "upgrade_to_gold_diamond": "Upgrade auf Lifetime Diamond-Mitgliedschaft", - "upgraded_to_diamond": "Upgrade auf Diamond-Mitgliedschaft" + "upgraded_to_diamond": "Upgrade auf Diamond-Mitgliedschaft", + "voted_on_poll": "Bei Ihrer ersten Umfrage abgestimmt" }, "leave": "Verlassen", "leaveGroup": "Verlasse {level}", @@ -1110,8 +1161,8 @@ "send": "Senden", "sendGif": "GIFs senden", "sendMessage": "Nachricht senden", - "sendTextDisabled": "Textnachrichten sind deaktiviert", "sendMessageDisabledAnon": "Bitte melden Sie sich an, um eine Nachricht zu senden", + "sendTextDisabled": "Textnachrichten sind deaktiviert", "sendTo": "Senden an...", "sessionExpired": "Sitzung abgelaufen", "sessionExpiredBlurb": "Bitte neu anmelden", diff --git a/frontend/app/src/i18n/en.json b/frontend/app/src/i18n/en.json index 222f582647..1b5b3963df 100644 --- a/frontend/app/src/i18n/en.json +++ b/frontend/app/src/i18n/en.json @@ -519,21 +519,72 @@ "joinGroupFailed": "Unable to join {level}", "lastOnline": "Last online {duration} ago", "learnToEarn": { + "accepted_swap_offer": "Accepted your first swap offer", + "appointed_as_group_admin": "Been appointed an administrator of your first group/channel", + "appointed_as_group_mod": "Been appointed a moderator of your first group/channel", + "appointed_as_group_owner": "Been appointed an owner of your first group/channel", + "appointed_group_admin": "Appointed your first group/channel administrator", + "appointed_group_mod": "Appointed your first group/channel moderator", + "appointed_group_owner": "Appointed your first group/channel owner", + "changed_theme": "First time changing the theme", + "deleted_message": "Deleted first message", + "direct_chat_5": "Have 5 direct chats", + "direct_chats_10": "Have 10 direct chats", + "direct_chats_20": "Have 20 direct chats", + "edited_message": "Edited first message", + "enabled_disappearing_messages": "First time enabling disappearing messages", + "favourited_chat": "Marked your first chat as a favourite", + "followed_thread": "First time following a thread", + "forwarded_message": "Forwarded first message", + "had_message_tipped": "Had your first message tipped", + "joined_call": "Joined your first call", "joined_community": "Joined your first community", + "joined_gated_group_or_community": "Joined your first gated group/channel", "joined_group": "Joined your first group", + "own_group_with_10_diamond_members": "Owned your first group/community with 10 verified members", + "own_group_with_100_diamond_members": "Owned your first group/community with 100 verified members", + "owned_group_with_1_diamond_member": "Owned your first group/community with 1 verified member", + "owned_group_with_1000_diamond_members": "Owned your first group/community with 1000 verified members", "percentageComplete": "{perc}% Complete", + "pinned_message": "Pinned your first message", + "proved_unique_personhood": "Proved your unique humanity", + "quote_replied": "Quote replied to first message", + "reacted_to_message": "Reacted to first message", + "received_crypto": "Received your first crypto message", "received_direct_message": "Received your first direct message", + "received_reaction": "Received your first reaction on a message", + "replied_in_thread": "Started first reply in thread", + "sent_audio": "Sent your first audio", + "sent_crypto": "Sent your first crypto message", "sent_direct_message": "Sent your first direct message", + "sent_file": "Sent your first file", + "sent_giphy": "Sent your first giphy", + "sent_image": "Sent your first image", + "sent_meme": "Sent your first meme message", + "sent_poll": "Sent your first poll", + "sent_prize": "Sent your first prize", + "sent_swap_offer": "Sent first P2P swap offer", + "sent_text": "Sent your first text message", + "sent_video": "Sent your first video", "set_avatar": "Uploaded your profile avatar", "set_bio": "Updated your profile bio", + "set_community_access_gate": "Set your first community access gate", + "set_community_display_name": "Set your first community display name", "set_display_name": "Updated your display name", + "set_group_access_gate": "Set your first group/channel access gate", "showChitPopup": "Notify me of my achievements", + "started_call": "Started first call", "streak_14": "Achieved a 14 day streak", "streak_3": "Achieved a 3 day streak", "streak_30": "Achieved a 30 day streak", "streak_7": "Achieved a 7 day streak", + "suggested_translation": "Suggested your fiurst translation", + "swapped_from_wallet": "Swapped your first token from the wallet", + "tipped_message": "Tipped first message", + "translation_accepted": "Had your first translation accepted", "upgrade_to_gold_diamond": "Upgrade to Lifetime Diamond membership", - "upgraded_to_diamond": "Upgraded to Diamond membership" + "upgraded_to_diamond": "Upgraded to Diamond membership", + "voted_on_poll": "Voted on your first poll" }, "leave": "Leave", "leaveGroup": "Leave {level}", @@ -1110,8 +1161,8 @@ "send": "Send", "sendGif": "Send gif", "sendMessage": "Send message", - "sendTextDisabled": "Text messages are disabled", "sendMessageDisabledAnon": "Please sign-in to send a message", + "sendTextDisabled": "Text messages are disabled", "sendTo": "Send to...", "sessionExpired": "Session Expired", "sessionExpiredBlurb": "Please sign in again", diff --git a/frontend/app/src/i18n/es.json b/frontend/app/src/i18n/es.json index 818af23d1e..54a873dab5 100644 --- a/frontend/app/src/i18n/es.json +++ b/frontend/app/src/i18n/es.json @@ -519,21 +519,72 @@ "joinGroupFailed": "No se puede unir a {level}", "lastOnline": "Ultima conexión hace {duration}", "learnToEarn": { + "accepted_swap_offer": "Aceptó su primera oferta de intercambio", + "appointed_as_group_admin": "Ha sido nombrado administrador de su primer grupo/canal.", + "appointed_as_group_mod": "Ha sido nombrado moderador de su primer grupo/canal.", + "appointed_as_group_owner": "Has sido designado propietario de tu primer grupo/canal.", + "appointed_group_admin": "Nombró a su primer administrador de grupo/canal", + "appointed_group_mod": "Nombró a su primer moderador de grupo/canal", + "appointed_group_owner": "Nombraste a tu primer propietario de grupo/canal", + "changed_theme": "Primera vez cambiando el tema.", + "deleted_message": "Primer mensaje eliminado", + "direct_chat_5": "Tener 5 chats directos", + "direct_chats_10": "Tener 10 chats directos", + "direct_chats_20": "Tener 20 chats directos", + "edited_message": "Primer mensaje editado.", + "enabled_disappearing_messages": "Primera vez que se habilitan los mensajes que desaparecen", + "favourited_chat": "Marcó su primer chat como favorito", + "followed_thread": "Primera vez que sigo un hilo.", + "forwarded_message": "Primer mensaje reenviado", + "had_message_tipped": "¿Tuviste propina en tu primer mensaje?", + "joined_call": "Se unió a su primera llamada", "joined_community": "Se unió a su primera comunidad", + "joined_gated_group_or_community": "Se unió a su primer grupo/canal privado", "joined_group": "Se unió a su primer grupo", + "own_group_with_10_diamond_members": "Fue propietario de su primer grupo/comunidad con 10 miembros verificados", + "own_group_with_100_diamond_members": "Sea propietario de su primer grupo/comunidad con 100 miembros verificados", + "owned_group_with_1_diamond_member": "Era propietario de su primer grupo/comunidad con 1 miembro verificado", + "owned_group_with_1000_diamond_members": "Fue propietario de su primer grupo/comunidad con 1000 miembros verificados", "percentageComplete": "{perc}% completado", + "pinned_message": "Fijó su primer mensaje", + "proved_unique_personhood": "Demostró su humanidad única", + "quote_replied": "Cita respondida al primer mensaje.", + "reacted_to_message": "Reaccionó al primer mensaje", + "received_crypto": "Recibiste tu primer mensaje criptográfico", "received_direct_message": "Recibí tu primer mensaje directo", + "received_reaction": "Recibí tu primera reacción en un mensaje.", + "replied_in_thread": "Comenzó la primera respuesta en el hilo.", + "sent_audio": "Envió su primer audio", + "sent_crypto": "Envió su primer mensaje criptográfico", "sent_direct_message": "Envió su primer mensaje directo", + "sent_file": "Envió su primer archivo", + "sent_giphy": "Enviaste tu primer giphy", + "sent_image": "Enviaste tu primera imagen", + "sent_meme": "Envió su primer mensaje meme", + "sent_poll": "Envió su primera encuesta", + "sent_prize": "Enviaste tu primer premio", + "sent_swap_offer": "Primera oferta de intercambio P2P enviada", + "sent_text": "Envió su primer mensaje de texto", + "sent_video": "Envió tu primer vídeo", "set_avatar": "Subiste tu avatar de perfil", "set_bio": "Actualiza la biografía de tu perfil.", + "set_community_access_gate": "Configure su primera puerta de acceso a la comunidad", + "set_community_display_name": "Establece el primer nombre para mostrar de tu comunidad", "set_display_name": "Actualizó su nombre para mostrar", + "set_group_access_gate": "Configura tu primera puerta de acceso a grupo/canal", "showChitPopup": "Notificarme de mis logros", + "started_call": "Comenzó la primera llamada", "streak_14": "Logró una racha de 14 días", "streak_3": "Logró una racha de 3 días", "streak_30": "Logró una racha de 30 días", "streak_7": "Logró una racha de 7 días", + "suggested_translation": "Sugirió su primera traducción.", + "swapped_from_wallet": "Cambiaste tu primer token de la billetera", + "tipped_message": "Primer mensaje con propina", + "translation_accepted": "¿Han aceptado su primera traducción?", "upgrade_to_gold_diamond": "Actualice a una membresía Lifetime Diamond", - "upgraded_to_diamond": "Actualizado a membresía Diamante" + "upgraded_to_diamond": "Actualizado a membresía Diamante", + "voted_on_poll": "Votó en su primera encuesta" }, "leave": "Salir", "leaveGroup": "Dejar {level}", @@ -1110,8 +1161,8 @@ "send": "Enviar", "sendGif": "Enviar gif", "sendMessage": "Enviar mensaje", - "sendTextDisabled": "Los mensajes de texto están deshabilitados", "sendMessageDisabledAnon": "Por favor inicia sesión para enviar un mensaje", + "sendTextDisabled": "Los mensajes de texto están deshabilitados", "sendTo": "Enviar a...", "sessionExpired": "La sesión ha expirado", "sessionExpiredBlurb": "Inicia sesión de nuevo", diff --git a/frontend/app/src/i18n/fr.json b/frontend/app/src/i18n/fr.json index 6be71789f5..ae7c999628 100644 --- a/frontend/app/src/i18n/fr.json +++ b/frontend/app/src/i18n/fr.json @@ -519,21 +519,72 @@ "joinGroupFailed": "Impossible de rejoindre {level}", "lastOnline": "Dernière connexion il y a {duration}", "learnToEarn": { + "accepted_swap_offer": "Accepté votre première offre d'échange", + "appointed_as_group_admin": "Vous avez été nommé administrateur de votre premier groupe/chaîne", + "appointed_as_group_mod": "Vous avez été nommé modérateur de votre premier groupe/chaîne", + "appointed_as_group_owner": "Vous avez été nommé propriétaire de votre premier groupe/chaîne", + "appointed_group_admin": "Vous avez nommé votre premier administrateur de groupe/canal", + "appointed_group_mod": "Vous avez nommé votre premier modérateur de groupe/chaîne", + "appointed_group_owner": "Vous avez nommé votre premier propriétaire de groupe/chaîne", + "changed_theme": "C'est la première fois que je change de thème", + "deleted_message": "Premier message supprimé", + "direct_chat_5": "Avoir 5 discussions directes", + "direct_chats_10": "Avoir 10 discussions directes", + "direct_chats_20": "Avoir 20 discussions directes", + "edited_message": "Premier message modifié", + "enabled_disappearing_messages": "Activation pour la première fois des messages qui disparaissent", + "favourited_chat": "Vous avez marqué votre première discussion comme favorite", + "followed_thread": "Première fois que je suis un fil", + "forwarded_message": "Premier message transféré", + "had_message_tipped": "Votre premier message a été prévenu", + "joined_call": "A rejoint votre premier appel", "joined_community": "Vous avez rejoint votre première communauté", + "joined_gated_group_or_community": "Vous avez rejoint votre premier groupe/canal fermé", "joined_group": "Vous avez rejoint votre premier groupe", + "own_group_with_10_diamond_members": "Posséder votre premier groupe/communauté avec 10 membres vérifiés", + "own_group_with_100_diamond_members": "Posséder votre premier groupe/communauté avec 100 membres vérifiés", + "owned_group_with_1_diamond_member": "Posséder votre premier groupe/communauté avec 1 membre vérifié", + "owned_group_with_1000_diamond_members": "Posséder votre premier groupe/communauté avec 1 000 membres vérifiés", "percentageComplete": "{perc} % terminé", + "pinned_message": "J'ai épinglé ton premier message", + "proved_unique_personhood": "Vous avez prouvé votre humanité unique", + "quote_replied": "Citation a répondu au premier message", + "reacted_to_message": "J'ai réagi au premier message", + "received_crypto": "Vous avez reçu votre premier message cryptographique", "received_direct_message": "Reçu votre premier message direct", + "received_reaction": "Reçu votre première réaction sur un message", + "replied_in_thread": "J'ai commencé à répondre dans le fil de discussion", + "sent_audio": "Envoyé votre premier audio", + "sent_crypto": "Envoyé votre premier message cryptographique", "sent_direct_message": "Vous avez envoyé votre premier message direct", + "sent_file": "Envoyé votre premier fichier", + "sent_giphy": "Envoyé votre premier giphy", + "sent_image": "Envoyé votre première image", + "sent_meme": "J'ai envoyé ton premier message mème", + "sent_poll": "Envoyé votre premier sondage", + "sent_prize": "Envoyé votre premier prix", + "sent_swap_offer": "Première offre d'échange P2P envoyée", + "sent_text": "Vous avez envoyé votre premier SMS", + "sent_video": "Envoyé votre première vidéo", "set_avatar": "Vous avez téléchargé votre avatar de profil", "set_bio": "Vous avez mis à jour la biographie de votre profil", + "set_community_access_gate": "Définissez votre première porte d'accès communautaire", + "set_community_display_name": "Définissez votre premier nom d'affichage de communauté", "set_display_name": "Vous avez mis à jour votre nom d'affichage", + "set_group_access_gate": "Définissez votre première porte d'accès à un groupe/canal", "showChitPopup": "M'informer de mes réalisations", + "started_call": "Premier appel lancé", "streak_14": "A réalisé une séquence de 14 jours", "streak_3": "A réalisé une séquence de 3 jours", "streak_30": "A réalisé une séquence de 30 jours", "streak_7": "A réalisé une séquence de 7 jours", + "suggested_translation": "Vous avez suggéré votre première traduction", + "swapped_from_wallet": "Vous avez échangé votre premier jeton du portefeuille", + "tipped_message": "Premier message averti", + "translation_accepted": "Votre première traduction a-t-elle été acceptée", "upgrade_to_gold_diamond": "Passer à l'adhésion Diamond à vie", - "upgraded_to_diamond": "Surclassé en abonnement Diamant" + "upgraded_to_diamond": "Surclassé en abonnement Diamant", + "voted_on_poll": "A voté lors de votre premier sondage" }, "leave": "Laisser", "leaveGroup": "Quitter {level}", @@ -1110,8 +1161,8 @@ "send": "Envoyer", "sendGif": "Envoyer un GIF", "sendMessage": "Envoyer le message", - "sendTextDisabled": "Les messages texte sont désactivés", "sendMessageDisabledAnon": "Veuillez vous connecter pour envoyer un message", + "sendTextDisabled": "Les messages texte sont désactivés", "sendTo": "Envoyer à...", "sessionExpired": "La session a expiré", "sessionExpiredBlurb": "Veuillez vous reconnecter", diff --git a/frontend/app/src/i18n/hi.json b/frontend/app/src/i18n/hi.json index f2389ad0da..96877bdbde 100644 --- a/frontend/app/src/i18n/hi.json +++ b/frontend/app/src/i18n/hi.json @@ -519,21 +519,72 @@ "joinGroupFailed": "{level} से जुड़ने में असमर्थ", "lastOnline": "अंतिम बार ऑनलाइन {duration} पहले", "learnToEarn": { + "accepted_swap_offer": "आपका पहला स्वैप प्रस्ताव स्वीकार कर लिया गया", + "appointed_as_group_admin": "आपको अपने पहले समूह/चैनल का प्रशासक नियुक्त किया गया है", + "appointed_as_group_mod": "आपको अपने पहले समूह/चैनल का मॉडरेटर नियुक्त किया गया है", + "appointed_as_group_owner": "अपने पहले समूह/चैनल का स्वामी नियुक्त किया गया", + "appointed_group_admin": "अपना पहला समूह/चैनल व्यवस्थापक नियुक्त किया", + "appointed_group_mod": "अपना पहला समूह/चैनल मॉडरेटर नियुक्त किया", + "appointed_group_owner": "अपना पहला समूह/चैनल स्वामी नियुक्त किया", + "changed_theme": "पहली बार थीम बदली गई", + "deleted_message": "पहला संदेश हटा दिया गया", + "direct_chat_5": "5 प्रत्यक्ष चैट करें", + "direct_chats_10": "10 प्रत्यक्ष चैट करें", + "direct_chats_20": "20 प्रत्यक्ष चैट करें", + "edited_message": "पहला संदेश संपादित किया गया", + "enabled_disappearing_messages": "पहली बार गायब होने वाले संदेशों को सक्षम करना", + "favourited_chat": "आपकी पहली चैट को पसंदीदा के रूप में चिह्नित किया गया", + "followed_thread": "पहली बार किसी धागे का अनुसरण कर रहा हूँ", + "forwarded_message": "पहला संदेश अग्रेषित किया गया", + "had_message_tipped": "क्या आपका पहला संदेश टिप किया गया था?", + "joined_call": "आपकी पहली कॉल में शामिल हुए", "joined_community": "अपने पहले समुदाय में शामिल हुए", + "joined_gated_group_or_community": "अपने पहले गेटेड ग्रुप/चैनल में शामिल हुए", "joined_group": "अपने पहले समूह में शामिल हो गए", + "own_group_with_10_diamond_members": "10 सत्यापित सदस्यों के साथ अपना पहला समूह/समुदाय बनाएं", + "own_group_with_100_diamond_members": "100 सत्यापित सदस्यों के साथ अपना पहला समूह/समुदाय बनाएं", + "owned_group_with_1_diamond_member": "1 सत्यापित सदस्य के साथ अपना पहला समूह/समुदाय बनाएं", + "owned_group_with_1000_diamond_members": "1000 सत्यापित सदस्यों के साथ अपना पहला समूह/समुदाय बनाएं", "percentageComplete": "{perc}% पूर्ण", + "pinned_message": "अपना पहला संदेश पिन किया", + "proved_unique_personhood": "अपनी अद्वितीय मानवता साबित की", + "quote_replied": "उद्धरण ने पहले संदेश का उत्तर दिया", + "reacted_to_message": "पहले संदेश पर प्रतिक्रिया", + "received_crypto": "अपना पहला क्रिप्टो संदेश प्राप्त किया", "received_direct_message": "आपका पहला प्रत्यक्ष संदेश प्राप्त हुआ", + "received_reaction": "संदेश पर आपकी पहली प्रतिक्रिया प्राप्त हुई", + "replied_in_thread": "थ्रेड में पहला उत्तर शुरू किया गया", + "sent_audio": "अपना पहला ऑडियो भेजा", + "sent_crypto": "अपना पहला क्रिप्टो संदेश भेजा", "sent_direct_message": "अपना पहला प्रत्यक्ष संदेश भेजा", + "sent_file": "आपकी पहली फ़ाइल भेजी गई", + "sent_giphy": "अपना पहला giphy भेजा", + "sent_image": "आपकी पहली छवि भेजी गई", + "sent_meme": "अपना पहला मीम संदेश भेजा", + "sent_poll": "अपना पहला पोल भेजा", + "sent_prize": "अपना प्रथम पुरस्कार भेजा", + "sent_swap_offer": "पहला P2P स्वैप प्रस्ताव भेजा गया", + "sent_text": "अपना पहला टेक्स्ट संदेश भेजा", + "sent_video": "अपना पहला वीडियो भेजा", "set_avatar": "आपका प्रोफ़ाइल अवतार अपलोड किया गया", "set_bio": "अपना प्रोफ़ाइल बायो अपडेट किया", + "set_community_access_gate": "अपना पहला सामुदायिक प्रवेश द्वार निर्धारित करें", + "set_community_display_name": "अपना पहला समुदाय प्रदर्शन नाम सेट करें", "set_display_name": "आपका प्रदर्शन नाम अपडेट किया गया", + "set_group_access_gate": "अपना पहला समूह/चैनल एक्सेस गेट सेट करें", "showChitPopup": "मुझे मेरी उपलब्धियों के बारे में सूचित करें", + "started_call": "पहली कॉल शुरू की", "streak_14": "14 दिन का सिलसिला हासिल किया", "streak_3": "3 दिन की लकीर हासिल की", "streak_30": "30 दिन का सिलसिला हासिल किया", "streak_7": "7 दिन का सिलसिला हासिल किया", + "suggested_translation": "आपका पहला अनुवाद सुझाया गया", + "swapped_from_wallet": "वॉलेट से अपना पहला टोकन स्वैप किया", + "tipped_message": "पहला संदेश टिप किया गया", + "translation_accepted": "क्या आपका पहला अनुवाद स्वीकार किया गया था?", "upgrade_to_gold_diamond": "लाइफटाइम डायमंड सदस्यता में अपग्रेड करें", - "upgraded_to_diamond": "डायमंड सदस्यता में अपग्रेड किया गया" + "upgraded_to_diamond": "डायमंड सदस्यता में अपग्रेड किया गया", + "voted_on_poll": "आपके पहले मतदान पर वोट दिया गया" }, "leave": "छुट्टी", "leaveGroup": "{level} छोड़ें", @@ -1110,8 +1161,8 @@ "send": "भेजना", "sendGif": "जीआईएफ भेजें", "sendMessage": "मेसेज भेजें", - "sendTextDisabled": "पाठ संदेश अक्षम हैं", "sendMessageDisabledAnon": "एक संदेश भेजने के लिए साइन इन करें", + "sendTextDisabled": "पाठ संदेश अक्षम हैं", "sendTo": "भेजना...", "sessionExpired": "सत्र समाप्त हुआ", "sessionExpiredBlurb": "कृपया पुनः साइन इन करें", diff --git a/frontend/app/src/i18n/it.json b/frontend/app/src/i18n/it.json index 3316f02144..7f2f4a7f8a 100644 --- a/frontend/app/src/i18n/it.json +++ b/frontend/app/src/i18n/it.json @@ -519,21 +519,72 @@ "joinGroupFailed": "Impossibile partecipare a {level}", "lastOnline": "Ultimo online {duration} fa", "learnToEarn": { + "accepted_swap_offer": "Accettato la tua prima offerta di scambio", + "appointed_as_group_admin": "Sei stato nominato amministratore del tuo primo gruppo/canale", + "appointed_as_group_mod": "Sei stato nominato moderatore del tuo primo gruppo/canale", + "appointed_as_group_owner": "Sei stato nominato proprietario del tuo primo gruppo/canale", + "appointed_group_admin": "Nominato il tuo primo amministratore di gruppo/canale", + "appointed_group_mod": "Nominato il tuo primo moderatore del gruppo/canale", + "appointed_group_owner": "Nominato il primo proprietario del gruppo/canale", + "changed_theme": "La prima volta che cambio tema", + "deleted_message": "Primo messaggio eliminato", + "direct_chat_5": "Avere 5 chat dirette", + "direct_chats_10": "Avere 10 chat dirette", + "direct_chats_20": "Avere 20 chat dirette", + "edited_message": "Primo messaggio modificato", + "enabled_disappearing_messages": "Abilitazione dei messaggi a scomparsa per la prima volta", + "favourited_chat": "Contrassegnata la tua prima chat come preferita", + "followed_thread": "La prima volta che seguo un thread", + "forwarded_message": "Primo messaggio inoltrato", + "had_message_tipped": "Il tuo primo messaggio aveva ricevuto una soffiata", + "joined_call": "Partecipa alla tua prima chiamata", "joined_community": "Ti sei unito alla tua prima community", + "joined_gated_group_or_community": "Ti sei unito al tuo primo gruppo/canale delimitato", "joined_group": "Ti sei unito al tuo primo gruppo", + "own_group_with_10_diamond_members": "Hai posseduto il tuo primo gruppo/community con 10 membri verificati", + "own_group_with_100_diamond_members": "Hai posseduto il tuo primo gruppo/community con 100 membri verificati", + "owned_group_with_1_diamond_member": "Hai posseduto il tuo primo gruppo/community con 1 membro verificato", + "owned_group_with_1000_diamond_members": "Hai posseduto il tuo primo gruppo/community con 1000 membri verificati", "percentageComplete": "{perc}% completato", + "pinned_message": "Appuntato il tuo primo messaggio", + "proved_unique_personhood": "Hai dimostrato la tua umanità unica", + "quote_replied": "La citazione ha risposto al primo messaggio", + "reacted_to_message": "Reagito al primo messaggio", + "received_crypto": "Hai ricevuto il tuo primo messaggio crittografico", "received_direct_message": "Hai ricevuto il tuo primo messaggio diretto", + "received_reaction": "Hai ricevuto la tua prima reazione a un messaggio", + "replied_in_thread": "Iniziata la prima risposta nel thread", + "sent_audio": "Hai inviato il tuo primo audio", + "sent_crypto": "Hai inviato il tuo primo messaggio crittografico", "sent_direct_message": "Hai inviato il tuo primo messaggio diretto", + "sent_file": "Hai inviato il tuo primo file", + "sent_giphy": "Hai inviato il tuo primo giphy", + "sent_image": "Hai inviato la tua prima immagine", + "sent_meme": "Hai inviato il tuo primo messaggio meme", + "sent_poll": "Inviato il tuo primo sondaggio", + "sent_prize": "Inviato il tuo primo premio", + "sent_swap_offer": "Inviata la prima offerta di scambio P2P", + "sent_text": "Inviato il tuo primo messaggio di testo", + "sent_video": "Hai inviato il tuo primo video", "set_avatar": "Caricato l'avatar del tuo profilo", "set_bio": "Aggiornata la biografia del tuo profilo", + "set_community_access_gate": "Imposta il tuo primo cancello di accesso alla community", + "set_community_display_name": "Imposta il primo nome visualizzato della community", "set_display_name": "Aggiornato il tuo nome visualizzato", + "set_group_access_gate": "Imposta il tuo primo cancello di accesso al gruppo/canale", "showChitPopup": "Avvisami dei miei risultati", + "started_call": "Iniziata la prima chiamata", "streak_14": "Hai ottenuto una serie di 14 giorni consecutivi", "streak_3": "Hai ottenuto una serie di 3 giorni consecutivi", "streak_30": "Raggiunto un periodo di 30 giorni consecutivi", "streak_7": "Raggiunto un record di 7 giorni consecutivi", + "suggested_translation": "Suggerita la tua prima traduzione", + "swapped_from_wallet": "Hai scambiato il tuo primo token dal portafoglio", + "tipped_message": "Primo messaggio con mancia", + "translation_accepted": "La tua prima traduzione è stata accettata", "upgrade_to_gold_diamond": "Passa all'abbonamento Lifetime Diamond", - "upgraded_to_diamond": "Upgrade all'abbonamento Diamond" + "upgraded_to_diamond": "Upgrade all'abbonamento Diamond", + "voted_on_poll": "Votato al tuo primo sondaggio" }, "leave": "Abbandona", "leaveGroup": "Lascia {level}", @@ -1110,8 +1161,8 @@ "send": "Inviare", "sendGif": "Invia gif", "sendMessage": "Invia messaggio", - "sendTextDisabled": "I messaggi di testo sono disabilitati", "sendMessageDisabledAnon": "Accedi per inviare un messaggio", + "sendTextDisabled": "I messaggi di testo sono disabilitati", "sendTo": "Inviare a...", "sessionExpired": "Sessione scaduta", "sessionExpiredBlurb": "Accedi di nuovo", diff --git a/frontend/app/src/i18n/iw.json b/frontend/app/src/i18n/iw.json index beb5cc080c..f4793e9603 100644 --- a/frontend/app/src/i18n/iw.json +++ b/frontend/app/src/i18n/iw.json @@ -519,21 +519,72 @@ "joinGroupFailed": "לא ניתן להצטרף ל-{level}", "lastOnline": "מחובר לאחרונה לפני {duration}", "learnToEarn": { + "accepted_swap_offer": "קיבל את הצעת ההחלפה הראשונה שלך", + "appointed_as_group_admin": "מונה למנהל של הקבוצה/ערוץ הראשון שלך", + "appointed_as_group_mod": "מונה למנחה של הקבוצה/ערוץ הראשון שלך", + "appointed_as_group_owner": "מונה לבעלים של הקבוצה/ערוץ הראשון שלך", + "appointed_group_admin": "מינה את מנהל הקבוצה/ערוץ הראשון שלך", + "appointed_group_mod": "מינה את מנחה הקבוצה/ערוץ הראשון שלך", + "appointed_group_owner": "מינה את הקבוצה/ערוץ הראשון שלך", + "changed_theme": "פעם ראשונה לשנות את הנושא", + "deleted_message": "ההודעה הראשונה נמחקה", + "direct_chat_5": "ערכו 5 שיחות ישירות", + "direct_chats_10": "ערכו 10 צ'אטים ישירים", + "direct_chats_20": "יש 20 צ'אטים ישירים", + "edited_message": "ערכת הודעה ראשונה", + "enabled_disappearing_messages": "פעם ראשונה שמאפשרת הודעות נעלמות", + "favourited_chat": "סימן את הצ'אט הראשון שלך כמועדף", + "followed_thread": "פעם ראשונה עוקב אחר שרשור", + "forwarded_message": "הועברה הודעה ראשונה", + "had_message_tipped": "ההודעה הראשונה שלך קיבלה טיפ", + "joined_call": "הצטרף לשיחה הראשונה שלך", "joined_community": "הצטרף לקהילה הראשונה שלך", + "joined_gated_group_or_community": "הצטרף לקבוצה/ערוץ הסגור הראשון שלך", "joined_group": "הצטרף לקבוצה הראשונה שלך", + "own_group_with_10_diamond_members": "הבעלים של הקבוצה/הקהילה הראשונה שלך עם 10 חברים מאומתים", + "own_group_with_100_diamond_members": "הבעלים של הקבוצה/הקהילה הראשונה שלך עם 100 חברים מאומתים", + "owned_group_with_1_diamond_member": "הבעלים של הקבוצה/הקהילה הראשונה שלך עם חבר מאומת אחד", + "owned_group_with_1000_diamond_members": "הבעלים של הקבוצה/הקהילה הראשונה שלך עם 1000 חברים מאומתים", "percentageComplete": "{perc}% הושלם", + "pinned_message": "הצמד את ההודעה הראשונה שלך", + "proved_unique_personhood": "הוכיח את האנושיות הייחודית שלך", + "quote_replied": "ציטוט השיב להודעה הראשונה", + "reacted_to_message": "הגיב להודעה הראשונה", + "received_crypto": "קיבלת את הודעת ההצפנה הראשונה שלך", "received_direct_message": "קיבלת את ההודעה הישירה הראשונה שלך", + "received_reaction": "קיבלתי את התגובה הראשונה שלך על הודעה", + "replied_in_thread": "התחילה תגובה ראשונה בשרשור", + "sent_audio": "שלח את האודיו הראשון שלך", + "sent_crypto": "שלח את הודעת ההצפנה הראשונה שלך", "sent_direct_message": "שלח את ההודעה הישירה הראשונה שלך", + "sent_file": "שלח את הקובץ הראשון שלך", + "sent_giphy": "שלח את הגיפי הראשון שלך", + "sent_image": "שלח את התמונה הראשונה שלך", + "sent_meme": "שלחת את הודעת המם הראשונה שלך", + "sent_poll": "שלח את הסקר הראשון שלך", + "sent_prize": "שלח את הפרס הראשון שלך", + "sent_swap_offer": "נשלחה הצעת חילופי P2P ראשונה", + "sent_text": "שלח את הודעת הטקסט הראשונה שלך", + "sent_video": "שלח את הסרטון הראשון שלך", "set_avatar": "העלה את הדמות שלך בפרופיל", "set_bio": "עדכן את הביוגרפיה של הפרופיל שלך", + "set_community_access_gate": "הגדר את שער הגישה הראשון שלך לקהילה", + "set_community_display_name": "הגדר את שם התצוגה הראשון שלך בקהילה", "set_display_name": "עדכן את שם התצוגה שלך", + "set_group_access_gate": "הגדר את שער הגישה לקבוצה/ערוץ הראשון שלך", "showChitPopup": "הודע לי על ההישגים שלי", + "started_call": "התחילה שיחה ראשונה", "streak_14": "השיג רצף של 14 ימים", "streak_3": "השיג רצף של 3 ימים", "streak_30": "השיג רצף של 30 יום", "streak_7": "השיג רצף של 7 ימים", + "suggested_translation": "הציע את התרגום הראשון שלך", + "swapped_from_wallet": "החלפת את האסימון הראשון שלך מהארנק", + "tipped_message": "הודעה ראשונה עם טיפ", + "translation_accepted": "התרגום הראשון שלך התקבל", "upgrade_to_gold_diamond": "שדרג לחברות Lifetime Diamond", - "upgraded_to_diamond": "שודרג לחברות Diamond" + "upgraded_to_diamond": "שודרג לחברות Diamond", + "voted_on_poll": "הצבעת בסקר הראשון שלך" }, "leave": "לעזוב", "leaveGroup": "עזוב את {level}", @@ -1110,8 +1161,8 @@ "send": "לִשְׁלוֹחַ", "sendGif": "שלח GIF", "sendMessage": "לשלוח הודעה", - "sendTextDisabled": "הודעות טקסט מושבתות", "sendMessageDisabledAnon": "אנא היכנס כדי לשלוח הודעה", + "sendTextDisabled": "הודעות טקסט מושבתות", "sendTo": "לשלוח ל...", "sessionExpired": "פג תוקף ההפעלה", "sessionExpiredBlurb": "נא להיכנס שוב", diff --git a/frontend/app/src/i18n/jp.json b/frontend/app/src/i18n/jp.json index 2a1be8a0cd..48ddf84da4 100644 --- a/frontend/app/src/i18n/jp.json +++ b/frontend/app/src/i18n/jp.json @@ -519,21 +519,72 @@ "joinGroupFailed": "{level}に参加できません", "lastOnline": "最終オンライン{duration}前", "learnToEarn": { + "accepted_swap_offer": "最初のスワップオファーを承諾しました", + "appointed_as_group_admin": "最初のグループ/チャンネルの管理者に任命されました", + "appointed_as_group_mod": "最初のグループ/チャンネルのモデレーターに任命されました", + "appointed_as_group_owner": "最初のグループ/チャンネルのオーナーに任命されました", + "appointed_group_admin": "最初のグループ/チャンネル管理者を任命しました", + "appointed_group_mod": "最初のグループ/チャンネルモデレーターを任命しました", + "appointed_group_owner": "最初のグループ/チャンネルのオーナーを任命しました", + "changed_theme": "初めてテーマを変更しました", + "deleted_message": "最初のメッセージを削除しました", + "direct_chat_5": "5回の直接チャット", + "direct_chats_10": "直接チャットを10回行う", + "direct_chats_20": "直接チャットを20回行う", + "edited_message": "最初のメッセージを編集しました", + "enabled_disappearing_messages": "消えるメッセージを初めて有効にする", + "favourited_chat": "最初のチャットをお気に入りとしてマークしました", + "followed_thread": "初めてスレッドをフォローする", + "forwarded_message": "最初のメッセージを転送しました", + "had_message_tipped": "最初のメッセージにチップを贈った", + "joined_call": "最初の通話に参加しました", "joined_community": "最初のコミュニティに参加しました", + "joined_gated_group_or_community": "最初のゲートグループ/チャンネルに参加しました", "joined_group": "最初のグループに参加しました", + "own_group_with_10_diamond_members": "10 人の認証済みメンバーを持つ最初のグループ/コミュニティを所有しました", + "own_group_with_100_diamond_members": "100人の認証済みメンバーを持つ最初のグループ/コミュニティを所有しました", + "owned_group_with_1_diamond_member": "認証済みメンバー 1 名を含む最初のグループ/コミュニティを所有しました", + "owned_group_with_1000_diamond_members": "1000人の認証済みメンバーを持つ最初のグループ/コミュニティを所有しました", "percentageComplete": "{perc}% 完了", + "pinned_message": "最初のメッセージをピン留めしました", + "proved_unique_personhood": "あなたのユニークな人間性を証明しました", + "quote_replied": "最初のメッセージに返信した引用", + "reacted_to_message": "最初のメッセージに反応した", + "received_crypto": "最初の暗号メッセージを受信しました", "received_direct_message": "最初のダイレクトメッセージを受信しました", + "received_reaction": "メッセージに対する最初の反応を受け取りました", + "replied_in_thread": "スレッドの最初の返信を開始しました", + "sent_audio": "最初の音声を送信しました", + "sent_crypto": "最初の暗号メッセージを送信しました", "sent_direct_message": "最初のダイレクトメッセージを送信しました", + "sent_file": "最初のファイルを送信しました", + "sent_giphy": "最初のGiphyを送信しました", + "sent_image": "最初の画像を送信しました", + "sent_meme": "最初のミームメッセージを送信しました", + "sent_poll": "最初のアンケートを送信しました", + "sent_prize": "最初の賞品を発送しました", + "sent_swap_offer": "最初のP2Pスワップオファーを送信しました", + "sent_text": "最初のテキストメッセージを送信しました", + "sent_video": "最初のビデオを送信しました", "set_avatar": "プロフィールアバターをアップロードしました", "set_bio": "プロフィールを更新しました", + "set_community_access_gate": "最初のコミュニティアクセスゲートを設定する", + "set_community_display_name": "最初のコミュニティ表示名を設定する", "set_display_name": "表示名を更新しました", + "set_group_access_gate": "最初のグループ/チャンネルアクセスゲートを設定する", "showChitPopup": "私の成果を通知する", + "started_call": "最初の通話を開始しました", "streak_14": "14日間連続記録を達成", "streak_3": "3日連続達成", "streak_30": "30日間連続達成", "streak_7": "7日間連続達成", + "suggested_translation": "最初の翻訳を提案しました", + "swapped_from_wallet": "ウォレットから最初のトークンを交換しました", + "tipped_message": "最初のメッセージにチップを渡す", + "translation_accepted": "最初の翻訳が受け入れられた", "upgrade_to_gold_diamond": "生涯ダイヤモンド会員にアップグレード", - "upgraded_to_diamond": "ダイヤモンド会員にアップグレード" + "upgraded_to_diamond": "ダイヤモンド会員にアップグレード", + "voted_on_poll": "最初のアンケートに投票しました" }, "leave": "退出", "leaveGroup": "{level}を離れる", @@ -1110,8 +1161,8 @@ "send": "送信", "sendGif": "gifを送信", "sendMessage": "メッセージを送る", - "sendTextDisabled": "テキストメッセージが無効になっています", "sendMessageDisabledAnon": "メッセージを送信するにはサインインしてください", + "sendTextDisabled": "テキストメッセージが無効になっています", "sendTo": "に送る...", "sessionExpired": "セッションは終了しました", "sessionExpiredBlurb": "再度サインインしてください", diff --git a/frontend/app/src/i18n/ru.json b/frontend/app/src/i18n/ru.json index 0e782b92d3..b3ae87b08c 100644 --- a/frontend/app/src/i18n/ru.json +++ b/frontend/app/src/i18n/ru.json @@ -519,21 +519,72 @@ "joinGroupFailed": "Не удалось присоединиться к {level}", "lastOnline": "Последний раз был онлайн {duration} назад", "learnToEarn": { + "accepted_swap_offer": "Принял ваше первое предложение обмена", + "appointed_as_group_admin": "Назначен администратором вашей первой группы/канала.", + "appointed_as_group_mod": "Назначен модератором вашей первой группы/канала.", + "appointed_as_group_owner": "Вы назначены владельцем вашей первой группы/канала.", + "appointed_group_admin": "Назначен вашим первым администратором группы/канала.", + "appointed_group_mod": "Назначен первым модератором группы/канала.", + "appointed_group_owner": "Назначен первым владельцем группы/канала.", + "changed_theme": "Впервые меняю тему", + "deleted_message": "Удалил первое сообщение", + "direct_chat_5": "Иметь 5 прямых чатов", + "direct_chats_10": "Иметь 10 прямых чатов", + "direct_chats_20": "Иметь 20 прямых чатов", + "edited_message": "Отредактировал первое сообщение", + "enabled_disappearing_messages": "Впервые включаю исчезающие сообщения", + "favourited_chat": "Отметил ваш первый чат как избранный", + "followed_thread": "Впервые слежу за темой", + "forwarded_message": "Переслано первое сообщение", + "had_message_tipped": "Если бы ваше первое сообщение было подсказано", + "joined_call": "Присоединился к вашему первому звонку", "joined_community": "Присоединился к вашему первому сообществу", + "joined_gated_group_or_community": "Присоединился к вашей первой закрытой группе/каналу", "joined_group": "Присоединился к вашей первой группе", + "own_group_with_10_diamond_members": "Владелец вашей первой группы/сообщества с 10 проверенными участниками.", + "own_group_with_100_diamond_members": "Владелец вашей первой группы/сообщества со 100 проверенными участниками.", + "owned_group_with_1_diamond_member": "Вы являетесь владельцем первой группы/сообщества с 1 проверенным участником.", + "owned_group_with_1000_diamond_members": "Владелец вашей первой группы/сообщества с 1000 проверенными участниками.", "percentageComplete": "{perc} % выполнено", + "pinned_message": "Закрепил ваше первое сообщение", + "proved_unique_personhood": "Доказал свою уникальную человечность", + "quote_replied": "Цитата ответ на первое сообщение", + "reacted_to_message": "Отреагировал на первое сообщение", + "received_crypto": "Получил ваше первое крипто-сообщение", "received_direct_message": "Получил ваше первое сообщение в Директе", + "received_reaction": "Получена ваша первая реакция на сообщение", + "replied_in_thread": "Начал первый ответ в теме", + "sent_audio": "Отправил первое аудио", + "sent_crypto": "Отправил свое первое крипто-сообщение", "sent_direct_message": "Отправил первое сообщение в Директ", + "sent_file": "Отправил первый файл", + "sent_giphy": "Отправил первую гифку", + "sent_image": "Отправил первое изображение", + "sent_meme": "Отправил первое мем-сообщение", + "sent_poll": "Отправил свой первый опрос", + "sent_prize": "Отправил свой первый приз", + "sent_swap_offer": "Отправлено первое предложение обмена P2P", + "sent_text": "Отправил первое текстовое сообщение", + "sent_video": "Отправил первое видео", "set_avatar": "Загрузил аватарку своего профиля", "set_bio": "Обновлена биография вашего профиля", + "set_community_access_gate": "Установите свои первые ворота общественного доступа", + "set_community_display_name": "Установите свое первое отображаемое имя в сообществе", "set_display_name": "Ваше отображаемое имя обновлено.", + "set_group_access_gate": "Установите свой первый шлюз доступа к группе/каналу", "showChitPopup": "Сообщите мне о моих достижениях", + "started_call": "Начал первый звонок", "streak_14": "Достигнута 14-дневная серия", "streak_3": "Достигнута 3-дневная серия", "streak_30": "Достигнута 30-дневная серия", "streak_7": "Достигнута 7-дневная серия", + "suggested_translation": "Предложил ваш первый перевод", + "swapped_from_wallet": "Выменил свой первый токен из кошелька", + "tipped_message": "Отправлено первое сообщение", + "translation_accepted": "Был ли принят ваш первый перевод", "upgrade_to_gold_diamond": "Повысьте статус до статуса Lifetime Diamond", - "upgraded_to_diamond": "Повышен до уровня Diamond" + "upgraded_to_diamond": "Повышен до уровня Diamond", + "voted_on_poll": "Проголосовал в первом опросе" }, "leave": "Выйти", "leaveGroup": "Покинуть {level}", @@ -1110,8 +1161,8 @@ "send": "Отправлять", "sendGif": "Отправить гифку", "sendMessage": "Отправить сообщение", - "sendTextDisabled": "Текстовые сообщения отключены", "sendMessageDisabledAnon": "Пожалуйста авторизируйтесь, чтобы отправить сообщение", + "sendTextDisabled": "Текстовые сообщения отключены", "sendTo": "Отправить...", "sessionExpired": "Сессия истекла", "sessionExpiredBlurb": "Пожалуйста, войдите еще раз", diff --git a/frontend/app/src/i18n/uk.json b/frontend/app/src/i18n/uk.json index 4e9a5d61f0..1737ca35e5 100644 --- a/frontend/app/src/i18n/uk.json +++ b/frontend/app/src/i18n/uk.json @@ -519,21 +519,72 @@ "joinGroupFailed": "Неможливо приєднатися до {level}", "lastOnline": "Востаннє онлайн {duration} тому", "learnToEarn": { + "accepted_swap_offer": "Прийняв вашу першу пропозицію про обмін", + "appointed_as_group_admin": "Був призначений адміністратором вашої першої групи/каналу", + "appointed_as_group_mod": "Призначений модератором вашої першої групи/каналу", + "appointed_as_group_owner": "Вас призначили власником вашої першої групи/каналу", + "appointed_group_admin": "Ви призначили свого першого адміністратора групи/каналу", + "appointed_group_mod": "Ви призначили свого першого модератора групи/каналу", + "appointed_group_owner": "Ви призначили свого першого власника групи/каналу", + "changed_theme": "Перша зміна теми", + "deleted_message": "Видалено перше повідомлення", + "direct_chat_5": "Проведіть 5 прямих чатів", + "direct_chats_10": "Проведіть 10 прямих чатів", + "direct_chats_20": "Майте 20 прямих чатів", + "edited_message": "Відредагував перше повідомлення", + "enabled_disappearing_messages": "Перший раз увімкнення зникаючих повідомлень", + "favourited_chat": "Позначив свій перший чат як улюблений", + "followed_thread": "Перший раз слідкую за темою", + "forwarded_message": "Переслано перше повідомлення", + "had_message_tipped": "Отримав підказку про ваше перше повідомлення", + "joined_call": "Приєднався до вашого першого виклику", "joined_community": "Приєднався до вашої першої спільноти", + "joined_gated_group_or_community": "Приєднався до вашої першої закритої групи/каналу", "joined_group": "Приєднався до вашої першої групи", + "own_group_with_10_diamond_members": "Був власником вашої першої групи/спільноти з 10 підтвердженими учасниками", + "own_group_with_100_diamond_members": "Був власником вашої першої групи/спільноти зі 100 підтвердженими учасниками", + "owned_group_with_1_diamond_member": "Був власником вашої першої групи/спільноти з 1 підтвердженим учасником", + "owned_group_with_1000_diamond_members": "Був власником вашої першої групи/спільноти з 1000 перевірених учасників", "percentageComplete": "{perc}% виконано", + "pinned_message": "Закріпив ваше перше повідомлення", + "proved_unique_personhood": "Довела свою унікальну людяність", + "quote_replied": "Цитата відповіла на перше повідомлення", + "reacted_to_message": "Відреагував на перше повідомлення", + "received_crypto": "Отримано ваше перше криптографічне повідомлення", "received_direct_message": "Отримано ваше перше пряме повідомлення", + "received_reaction": "Отримав вашу першу реакцію на повідомлення", + "replied_in_thread": "Почав першу відповідь у ланцюжку", + "sent_audio": "Надіслав ваше перше аудіо", + "sent_crypto": "Надіслав ваше перше криптографічне повідомлення", "sent_direct_message": "Надіслав ваше перше пряме повідомлення", + "sent_file": "Надіслав свій перший файл", + "sent_giphy": "Надіслав свій перший гіф", + "sent_image": "Надіслав своє перше зображення", + "sent_meme": "Надіслав своє перше мем-повідомлення", + "sent_poll": "Надіслав своє перше опитування", + "sent_prize": "Надіслав свій перший приз", + "sent_swap_offer": "Надіслано першу пропозицію обміну P2P", + "sent_text": "Надіслав своє перше текстове повідомлення", + "sent_video": "Надіслав своє перше відео", "set_avatar": "Завантажив аватар вашого профілю", "set_bio": "Оновлено біографію вашого профілю", + "set_community_access_gate": "Встановіть свої перші ворота доступу до спільноти", + "set_community_display_name": "Встановіть своє перше відображуване ім’я спільноти", "set_display_name": "Оновлено відображуване ім’я", + "set_group_access_gate": "Встановіть перший шлюз доступу до групи/каналу", "showChitPopup": "Повідомляйте мене про мої досягнення", + "started_call": "Розпочав перший дзвінок", "streak_14": "Досягнуто 14-денної поспіль", "streak_3": "Досягнуто 3-денної поспіль", "streak_30": "Досягнуто 30-денної поспіль", "streak_7": "Досягнуто 7-денної серії", + "suggested_translation": "Запропонував свій перший переклад", + "swapped_from_wallet": "Обміняв свій перший жетон із гаманця", + "tipped_message": "Підказане перше повідомлення", + "translation_accepted": "Ваш перший переклад прийнято", "upgrade_to_gold_diamond": "Оновлення до довічного діамантового членства", - "upgraded_to_diamond": "Оновлено до Діамантового членства" + "upgraded_to_diamond": "Оновлено до Діамантового членства", + "voted_on_poll": "Проголосував у вашому першому опитуванні" }, "leave": "Залишати", "leaveGroup": "Залишити {level}", @@ -1110,8 +1161,8 @@ "send": "Надіслати", "sendGif": "Надіслати gif", "sendMessage": "Відправити повідомлення", - "sendTextDisabled": "Текстові повідомлення вимкнено", "sendMessageDisabledAnon": "Будь ласка, увійдіть, щоб надіслати повідомлення", + "sendTextDisabled": "Текстові повідомлення вимкнено", "sendTo": "Відправити...", "sessionExpired": "Сеанс закінчився", "sessionExpiredBlurb": "Увійдіть знову", diff --git a/frontend/app/src/i18n/vi.json b/frontend/app/src/i18n/vi.json index d9b9821ff3..949f44a887 100644 --- a/frontend/app/src/i18n/vi.json +++ b/frontend/app/src/i18n/vi.json @@ -519,21 +519,72 @@ "joinGroupFailed": "Không thể tham gia {level}", "lastOnline": "Online cách đây {duration}", "learnToEarn": { + "accepted_swap_offer": "Đã chấp nhận đề nghị hoán đổi đầu tiên của bạn", + "appointed_as_group_admin": "Được bổ nhiệm làm quản trị viên của nhóm/kênh đầu tiên của bạn", + "appointed_as_group_mod": "Được bổ nhiệm làm người điều hành nhóm/kênh đầu tiên của bạn", + "appointed_as_group_owner": "Được chỉ định làm chủ sở hữu nhóm/kênh đầu tiên của bạn", + "appointed_group_admin": "Đã bổ nhiệm quản trị viên nhóm/kênh đầu tiên của bạn", + "appointed_group_mod": "Đã chỉ định người điều hành nhóm/kênh đầu tiên của bạn", + "appointed_group_owner": "Đã chỉ định chủ sở hữu nhóm/kênh đầu tiên của bạn", + "changed_theme": "Lần đầu đổi chủ đề", + "deleted_message": "Đã xóa tin nhắn đầu tiên", + "direct_chat_5": "Có 5 cuộc trò chuyện trực tiếp", + "direct_chats_10": "Có 10 cuộc trò chuyện trực tiếp", + "direct_chats_20": "Có 20 cuộc trò chuyện trực tiếp", + "edited_message": "Đã chỉnh sửa tin nhắn đầu tiên", + "enabled_disappearing_messages": "Lần đầu tiên kích hoạt tin nhắn biến mất", + "favourited_chat": "Đã đánh dấu cuộc trò chuyện đầu tiên của bạn là cuộc trò chuyện yêu thích", + "followed_thread": "Lần đầu tiên theo dõi một chủ đề", + "forwarded_message": "Đã chuyển tiếp tin nhắn đầu tiên", + "had_message_tipped": "Tin nhắn đầu tiên của bạn đã được tip", + "joined_call": "Đã tham gia cuộc gọi đầu tiên của bạn", "joined_community": "Đã tham gia cộng đồng đầu tiên của bạn", + "joined_gated_group_or_community": "Đã tham gia nhóm/kênh kiểm soát đầu tiên của bạn", "joined_group": "Đã tham gia nhóm đầu tiên của bạn", + "own_group_with_10_diamond_members": "Sở hữu nhóm/cộng đồng đầu tiên của bạn với 10 thành viên đã được xác minh", + "own_group_with_100_diamond_members": "Sở hữu nhóm/cộng đồng đầu tiên của bạn với 100 thành viên đã được xác minh", + "owned_group_with_1_diamond_member": "Sở hữu nhóm/cộng đồng đầu tiên của bạn với 1 thành viên đã được xác minh", + "owned_group_with_1000_diamond_members": "Sở hữu nhóm/cộng đồng đầu tiên của bạn với 1000 thành viên đã được xác minh", "percentageComplete": "Đã hoàn thành {perc}%", + "pinned_message": "Đã ghim tin nhắn đầu tiên của bạn", + "proved_unique_personhood": "Đã chứng minh tính nhân văn độc đáo của bạn", + "quote_replied": "Trích dẫn đã trả lời tin nhắn đầu tiên", + "reacted_to_message": "Đã phản hồi tin nhắn đầu tiên", + "received_crypto": "Đã nhận được tin nhắn tiền điện tử đầu tiên của bạn", "received_direct_message": "Đã nhận được tin nhắn trực tiếp đầu tiên của bạn", + "received_reaction": "Đã nhận được phản hồi đầu tiên của bạn về tin nhắn", + "replied_in_thread": "Đã bắt đầu trả lời đầu tiên trong chuỗi", + "sent_audio": "Đã gửi âm thanh đầu tiên của bạn", + "sent_crypto": "Đã gửi tin nhắn tiền điện tử đầu tiên của bạn", "sent_direct_message": "Đã gửi tin nhắn trực tiếp đầu tiên của bạn", + "sent_file": "Đã gửi tập tin đầu tiên của bạn", + "sent_giphy": "Đã gửi giphy đầu tiên của bạn", + "sent_image": "Đã gửi hình ảnh đầu tiên của bạn", + "sent_meme": "Đã gửi tin nhắn meme đầu tiên của bạn", + "sent_poll": "Đã gửi cuộc thăm dò đầu tiên của bạn", + "sent_prize": "Đã gửi giải thưởng đầu tiên của bạn", + "sent_swap_offer": "Đã gửi ưu đãi hoán đổi P2P đầu tiên", + "sent_text": "Đã gửi tin nhắn văn bản đầu tiên của bạn", + "sent_video": "Đã gửi video đầu tiên của bạn", "set_avatar": "Đã tải lên hình đại diện hồ sơ của bạn", "set_bio": "Đã cập nhật tiểu sử hồ sơ của bạn", + "set_community_access_gate": "Đặt cổng truy cập cộng đồng đầu tiên của bạn", + "set_community_display_name": "Đặt tên hiển thị cộng đồng đầu tiên của bạn", "set_display_name": "Đã cập nhật tên hiển thị của bạn", + "set_group_access_gate": "Đặt cổng truy cập nhóm/kênh đầu tiên của bạn", "showChitPopup": "Thông báo cho tôi về thành tích của tôi", + "started_call": "Đã bắt đầu cuộc gọi đầu tiên", "streak_14": "Đạt được chuỗi 14 ngày", "streak_3": "Đạt được chuỗi 3 ngày", "streak_30": "Đạt được chuỗi 30 ngày", "streak_7": "Đạt được chuỗi 7 ngày", + "suggested_translation": "Đã đề xuất bản dịch đầu tiên của bạn", + "swapped_from_wallet": "Hoán đổi token đầu tiên của bạn từ ví", + "tipped_message": "Tin nhắn đầu tiên được tip", + "translation_accepted": "Bản dịch đầu tiên của bạn đã được chấp nhận chưa", "upgrade_to_gold_diamond": "Nâng cấp lên thành viên Lifetime Diamond", - "upgraded_to_diamond": "Được nâng cấp lên thành viên Kim cương" + "upgraded_to_diamond": "Được nâng cấp lên thành viên Kim cương", + "voted_on_poll": "Đã bình chọn trong cuộc thăm dò đầu tiên của bạn" }, "leave": "Rời", "leaveGroup": "Rời khỏi {level}", @@ -1110,8 +1161,8 @@ "send": "Gửi", "sendGif": "Gửi gif", "sendMessage": "Gửi tin nhắn", - "sendTextDisabled": "Tin nhắn văn bản bị vô hiệu hóa", "sendMessageDisabledAnon": "Vui lòng đăng nhập để gửi tin nhắn", + "sendTextDisabled": "Tin nhắn văn bản bị vô hiệu hóa", "sendTo": "Gửi đến...", "sessionExpired": "Phiên sử dụng đã hết hạn", "sessionExpiredBlurb": "Xin đăng nhập lại", diff --git a/frontend/openchat-agent/src/services/common/chatMappers.ts b/frontend/openchat-agent/src/services/common/chatMappers.ts index 86554d9b62..6420c13a07 100644 --- a/frontend/openchat-agent/src/services/common/chatMappers.ts +++ b/frontend/openchat-agent/src/services/common/chatMappers.ts @@ -1777,6 +1777,11 @@ export function accessGate(candid: ApiAccessGate): AccessGate { minBalance: candid.TokenBalance.min_balance, }; } + if ("Composite" in candid) { + return { + kind: "no_gate", + }; + } throw new UnsupportedValueError("Unexpected ApiGroupGate type received", candid); } @@ -2270,6 +2275,7 @@ export function updateGroupResponse( return { kind: "chat_frozen" }; } if ( + "AccessGateInvalid" in candid || "UserNotInChannel" in candid || "ChannelNotFound" in candid || "UserNotInCommunity" in candid || @@ -2372,6 +2378,9 @@ export function createGroupResponse( return { kind: "default_must_be_public" }; } + if ("AccessGateInvalid" in candid) { + return CommonResponses.internalError(); + } throw new UnsupportedValueError("Unexpected ApiCreateGroupResponse type received", candid); } diff --git a/frontend/openchat-agent/src/services/community/candid/idl.js b/frontend/openchat-agent/src/services/community/candid/idl.js index 22092445f4..19354b64ce 100644 --- a/frontend/openchat-agent/src/services/community/candid/idl.js +++ b/frontend/openchat-agent/src/services/community/candid/idl.js @@ -1,4 +1,5 @@ export const idlFactory = ({ IDL }) => { + const AccessGate = IDL.Rec(); const ChannelId = IDL.Nat; const MessageId = IDL.Nat; const MessageIndex = IDL.Nat32; @@ -318,15 +319,21 @@ export const idlFactory = ({ IDL }) => { 'ledger_canister_id' : CanisterId, 'amount' : IDL.Nat, }); - const AccessGate = IDL.Variant({ - 'UniquePerson' : IDL.Null, - 'VerifiedCredential' : VerifiedCredentialGate, - 'SnsNeuron' : SnsNeuronGate, - 'TokenBalance' : TokenBalanceGate, - 'DiamondMember' : IDL.Null, - 'Payment' : PaymentGate, - 'LifetimeDiamondMember' : IDL.Null, - }); + AccessGate.fill( + IDL.Variant({ + 'UniquePerson' : IDL.Null, + 'VerifiedCredential' : VerifiedCredentialGate, + 'SnsNeuron' : SnsNeuronGate, + 'TokenBalance' : TokenBalanceGate, + 'Composite' : IDL.Record({ + 'and' : IDL.Bool, + 'inner' : IDL.Vec(AccessGate), + }), + 'DiamondMember' : IDL.Null, + 'Payment' : PaymentGate, + 'LifetimeDiamondMember' : IDL.Null, + }) + ); const GroupCanisterThreadDetails = IDL.Record({ 'root_message_index' : MessageIndex, 'last_updated' : TimestampMillis, @@ -937,6 +944,7 @@ export const idlFactory = ({ IDL }) => { 'RulesTooLong' : FieldTooLongResult, 'DescriptionTooLong' : FieldTooLongResult, 'NameTooShort' : FieldTooShortResult, + 'AccessGateInvalid' : IDL.Null, 'NotAuthorized' : IDL.Null, 'AvatarTooBig' : FieldTooLongResult, 'Success' : IDL.Record({ 'channel_id' : ChannelId }), @@ -1967,6 +1975,7 @@ export const idlFactory = ({ IDL }) => { 'DescriptionTooLong' : FieldTooLongResult, 'NameTooShort' : FieldTooShortResult, 'UserNotInChannel' : IDL.Null, + 'AccessGateInvalid' : IDL.Null, 'ChannelNotFound' : IDL.Null, 'NotAuthorized' : IDL.Null, 'AvatarTooBig' : FieldTooLongResult, @@ -2004,6 +2013,7 @@ export const idlFactory = ({ IDL }) => { 'DescriptionTooLong' : FieldTooLongResult, 'InvalidLanguage' : IDL.Null, 'NameTooShort' : FieldTooShortResult, + 'AccessGateInvalid' : IDL.Null, 'NotAuthorized' : IDL.Null, 'AvatarTooBig' : FieldTooLongResult, 'UserNotInCommunity' : IDL.Null, diff --git a/frontend/openchat-agent/src/services/community/candid/types.d.ts b/frontend/openchat-agent/src/services/community/candid/types.d.ts index 3d24f42d8c..333c681823 100644 --- a/frontend/openchat-agent/src/services/community/candid/types.d.ts +++ b/frontend/openchat-agent/src/services/community/candid/types.d.ts @@ -28,6 +28,7 @@ export type AccessGate = { 'UniquePerson' : null } | { 'VerifiedCredential' : VerifiedCredentialGate } | { 'SnsNeuron' : SnsNeuronGate } | { 'TokenBalance' : TokenBalanceGate } | + { 'Composite' : { 'and' : boolean, 'inner' : Array } } | { 'DiamondMember' : null } | { 'Payment' : PaymentGate } | { 'LifetimeDiamondMember' : null }; @@ -581,6 +582,7 @@ export type CreateChannelResponse = { 'MaxChannelsCreated' : number } | { 'RulesTooLong' : FieldTooLongResult } | { 'DescriptionTooLong' : FieldTooLongResult } | { 'NameTooShort' : FieldTooShortResult } | + { 'AccessGateInvalid' : null } | { 'NotAuthorized' : null } | { 'AvatarTooBig' : FieldTooLongResult } | { 'Success' : { 'channel_id' : ChannelId } } | @@ -620,6 +622,7 @@ export interface CurrentUserSummary { 'username' : string, 'is_platform_operator' : boolean, 'diamond_membership_status' : DiamondMembershipStatusFull, + 'is_unique_person' : boolean, 'user_id' : UserId, 'is_bot' : boolean, 'display_name' : [] | [string], @@ -2279,6 +2282,7 @@ export type UpdateChannelResponse = { 'NameReserved' : null } | { 'DescriptionTooLong' : FieldTooLongResult } | { 'NameTooShort' : FieldTooShortResult } | { 'UserNotInChannel' : null } | + { 'AccessGateInvalid' : null } | { 'ChannelNotFound' : null } | { 'NotAuthorized' : null } | { 'AvatarTooBig' : FieldTooLongResult } | @@ -2305,6 +2309,7 @@ export type UpdateCommunityResponse = { 'NameReserved' : null } | { 'DescriptionTooLong' : FieldTooLongResult } | { 'InvalidLanguage' : null } | { 'NameTooShort' : FieldTooShortResult } | + { 'AccessGateInvalid' : null } | { 'NotAuthorized' : null } | { 'AvatarTooBig' : FieldTooLongResult } | { 'UserNotInCommunity' : null } | @@ -2358,6 +2363,7 @@ export interface UserSummary { 'username' : string, 'diamond_member' : boolean, 'diamond_membership_status' : DiamondMembershipStatus, + 'is_unique_person' : boolean, 'user_id' : UserId, 'is_bot' : boolean, 'display_name' : [] | [string], @@ -2368,6 +2374,7 @@ export interface UserSummary { export interface UserSummaryStable { 'username' : string, 'diamond_membership_status' : DiamondMembershipStatus, + 'is_unique_person' : boolean, 'is_bot' : boolean, 'display_name' : [] | [string], 'avatar_id' : [] | [bigint], @@ -2410,6 +2417,7 @@ export interface VerifiedCredentialGate { export interface VerifiedCredentialGateArgs { 'credential_jwt' : string, 'ii_origin' : string, + 'credential_jwts' : Array, 'user_ii_principal' : Principal, } export type Version = number; diff --git a/frontend/openchat-agent/src/services/community/community.client.ts b/frontend/openchat-agent/src/services/community/community.client.ts index ad8a8de88d..eb21a04765 100644 --- a/frontend/openchat-agent/src/services/community/community.client.ts +++ b/frontend/openchat-agent/src/services/community/community.client.ts @@ -238,6 +238,7 @@ export class CommunityClient extends CandidService { messageId: bigint, reaction: string, threadRootMessageIndex: number | undefined, + newAchievement: boolean, ): Promise { return this.handleResponse( this.service.add_reaction({ @@ -247,7 +248,7 @@ export class CommunityClient extends CandidService { message_id: messageId, thread_root_message_index: apiOptional(identity, threadRootMessageIndex), reaction, - new_achievement: false, + new_achievement: newAchievement, }), addRemoveReactionResponse, ); @@ -352,6 +353,7 @@ export class CommunityClient extends CandidService { messageIds: bigint[], threadRootMessageIndex: number | undefined, asPlatformModerator: boolean | undefined, + newAchievement: boolean, ): Promise { return this.handleResponse( this.service.delete_messages({ @@ -359,7 +361,7 @@ export class CommunityClient extends CandidService { message_ids: messageIds, as_platform_moderator: apiOptional(identity, asPlatformModerator), thread_root_message_index: apiOptional(identity, threadRootMessageIndex), - new_achievement: false, + new_achievement: newAchievement, }), deleteMessageResponse, ); @@ -373,7 +375,8 @@ export class CommunityClient extends CandidService { chatId: ChannelIdentifier, message: Message, threadRootMessageIndex: number | undefined, - blockLevelMarkdown?: boolean, + blockLevelMarkdown: boolean | undefined, + newAchievement: boolean, ): Promise { return DataClient.create(this.identity, this.config) .uploadData(message.content, [chatId.communityId]) @@ -386,7 +389,7 @@ export class CommunityClient extends CandidService { message_id: message.messageId, block_level_markdown: blockLevelMarkdown === undefined ? [] : [blockLevelMarkdown], - new_achievement: false, + new_achievement: newAchievement, }), editMessageResponse, ); @@ -970,6 +973,7 @@ export class CommunityClient extends CandidService { communityRulesAccepted: number | undefined, channelRulesAccepted: number | undefined, messageFilterFailed: bigint | undefined, + newAchievement: boolean, ): Promise<[SendMessageResponse, Message]> { // pre-emtively remove the failed message from indexeddb - it will get re-added if anything goes wrong removeFailedMessage(this.db, chatId, event.event.messageId, threadRootMessageIndex); @@ -1000,7 +1004,7 @@ export class CommunityClient extends CandidService { thread_root_message_index: apiOptional(identity, threadRootMessageIndex), message_filter_failed: apiOptional(identity, messageFilterFailed), block_level_markdown: event.event.blockLevelMarkdown, - new_achievement: false, + new_achievement: newAchievement, }; return this.handleResponse(this.service.send_message(args), sendMessageResponse) .then((resp) => { diff --git a/frontend/openchat-agent/src/services/group/candid/idl.js b/frontend/openchat-agent/src/services/group/candid/idl.js index e4e460f5f6..a578251338 100644 --- a/frontend/openchat-agent/src/services/group/candid/idl.js +++ b/frontend/openchat-agent/src/services/group/candid/idl.js @@ -1,4 +1,5 @@ export const idlFactory = ({ IDL }) => { + const AccessGate = IDL.Rec(); const MessageId = IDL.Nat; const MessageIndex = IDL.Nat32; const AcceptP2PSwapArgs = IDL.Record({ @@ -845,15 +846,21 @@ export const idlFactory = ({ IDL }) => { 'ledger_canister_id' : CanisterId, 'amount' : IDL.Nat, }); - const AccessGate = IDL.Variant({ - 'UniquePerson' : IDL.Null, - 'VerifiedCredential' : VerifiedCredentialGate, - 'SnsNeuron' : SnsNeuronGate, - 'TokenBalance' : TokenBalanceGate, - 'DiamondMember' : IDL.Null, - 'Payment' : PaymentGate, - 'LifetimeDiamondMember' : IDL.Null, - }); + AccessGate.fill( + IDL.Variant({ + 'UniquePerson' : IDL.Null, + 'VerifiedCredential' : VerifiedCredentialGate, + 'SnsNeuron' : SnsNeuronGate, + 'TokenBalance' : TokenBalanceGate, + 'Composite' : IDL.Record({ + 'and' : IDL.Bool, + 'inner' : IDL.Vec(AccessGate), + }), + 'DiamondMember' : IDL.Null, + 'Payment' : PaymentGate, + 'LifetimeDiamondMember' : IDL.Null, + }) + ); const GroupGateUpdated = IDL.Record({ 'updated_by' : UserId, 'new_gate' : IDL.Opt(AccessGate), @@ -1615,6 +1622,7 @@ export const idlFactory = ({ IDL }) => { 'RulesTooLong' : FieldTooLongResult, 'DescriptionTooLong' : FieldTooLongResult, 'NameTooShort' : FieldTooShortResult, + 'AccessGateInvalid' : IDL.Null, 'CallerNotInGroup' : IDL.Null, 'ChatFrozen' : IDL.Null, 'NotAuthorized' : IDL.Null, diff --git a/frontend/openchat-agent/src/services/group/candid/types.d.ts b/frontend/openchat-agent/src/services/group/candid/types.d.ts index d3fbc1fa0c..0382261745 100644 --- a/frontend/openchat-agent/src/services/group/candid/types.d.ts +++ b/frontend/openchat-agent/src/services/group/candid/types.d.ts @@ -25,6 +25,7 @@ export type AccessGate = { 'UniquePerson' : null } | { 'VerifiedCredential' : VerifiedCredentialGate } | { 'SnsNeuron' : SnsNeuronGate } | { 'TokenBalance' : TokenBalanceGate } | + { 'Composite' : { 'and' : boolean, 'inner' : Array } } | { 'DiamondMember' : null } | { 'Payment' : PaymentGate } | { 'LifetimeDiamondMember' : null }; @@ -521,6 +522,7 @@ export interface CurrentUserSummary { 'username' : string, 'is_platform_operator' : boolean, 'diamond_membership_status' : DiamondMembershipStatusFull, + 'is_unique_person' : boolean, 'user_id' : UserId, 'is_bot' : boolean, 'display_name' : [] | [string], @@ -2024,6 +2026,7 @@ export type UpdateGroupV2Response = { 'NameReserved' : null } | { 'RulesTooLong' : FieldTooLongResult } | { 'DescriptionTooLong' : FieldTooLongResult } | { 'NameTooShort' : FieldTooShortResult } | + { 'AccessGateInvalid' : null } | { 'CallerNotInGroup' : null } | { 'ChatFrozen' : null } | { 'NotAuthorized' : null } | @@ -2051,6 +2054,7 @@ export interface UserSummary { 'username' : string, 'diamond_member' : boolean, 'diamond_membership_status' : DiamondMembershipStatus, + 'is_unique_person' : boolean, 'user_id' : UserId, 'is_bot' : boolean, 'display_name' : [] | [string], @@ -2061,6 +2065,7 @@ export interface UserSummary { export interface UserSummaryStable { 'username' : string, 'diamond_membership_status' : DiamondMembershipStatus, + 'is_unique_person' : boolean, 'is_bot' : boolean, 'display_name' : [] | [string], 'avatar_id' : [] | [bigint], @@ -2103,6 +2108,7 @@ export interface VerifiedCredentialGate { export interface VerifiedCredentialGateArgs { 'credential_jwt' : string, 'ii_origin' : string, + 'credential_jwts' : Array, 'user_ii_principal' : Principal, } export type Version = number; diff --git a/frontend/openchat-agent/src/services/group/group.client.ts b/frontend/openchat-agent/src/services/group/group.client.ts index e8996f25b5..2a255ee8de 100644 --- a/frontend/openchat-agent/src/services/group/group.client.ts +++ b/frontend/openchat-agent/src/services/group/group.client.ts @@ -448,8 +448,9 @@ export class GroupClient extends CandidService { editMessage( message: Message, - threadRootMessageIndex?: number, - blockLevelMarkdown?: boolean, + threadRootMessageIndex: number | undefined, + blockLevelMarkdown: boolean | undefined, + newAchievement: boolean, ): Promise { return DataClient.create(this.identity, this.config) .uploadData(message.content, [this.chatId.groupId]) @@ -461,7 +462,7 @@ export class GroupClient extends CandidService { block_level_markdown: blockLevelMarkdown === undefined ? [] : [blockLevelMarkdown], correlation_id: generateUint64(), - new_achievement: false, + new_achievement: newAchievement, }; return this.handleResponse( this.groupService.edit_message_v2(args), @@ -488,6 +489,7 @@ export class GroupClient extends CandidService { threadRootMessageIndex: number | undefined, rulesAccepted: number | undefined, messageFilterFailed: bigint | undefined, + newAchievement: boolean, ): Promise<[SendMessageResponse, Message]> { // pre-emtively remove the failed message from indexeddb - it will get re-added if anything goes wrong removeFailedMessage(this.db, this.chatId, event.event.messageId, threadRootMessageIndex); @@ -517,7 +519,7 @@ export class GroupClient extends CandidService { message_filter_failed: apiOptional(identity, messageFilterFailed), correlation_id: generateUint64(), block_level_markdown: event.event.blockLevelMarkdown, - new_achievement: false, + new_achievement: newAchievement, }; return this.handleResponse(this.groupService.send_message_v2(args), sendMessageResponse) @@ -586,7 +588,8 @@ export class GroupClient extends CandidService { reaction: string, username: string, displayName: string | undefined, - threadRootMessageIndex?: number, + threadRootMessageIndex: number | undefined, + newAchievement: boolean, ): Promise { return this.handleResponse( this.groupService.add_reaction({ @@ -596,7 +599,7 @@ export class GroupClient extends CandidService { username, display_name: apiOptional(identity, displayName), correlation_id: generateUint64(), - new_achievement: false, + new_achievement: newAchievement, }), addRemoveReactionResponse, ); @@ -620,8 +623,9 @@ export class GroupClient extends CandidService { deleteMessage( messageId: bigint, - threadRootMessageIndex?: number, - asPlatformModerator?: boolean, + threadRootMessageIndex: number | undefined, + asPlatformModerator: boolean | undefined, + newAchievement: boolean, ): Promise { return this.handleResponse( this.groupService.delete_messages({ @@ -629,7 +633,7 @@ export class GroupClient extends CandidService { message_ids: [messageId], correlation_id: generateUint64(), as_platform_moderator: apiOptional(identity, asPlatformModerator), - new_achievement: false, + new_achievement: newAchievement, }), deleteMessageResponse, ); diff --git a/frontend/openchat-agent/src/services/groupIndex/candid/idl.js b/frontend/openchat-agent/src/services/groupIndex/candid/idl.js index 8034ad5032..99520bb3e3 100644 --- a/frontend/openchat-agent/src/services/groupIndex/candid/idl.js +++ b/frontend/openchat-agent/src/services/groupIndex/candid/idl.js @@ -1,4 +1,5 @@ export const idlFactory = ({ IDL }) => { + const AccessGate = IDL.Rec(); const CanisterId = IDL.Principal; const CommunityId = CanisterId; const TimestampMillis = IDL.Nat64; @@ -83,15 +84,21 @@ export const idlFactory = ({ IDL }) => { 'ledger_canister_id' : CanisterId, 'amount' : IDL.Nat, }); - const AccessGate = IDL.Variant({ - 'UniquePerson' : IDL.Null, - 'VerifiedCredential' : VerifiedCredentialGate, - 'SnsNeuron' : SnsNeuronGate, - 'TokenBalance' : TokenBalanceGate, - 'DiamondMember' : IDL.Null, - 'Payment' : PaymentGate, - 'LifetimeDiamondMember' : IDL.Null, - }); + AccessGate.fill( + IDL.Variant({ + 'UniquePerson' : IDL.Null, + 'VerifiedCredential' : VerifiedCredentialGate, + 'SnsNeuron' : SnsNeuronGate, + 'TokenBalance' : TokenBalanceGate, + 'Composite' : IDL.Record({ + 'and' : IDL.Bool, + 'inner' : IDL.Vec(AccessGate), + }), + 'DiamondMember' : IDL.Null, + 'Payment' : PaymentGate, + 'LifetimeDiamondMember' : IDL.Null, + }) + ); const CommunityMatch = IDL.Record({ 'id' : CommunityId, 'channel_count' : IDL.Nat32, diff --git a/frontend/openchat-agent/src/services/groupIndex/candid/types.d.ts b/frontend/openchat-agent/src/services/groupIndex/candid/types.d.ts index eb93dffe66..fffbb072fd 100644 --- a/frontend/openchat-agent/src/services/groupIndex/candid/types.d.ts +++ b/frontend/openchat-agent/src/services/groupIndex/candid/types.d.ts @@ -7,6 +7,7 @@ export type AccessGate = { 'UniquePerson' : null } | { 'VerifiedCredential' : VerifiedCredentialGate } | { 'SnsNeuron' : SnsNeuronGate } | { 'TokenBalance' : TokenBalanceGate } | + { 'Composite' : { 'and' : boolean, 'inner' : Array } } | { 'DiamondMember' : null } | { 'Payment' : PaymentGate } | { 'LifetimeDiamondMember' : null }; @@ -444,6 +445,7 @@ export interface CurrentUserSummary { 'username' : string, 'is_platform_operator' : boolean, 'diamond_membership_status' : DiamondMembershipStatusFull, + 'is_unique_person' : boolean, 'user_id' : UserId, 'is_bot' : boolean, 'display_name' : [] | [string], @@ -1764,6 +1766,7 @@ export interface UserSummary { 'username' : string, 'diamond_member' : boolean, 'diamond_membership_status' : DiamondMembershipStatus, + 'is_unique_person' : boolean, 'user_id' : UserId, 'is_bot' : boolean, 'display_name' : [] | [string], @@ -1774,6 +1777,7 @@ export interface UserSummary { export interface UserSummaryStable { 'username' : string, 'diamond_membership_status' : DiamondMembershipStatus, + 'is_unique_person' : boolean, 'is_bot' : boolean, 'display_name' : [] | [string], 'avatar_id' : [] | [bigint], @@ -1816,6 +1820,7 @@ export interface VerifiedCredentialGate { export interface VerifiedCredentialGateArgs { 'credential_jwt' : string, 'ii_origin' : string, + 'credential_jwts' : Array, 'user_ii_principal' : Principal, } export type Version = number; diff --git a/frontend/openchat-agent/src/services/localUserIndex/candid/idl.js b/frontend/openchat-agent/src/services/localUserIndex/candid/idl.js index d261aa950e..684baaf078 100644 --- a/frontend/openchat-agent/src/services/localUserIndex/candid/idl.js +++ b/frontend/openchat-agent/src/services/localUserIndex/candid/idl.js @@ -1,4 +1,5 @@ export const idlFactory = ({ IDL }) => { + const AccessGate = IDL.Rec(); const CanisterId = IDL.Principal; const ChatId = CanisterId; const CommunityId = CanisterId; @@ -620,15 +621,21 @@ export const idlFactory = ({ IDL }) => { 'ledger_canister_id' : CanisterId, 'amount' : IDL.Nat, }); - const AccessGate = IDL.Variant({ - 'UniquePerson' : IDL.Null, - 'VerifiedCredential' : VerifiedCredentialGate, - 'SnsNeuron' : SnsNeuronGate, - 'TokenBalance' : TokenBalanceGate, - 'DiamondMember' : IDL.Null, - 'Payment' : PaymentGate, - 'LifetimeDiamondMember' : IDL.Null, - }); + AccessGate.fill( + IDL.Variant({ + 'UniquePerson' : IDL.Null, + 'VerifiedCredential' : VerifiedCredentialGate, + 'SnsNeuron' : SnsNeuronGate, + 'TokenBalance' : TokenBalanceGate, + 'Composite' : IDL.Record({ + 'and' : IDL.Bool, + 'inner' : IDL.Vec(AccessGate), + }), + 'DiamondMember' : IDL.Null, + 'Payment' : PaymentGate, + 'LifetimeDiamondMember' : IDL.Null, + }) + ); const GroupGateUpdated = IDL.Record({ 'updated_by' : UserId, 'new_gate' : IDL.Opt(AccessGate), @@ -1106,6 +1113,7 @@ export const idlFactory = ({ IDL }) => { const VerifiedCredentialGateArgs = IDL.Record({ 'credential_jwt' : IDL.Text, 'ii_origin' : IDL.Text, + 'credential_jwts' : IDL.Vec(IDL.Text), 'user_ii_principal' : IDL.Principal, }); const JoinChannelArgs = IDL.Record({ diff --git a/frontend/openchat-agent/src/services/localUserIndex/candid/types.d.ts b/frontend/openchat-agent/src/services/localUserIndex/candid/types.d.ts index 0a9fa020d6..b5daeb354c 100644 --- a/frontend/openchat-agent/src/services/localUserIndex/candid/types.d.ts +++ b/frontend/openchat-agent/src/services/localUserIndex/candid/types.d.ts @@ -7,6 +7,7 @@ export type AccessGate = { 'UniquePerson' : null } | { 'VerifiedCredential' : VerifiedCredentialGate } | { 'SnsNeuron' : SnsNeuronGate } | { 'TokenBalance' : TokenBalanceGate } | + { 'Composite' : { 'and' : boolean, 'inner' : Array } } | { 'DiamondMember' : null } | { 'Payment' : PaymentGate } | { 'LifetimeDiamondMember' : null }; @@ -464,6 +465,7 @@ export interface CurrentUserSummary { 'username' : string, 'is_platform_operator' : boolean, 'diamond_membership_status' : DiamondMembershipStatusFull, + 'is_unique_person' : boolean, 'user_id' : UserId, 'is_bot' : boolean, 'display_name' : [] | [string], @@ -1769,6 +1771,7 @@ export interface UserSummary { 'username' : string, 'diamond_member' : boolean, 'diamond_membership_status' : DiamondMembershipStatus, + 'is_unique_person' : boolean, 'user_id' : UserId, 'is_bot' : boolean, 'display_name' : [] | [string], @@ -1779,6 +1782,7 @@ export interface UserSummary { export interface UserSummaryStable { 'username' : string, 'diamond_membership_status' : DiamondMembershipStatus, + 'is_unique_person' : boolean, 'is_bot' : boolean, 'display_name' : [] | [string], 'avatar_id' : [] | [bigint], @@ -1821,6 +1825,7 @@ export interface VerifiedCredentialGate { export interface VerifiedCredentialGateArgs { 'credential_jwt' : string, 'ii_origin' : string, + 'credential_jwts' : Array, 'user_ii_principal' : Principal, } export type Version = number; diff --git a/frontend/openchat-agent/src/services/notifications/candid/types.d.ts b/frontend/openchat-agent/src/services/notifications/candid/types.d.ts index ddecd07315..7fa20a90da 100644 --- a/frontend/openchat-agent/src/services/notifications/candid/types.d.ts +++ b/frontend/openchat-agent/src/services/notifications/candid/types.d.ts @@ -7,6 +7,7 @@ export type AccessGate = { 'UniquePerson' : null } | { 'VerifiedCredential' : VerifiedCredentialGate } | { 'SnsNeuron' : SnsNeuronGate } | { 'TokenBalance' : TokenBalanceGate } | + { 'Composite' : { 'and' : boolean, 'inner' : Array } } | { 'DiamondMember' : null } | { 'Payment' : PaymentGate } | { 'LifetimeDiamondMember' : null }; @@ -424,6 +425,7 @@ export interface CurrentUserSummary { 'username' : string, 'is_platform_operator' : boolean, 'diamond_membership_status' : DiamondMembershipStatusFull, + 'is_unique_person' : boolean, 'user_id' : UserId, 'is_bot' : boolean, 'display_name' : [] | [string], @@ -1587,6 +1589,7 @@ export interface UserSummary { 'username' : string, 'diamond_member' : boolean, 'diamond_membership_status' : DiamondMembershipStatus, + 'is_unique_person' : boolean, 'user_id' : UserId, 'is_bot' : boolean, 'display_name' : [] | [string], @@ -1597,6 +1600,7 @@ export interface UserSummary { export interface UserSummaryStable { 'username' : string, 'diamond_membership_status' : DiamondMembershipStatus, + 'is_unique_person' : boolean, 'is_bot' : boolean, 'display_name' : [] | [string], 'avatar_id' : [] | [bigint], @@ -1639,6 +1643,7 @@ export interface VerifiedCredentialGate { export interface VerifiedCredentialGateArgs { 'credential_jwt' : string, 'ii_origin' : string, + 'credential_jwts' : Array, 'user_ii_principal' : Principal, } export type Version = number; diff --git a/frontend/openchat-agent/src/services/online/candid/types.d.ts b/frontend/openchat-agent/src/services/online/candid/types.d.ts index b0324003b9..5f5a37e890 100644 --- a/frontend/openchat-agent/src/services/online/candid/types.d.ts +++ b/frontend/openchat-agent/src/services/online/candid/types.d.ts @@ -7,6 +7,7 @@ export type AccessGate = { 'UniquePerson' : null } | { 'VerifiedCredential' : VerifiedCredentialGate } | { 'SnsNeuron' : SnsNeuronGate } | { 'TokenBalance' : TokenBalanceGate } | + { 'Composite' : { 'and' : boolean, 'inner' : Array } } | { 'DiamondMember' : null } | { 'Payment' : PaymentGate } | { 'LifetimeDiamondMember' : null }; @@ -424,6 +425,7 @@ export interface CurrentUserSummary { 'username' : string, 'is_platform_operator' : boolean, 'diamond_membership_status' : DiamondMembershipStatusFull, + 'is_unique_person' : boolean, 'user_id' : UserId, 'is_bot' : boolean, 'display_name' : [] | [string], @@ -1587,6 +1589,7 @@ export interface UserSummary { 'username' : string, 'diamond_member' : boolean, 'diamond_membership_status' : DiamondMembershipStatus, + 'is_unique_person' : boolean, 'user_id' : UserId, 'is_bot' : boolean, 'display_name' : [] | [string], @@ -1597,6 +1600,7 @@ export interface UserSummary { export interface UserSummaryStable { 'username' : string, 'diamond_membership_status' : DiamondMembershipStatus, + 'is_unique_person' : boolean, 'is_bot' : boolean, 'display_name' : [] | [string], 'avatar_id' : [] | [bigint], @@ -1639,6 +1643,7 @@ export interface VerifiedCredentialGate { export interface VerifiedCredentialGateArgs { 'credential_jwt' : string, 'ii_origin' : string, + 'credential_jwts' : Array, 'user_ii_principal' : Principal, } export type Version = number; diff --git a/frontend/openchat-agent/src/services/openchatAgent.ts b/frontend/openchat-agent/src/services/openchatAgent.ts index edf8a9505f..9f01026335 100644 --- a/frontend/openchat-agent/src/services/openchatAgent.ts +++ b/frontend/openchat-agent/src/services/openchatAgent.ts @@ -417,8 +417,9 @@ export class OpenChatAgent extends EventTarget { editMessage( chatId: ChatIdentifier, msg: Message, - threadRootMessageIndex?: number, - blockLevelMarkdown?: boolean, + threadRootMessageIndex: number | undefined, + blockLevelMarkdown: boolean | undefined, + newAchievement: boolean, ): Promise { if (offline()) return Promise.resolve("failure"); @@ -436,6 +437,7 @@ export class OpenChatAgent extends EventTarget { msg, threadRootMessageIndex, blockLevelMarkdown, + newAchievement, ); case "channel": return this.editChannelMessage( @@ -443,6 +445,7 @@ export class OpenChatAgent extends EventTarget { msg, threadRootMessageIndex, blockLevelMarkdown, + newAchievement, ); } } @@ -455,6 +458,7 @@ export class OpenChatAgent extends EventTarget { acceptedRules: AcceptedRules | undefined, messageFilterFailed: bigint | undefined, pin: string | undefined, + newAchievement: boolean, ): Promise<[SendMessageResponse, Message]> { const { chatId, threadRootMessageIndex } = messageContext; @@ -493,6 +497,7 @@ export class OpenChatAgent extends EventTarget { acceptedRules?.community, acceptedRules?.chat, messageFilterFailed, + newAchievement, ); } if (chatId.kind === "group_chat") { @@ -523,6 +528,7 @@ export class OpenChatAgent extends EventTarget { threadRootMessageIndex, acceptedRules?.chat, messageFilterFailed, + newAchievement, ); } if (chatId.kind === "direct_chat") { @@ -547,6 +553,7 @@ export class OpenChatAgent extends EventTarget { communityRulesAccepted: number | undefined, channelRulesAccepted: number | undefined, messageFilterFailed: bigint | undefined, + newAchievement: boolean, ): Promise<[SendMessageResponse, Message]> { return this.communityClient(chatId.communityId).sendMessage( chatId, @@ -558,6 +565,7 @@ export class OpenChatAgent extends EventTarget { communityRulesAccepted, channelRulesAccepted, messageFilterFailed, + newAchievement, ); } @@ -570,6 +578,7 @@ export class OpenChatAgent extends EventTarget { threadRootMessageIndex: number | undefined, rulesAccepted: number | undefined, messageFilterFailed: bigint | undefined, + newAchievement: boolean, ): Promise<[SendMessageResponse, Message]> { return this.getGroupClient(chatId.groupId).sendMessage( senderName, @@ -579,33 +588,38 @@ export class OpenChatAgent extends EventTarget { threadRootMessageIndex, rulesAccepted, messageFilterFailed, + newAchievement, ); } private editGroupMessage( chatId: GroupChatIdentifier, message: Message, - threadRootMessageIndex?: number, - blockLevelMarkdown?: boolean, + threadRootMessageIndex: number | undefined, + blockLevelMarkdown: boolean | undefined, + newAchievement: boolean, ): Promise { return this.getGroupClient(chatId.groupId).editMessage( message, threadRootMessageIndex, blockLevelMarkdown, + newAchievement, ); } private editChannelMessage( chatId: ChannelIdentifier, message: Message, - threadRootMessageIndex?: number, - blockLevelMarkdown?: boolean, + threadRootMessageIndex: number | undefined, + blockLevelMarkdown: boolean | undefined, + newAchievement: boolean, ): Promise { return this.communityClient(chatId.communityId).editMessage( chatId, message, threadRootMessageIndex, blockLevelMarkdown, + newAchievement, ); } @@ -2126,7 +2140,8 @@ export class OpenChatAgent extends EventTarget { reaction: string, username: string, displayName: string | undefined, - threadRootMessageIndex?: number, + threadRootMessageIndex: number | undefined, + newAchievement: boolean, ): Promise { if (offline()) return Promise.resolve(CommonResponses.offline()); @@ -2138,6 +2153,7 @@ export class OpenChatAgent extends EventTarget { username, displayName, threadRootMessageIndex, + newAchievement, ); case "direct_chat": @@ -2146,6 +2162,7 @@ export class OpenChatAgent extends EventTarget { messageId, reaction, threadRootMessageIndex, + newAchievement, ); case "channel": @@ -2156,6 +2173,7 @@ export class OpenChatAgent extends EventTarget { messageId, reaction, threadRootMessageIndex, + newAchievement, ); } } @@ -2197,8 +2215,9 @@ export class OpenChatAgent extends EventTarget { deleteMessage( chatId: ChatIdentifier, messageId: bigint, - threadRootMessageIndex?: number, - asPlatformModerator?: boolean, + threadRootMessageIndex: number | undefined, + asPlatformModerator: boolean | undefined, + newAchievement: boolean, ): Promise { if (offline()) return Promise.resolve("offline"); @@ -2209,6 +2228,7 @@ export class OpenChatAgent extends EventTarget { messageId, threadRootMessageIndex, asPlatformModerator, + newAchievement, ); case "direct_chat": @@ -2220,6 +2240,7 @@ export class OpenChatAgent extends EventTarget { messageId, threadRootMessageIndex, asPlatformModerator, + newAchievement, ); } } @@ -2227,8 +2248,9 @@ export class OpenChatAgent extends EventTarget { private deleteChannelMessage( chatId: ChannelIdentifier, messageId: bigint, - threadRootMessageIndex?: number, - asPlatformModerator?: boolean, + threadRootMessageIndex: number | undefined, + asPlatformModerator: boolean | undefined, + newAchievement: boolean, ): Promise { if (offline()) return Promise.resolve("offline"); @@ -2237,14 +2259,16 @@ export class OpenChatAgent extends EventTarget { [messageId], threadRootMessageIndex, asPlatformModerator, + newAchievement, ); } private deleteGroupMessage( chatId: string, messageId: bigint, - threadRootMessageIndex?: number, - asPlatformModerator?: boolean, + threadRootMessageIndex: number | undefined, + asPlatformModerator: boolean | undefined, + newAchievement: boolean, ): Promise { if (offline()) return Promise.resolve("offline"); @@ -2252,6 +2276,7 @@ export class OpenChatAgent extends EventTarget { messageId, threadRootMessageIndex, asPlatformModerator, + newAchievement, ); } diff --git a/frontend/openchat-agent/src/services/proposalsBot/candid/idl.js b/frontend/openchat-agent/src/services/proposalsBot/candid/idl.js index 8be67b6d35..1bf3c9de60 100644 --- a/frontend/openchat-agent/src/services/proposalsBot/candid/idl.js +++ b/frontend/openchat-agent/src/services/proposalsBot/candid/idl.js @@ -1,5 +1,27 @@ export const idlFactory = ({ IDL }) => { + const ProposalId = IDL.Nat64; const CanisterId = IDL.Principal; + const LookupProposalMessageArgs = IDL.Record({ + 'proposal_id' : ProposalId, + 'governance_canister_id' : CanisterId, + }); + const ChatId = CanisterId; + const CommunityId = CanisterId; + const ChannelId = IDL.Nat; + const MultiUserChat = IDL.Variant({ + 'Group' : ChatId, + 'Channel' : IDL.Tuple(CommunityId, ChannelId), + }); + const MessageId = IDL.Nat; + const MessageIndex = IDL.Nat32; + const LookupProposalMessageResponse = IDL.Variant({ + 'NotFound' : IDL.Null, + 'Success' : IDL.Record({ + 'chat_id' : MultiUserChat, + 'message_id' : MessageId, + 'message_index' : MessageIndex, + }), + }); const StakeNeuronForSubmittingProposalsArgs = IDL.Record({ 'stake' : IDL.Nat, 'governance_canister_id' : CanisterId, @@ -26,6 +48,11 @@ export const idlFactory = ({ IDL }) => { 'InternalError' : IDL.Text, }); return IDL.Service({ + 'lookup_proposal_message' : IDL.Func( + [LookupProposalMessageArgs], + [LookupProposalMessageResponse], + ['query'], + ), 'stake_neuron_for_submitting_proposals' : IDL.Func( [StakeNeuronForSubmittingProposalsArgs], [StakeNeuronForSubmittingProposalsResponse], diff --git a/frontend/openchat-agent/src/services/proposalsBot/candid/types.d.ts b/frontend/openchat-agent/src/services/proposalsBot/candid/types.d.ts index 6e6d1995be..06c1bdb8a3 100644 --- a/frontend/openchat-agent/src/services/proposalsBot/candid/types.d.ts +++ b/frontend/openchat-agent/src/services/proposalsBot/candid/types.d.ts @@ -7,6 +7,7 @@ export type AccessGate = { 'UniquePerson' : null } | { 'VerifiedCredential' : VerifiedCredentialGate } | { 'SnsNeuron' : SnsNeuronGate } | { 'TokenBalance' : TokenBalanceGate } | + { 'Composite' : { 'and' : boolean, 'inner' : Array } } | { 'DiamondMember' : null } | { 'Payment' : PaymentGate } | { 'LifetimeDiamondMember' : null }; @@ -424,6 +425,7 @@ export interface CurrentUserSummary { 'username' : string, 'is_platform_operator' : boolean, 'diamond_membership_status' : DiamondMembershipStatusFull, + 'is_unique_person' : boolean, 'user_id' : UserId, 'is_bot' : boolean, 'display_name' : [] | [string], @@ -1010,6 +1012,18 @@ export type InvalidPollReason = { 'DuplicateOptions' : null } | { 'OptionTooLong' : number } | { 'EndDateInThePast' : null } | { 'PollsNotValidForDirectChats' : null }; +export interface LookupProposalMessageArgs { + 'proposal_id' : ProposalId, + 'governance_canister_id' : CanisterId, +} +export type LookupProposalMessageResponse = { 'NotFound' : null } | + { + 'Success' : { + 'chat_id' : MultiUserChat, + 'message_id' : MessageId, + 'message_index' : MessageIndex, + } + }; export interface MembersAddedToDefaultChannel { 'count' : number } export type Memo = Uint8Array | number[]; export interface Mention { @@ -1599,6 +1613,7 @@ export interface UserSummary { 'username' : string, 'diamond_member' : boolean, 'diamond_membership_status' : DiamondMembershipStatus, + 'is_unique_person' : boolean, 'user_id' : UserId, 'is_bot' : boolean, 'display_name' : [] | [string], @@ -1609,6 +1624,7 @@ export interface UserSummary { export interface UserSummaryStable { 'username' : string, 'diamond_membership_status' : DiamondMembershipStatus, + 'is_unique_person' : boolean, 'is_bot' : boolean, 'display_name' : [] | [string], 'avatar_id' : [] | [bigint], @@ -1651,6 +1667,7 @@ export interface VerifiedCredentialGate { export interface VerifiedCredentialGateArgs { 'credential_jwt' : string, 'ii_origin' : string, + 'credential_jwts' : Array, 'user_ii_principal' : Principal, } export type Version = number; @@ -1695,6 +1712,10 @@ export interface VideoContent { export type VoteOperation = { 'RegisterVote' : null } | { 'DeleteVote' : null }; export interface _SERVICE { + 'lookup_proposal_message' : ActorMethod< + [LookupProposalMessageArgs], + LookupProposalMessageResponse + >, 'stake_neuron_for_submitting_proposals' : ActorMethod< [StakeNeuronForSubmittingProposalsArgs], StakeNeuronForSubmittingProposalsResponse diff --git a/frontend/openchat-agent/src/services/registry/candid/types.d.ts b/frontend/openchat-agent/src/services/registry/candid/types.d.ts index 9f8a89d460..7d60476d5b 100644 --- a/frontend/openchat-agent/src/services/registry/candid/types.d.ts +++ b/frontend/openchat-agent/src/services/registry/candid/types.d.ts @@ -7,6 +7,7 @@ export type AccessGate = { 'UniquePerson' : null } | { 'VerifiedCredential' : VerifiedCredentialGate } | { 'SnsNeuron' : SnsNeuronGate } | { 'TokenBalance' : TokenBalanceGate } | + { 'Composite' : { 'and' : boolean, 'inner' : Array } } | { 'DiamondMember' : null } | { 'Payment' : PaymentGate } | { 'LifetimeDiamondMember' : null }; @@ -430,6 +431,7 @@ export interface CurrentUserSummary { 'username' : string, 'is_platform_operator' : boolean, 'diamond_membership_status' : DiamondMembershipStatusFull, + 'is_unique_person' : boolean, 'user_id' : UserId, 'is_bot' : boolean, 'display_name' : [] | [string], @@ -1632,6 +1634,7 @@ export interface UserSummary { 'username' : string, 'diamond_member' : boolean, 'diamond_membership_status' : DiamondMembershipStatus, + 'is_unique_person' : boolean, 'user_id' : UserId, 'is_bot' : boolean, 'display_name' : [] | [string], @@ -1642,6 +1645,7 @@ export interface UserSummary { export interface UserSummaryStable { 'username' : string, 'diamond_membership_status' : DiamondMembershipStatus, + 'is_unique_person' : boolean, 'is_bot' : boolean, 'display_name' : [] | [string], 'avatar_id' : [] | [bigint], @@ -1684,6 +1688,7 @@ export interface VerifiedCredentialGate { export interface VerifiedCredentialGateArgs { 'credential_jwt' : string, 'ii_origin' : string, + 'credential_jwts' : Array, 'user_ii_principal' : Principal, } export type Version = number; diff --git a/frontend/openchat-agent/src/services/storageBucket/candid/types.d.ts b/frontend/openchat-agent/src/services/storageBucket/candid/types.d.ts index ed49ef63ea..010872929a 100644 --- a/frontend/openchat-agent/src/services/storageBucket/candid/types.d.ts +++ b/frontend/openchat-agent/src/services/storageBucket/candid/types.d.ts @@ -7,6 +7,7 @@ export type AccessGate = { 'UniquePerson' : null } | { 'VerifiedCredential' : VerifiedCredentialGate } | { 'SnsNeuron' : SnsNeuronGate } | { 'TokenBalance' : TokenBalanceGate } | + { 'Composite' : { 'and' : boolean, 'inner' : Array } } | { 'DiamondMember' : null } | { 'Payment' : PaymentGate } | { 'LifetimeDiamondMember' : null }; @@ -424,6 +425,7 @@ export interface CurrentUserSummary { 'username' : string, 'is_platform_operator' : boolean, 'diamond_membership_status' : DiamondMembershipStatusFull, + 'is_unique_person' : boolean, 'user_id' : UserId, 'is_bot' : boolean, 'display_name' : [] | [string], @@ -1630,6 +1632,7 @@ export interface UserSummary { 'username' : string, 'diamond_member' : boolean, 'diamond_membership_status' : DiamondMembershipStatus, + 'is_unique_person' : boolean, 'user_id' : UserId, 'is_bot' : boolean, 'display_name' : [] | [string], @@ -1640,6 +1643,7 @@ export interface UserSummary { export interface UserSummaryStable { 'username' : string, 'diamond_membership_status' : DiamondMembershipStatus, + 'is_unique_person' : boolean, 'is_bot' : boolean, 'display_name' : [] | [string], 'avatar_id' : [] | [bigint], @@ -1682,6 +1686,7 @@ export interface VerifiedCredentialGate { export interface VerifiedCredentialGateArgs { 'credential_jwt' : string, 'ii_origin' : string, + 'credential_jwts' : Array, 'user_ii_principal' : Principal, } export type Version = number; diff --git a/frontend/openchat-agent/src/services/storageIndex/candid/types.d.ts b/frontend/openchat-agent/src/services/storageIndex/candid/types.d.ts index 990d90478d..fdf91fbb71 100644 --- a/frontend/openchat-agent/src/services/storageIndex/candid/types.d.ts +++ b/frontend/openchat-agent/src/services/storageIndex/candid/types.d.ts @@ -7,6 +7,7 @@ export type AccessGate = { 'UniquePerson' : null } | { 'VerifiedCredential' : VerifiedCredentialGate } | { 'SnsNeuron' : SnsNeuronGate } | { 'TokenBalance' : TokenBalanceGate } | + { 'Composite' : { 'and' : boolean, 'inner' : Array } } | { 'DiamondMember' : null } | { 'Payment' : PaymentGate } | { 'LifetimeDiamondMember' : null }; @@ -454,6 +455,7 @@ export interface CurrentUserSummary { 'username' : string, 'is_platform_operator' : boolean, 'diamond_membership_status' : DiamondMembershipStatusFull, + 'is_unique_person' : boolean, 'user_id' : UserId, 'is_bot' : boolean, 'display_name' : [] | [string], @@ -1624,6 +1626,7 @@ export interface UserSummary { 'username' : string, 'diamond_member' : boolean, 'diamond_membership_status' : DiamondMembershipStatus, + 'is_unique_person' : boolean, 'user_id' : UserId, 'is_bot' : boolean, 'display_name' : [] | [string], @@ -1634,6 +1637,7 @@ export interface UserSummary { export interface UserSummaryStable { 'username' : string, 'diamond_membership_status' : DiamondMembershipStatus, + 'is_unique_person' : boolean, 'is_bot' : boolean, 'display_name' : [] | [string], 'avatar_id' : [] | [bigint], @@ -1676,6 +1680,7 @@ export interface VerifiedCredentialGate { export interface VerifiedCredentialGateArgs { 'credential_jwt' : string, 'ii_origin' : string, + 'credential_jwts' : Array, 'user_ii_principal' : Principal, } export type Version = number; diff --git a/frontend/openchat-agent/src/services/translations/candid/types.d.ts b/frontend/openchat-agent/src/services/translations/candid/types.d.ts index 1ac36fc906..ae0ec3b262 100644 --- a/frontend/openchat-agent/src/services/translations/candid/types.d.ts +++ b/frontend/openchat-agent/src/services/translations/candid/types.d.ts @@ -7,6 +7,7 @@ export type AccessGate = { 'UniquePerson' : null } | { 'VerifiedCredential' : VerifiedCredentialGate } | { 'SnsNeuron' : SnsNeuronGate } | { 'TokenBalance' : TokenBalanceGate } | + { 'Composite' : { 'and' : boolean, 'inner' : Array } } | { 'DiamondMember' : null } | { 'Payment' : PaymentGate } | { 'LifetimeDiamondMember' : null }; @@ -436,6 +437,7 @@ export interface CurrentUserSummary { 'username' : string, 'is_platform_operator' : boolean, 'diamond_membership_status' : DiamondMembershipStatusFull, + 'is_unique_person' : boolean, 'user_id' : UserId, 'is_bot' : boolean, 'display_name' : [] | [string], @@ -1631,6 +1633,7 @@ export interface UserSummary { 'username' : string, 'diamond_member' : boolean, 'diamond_membership_status' : DiamondMembershipStatus, + 'is_unique_person' : boolean, 'user_id' : UserId, 'is_bot' : boolean, 'display_name' : [] | [string], @@ -1641,6 +1644,7 @@ export interface UserSummary { export interface UserSummaryStable { 'username' : string, 'diamond_membership_status' : DiamondMembershipStatus, + 'is_unique_person' : boolean, 'is_bot' : boolean, 'display_name' : [] | [string], 'avatar_id' : [] | [bigint], @@ -1683,6 +1687,7 @@ export interface VerifiedCredentialGate { export interface VerifiedCredentialGateArgs { 'credential_jwt' : string, 'ii_origin' : string, + 'credential_jwts' : Array, 'user_ii_principal' : Principal, } export type Version = number; diff --git a/frontend/openchat-agent/src/services/user/candid/idl.js b/frontend/openchat-agent/src/services/user/candid/idl.js index edfc8b43d6..7d24404c1b 100644 --- a/frontend/openchat-agent/src/services/user/candid/idl.js +++ b/frontend/openchat-agent/src/services/user/candid/idl.js @@ -1,4 +1,5 @@ export const idlFactory = ({ IDL }) => { + const AccessGate = IDL.Rec(); const CanisterId = IDL.Principal; const UserId = CanisterId; const MessageId = IDL.Nat; @@ -153,19 +154,71 @@ export const idlFactory = ({ IDL }) => { 'ascending' : IDL.Bool, }); const Achievement = IDL.Variant({ + 'AppointedGroupModerator' : IDL.Null, + 'DirectChats5' : IDL.Null, + 'ChangedTheme' : IDL.Null, + 'ChosenAsGroupModerator' : IDL.Null, + 'FavouritedChat' : IDL.Null, + 'AppointedGroupAdmin' : IDL.Null, + 'HadMessageReactedTo' : IDL.Null, + 'VotedOnPoll' : IDL.Null, + 'ChosenAsGroupAdmin' : IDL.Null, + 'OwnGroupWithOneHundredDiamondMembers' : IDL.Null, 'JoinedCommunity' : IDL.Null, + 'SetCommunityDisplayName' : IDL.Null, + 'AppointedGroupOwner' : IDL.Null, + 'OwnGroupWithTenDiamondMembers' : IDL.Null, + 'JoinedGatedGroupOrCommunity' : IDL.Null, 'JoinedGroup' : IDL.Null, + 'StartedCall' : IDL.Null, + 'ChosenAsGroupOwner' : IDL.Null, + 'TippedMessage' : IDL.Null, + 'SentGiphy' : IDL.Null, + 'SetCommunityAccessGate' : IDL.Null, 'Streak14' : IDL.Null, 'Streak30' : IDL.Null, + 'HadMessageTipped' : IDL.Null, + 'SwappedFromWallet' : IDL.Null, + 'SentReminder' : IDL.Null, + 'EditedMessage' : IDL.Null, + 'ReactedToMessage' : IDL.Null, 'UpgradedToDiamond' : IDL.Null, 'ReceivedDirectMessage' : IDL.Null, + 'AcceptedP2PSwapOffer' : IDL.Null, + 'JoinedCall' : IDL.Null, 'SetDisplayName' : IDL.Null, + 'SentImage' : IDL.Null, + 'EnabledDisappearingMessages' : IDL.Null, + 'ForwardedMessage' : IDL.Null, + 'SentPrize' : IDL.Null, + 'FollowedThread' : IDL.Null, 'SetBio' : IDL.Null, + 'OwnGroupWithOneThousandDiamondMembers' : IDL.Null, + 'SentP2PSwapOffer' : IDL.Null, + 'QuoteReplied' : IDL.Null, + 'OwnGroupWithOneDiamondMember' : IDL.Null, + 'SentCrypto' : IDL.Null, + 'ProvedUniquePersonhood' : IDL.Null, + 'PinnedMessage' : IDL.Null, 'Streak3' : IDL.Null, 'Streak7' : IDL.Null, 'UpgradedToGoldDiamond' : IDL.Null, + 'ReceivedCrypto' : IDL.Null, + 'TranslationAccepted' : IDL.Null, + 'RepliedInThread' : IDL.Null, + 'DirectChats10' : IDL.Null, + 'DirectChats20' : IDL.Null, + 'SetGroupAccessGate' : IDL.Null, + 'SentFile' : IDL.Null, + 'DeletedMessage' : IDL.Null, 'SentDirectMessage' : IDL.Null, + 'SentMeme' : IDL.Null, + 'SentPoll' : IDL.Null, + 'SentAudio' : IDL.Null, + 'SentText' : IDL.Null, + 'SuggestedTranslation' : IDL.Null, 'SetAvatar' : IDL.Null, + 'SentVideo' : IDL.Null, }); const ChitEarnedReason = IDL.Variant({ 'DailyClaim' : IDL.Null, @@ -242,15 +295,21 @@ export const idlFactory = ({ IDL }) => { 'ledger_canister_id' : CanisterId, 'amount' : IDL.Nat, }); - const AccessGate = IDL.Variant({ - 'UniquePerson' : IDL.Null, - 'VerifiedCredential' : VerifiedCredentialGate, - 'SnsNeuron' : SnsNeuronGate, - 'TokenBalance' : TokenBalanceGate, - 'DiamondMember' : IDL.Null, - 'Payment' : PaymentGate, - 'LifetimeDiamondMember' : IDL.Null, - }); + AccessGate.fill( + IDL.Variant({ + 'UniquePerson' : IDL.Null, + 'VerifiedCredential' : VerifiedCredentialGate, + 'SnsNeuron' : SnsNeuronGate, + 'TokenBalance' : TokenBalanceGate, + 'Composite' : IDL.Record({ + 'and' : IDL.Bool, + 'inner' : IDL.Vec(AccessGate), + }), + 'DiamondMember' : IDL.Null, + 'Payment' : PaymentGate, + 'LifetimeDiamondMember' : IDL.Null, + }) + ); const Document = IDL.Record({ 'id' : IDL.Nat, 'data' : IDL.Vec(IDL.Nat8), @@ -287,6 +346,7 @@ export const idlFactory = ({ IDL }) => { 'RulesTooLong' : FieldTooLongResult, 'DescriptionTooLong' : FieldTooLongResult, 'NameTooShort' : FieldTooShortResult, + 'AccessGateInvalid' : IDL.Null, 'Throttled' : IDL.Null, 'AvatarTooBig' : FieldTooLongResult, 'Success' : CreateCommunitySuccessResult, @@ -356,6 +416,7 @@ export const idlFactory = ({ IDL }) => { 'RulesTooLong' : FieldTooLongResult, 'DescriptionTooLong' : FieldTooLongResult, 'NameTooShort' : FieldTooShortResult, + 'AccessGateInvalid' : IDL.Null, 'Throttled' : IDL.Null, 'AvatarTooBig' : FieldTooLongResult, 'Success' : CreateGroupSuccessResult, diff --git a/frontend/openchat-agent/src/services/user/candid/types.d.ts b/frontend/openchat-agent/src/services/user/candid/types.d.ts index d40aee26bb..fccf0c19ee 100644 --- a/frontend/openchat-agent/src/services/user/candid/types.d.ts +++ b/frontend/openchat-agent/src/services/user/candid/types.d.ts @@ -25,6 +25,7 @@ export type AccessGate = { 'UniquePerson' : null } | { 'VerifiedCredential' : VerifiedCredentialGate } | { 'SnsNeuron' : SnsNeuronGate } | { 'TokenBalance' : TokenBalanceGate } | + { 'Composite' : { 'and' : boolean, 'inner' : Array } } | { 'DiamondMember' : null } | { 'Payment' : PaymentGate } | { 'LifetimeDiamondMember' : null }; @@ -555,6 +556,7 @@ export type CreateCommunityResponse = { 'DefaultChannelsInvalid' : null } | { 'RulesTooLong' : FieldTooLongResult } | { 'DescriptionTooLong' : FieldTooLongResult } | { 'NameTooShort' : FieldTooShortResult } | + { 'AccessGateInvalid' : null } | { 'Throttled' : null } | { 'AvatarTooBig' : FieldTooLongResult } | { 'Success' : CreateCommunitySuccessResult } | @@ -582,6 +584,7 @@ export type CreateGroupResponse = { 'NameReserved' : null } | { 'RulesTooLong' : FieldTooLongResult } | { 'DescriptionTooLong' : FieldTooLongResult } | { 'NameTooShort' : FieldTooShortResult } | + { 'AccessGateInvalid' : null } | { 'Throttled' : null } | { 'AvatarTooBig' : FieldTooLongResult } | { 'Success' : CreateGroupSuccessResult } | @@ -611,6 +614,7 @@ export interface CurrentUserSummary { 'username' : string, 'is_platform_operator' : boolean, 'diamond_membership_status' : DiamondMembershipStatusFull, + 'is_unique_person' : boolean, 'user_id' : UserId, 'is_bot' : boolean, 'display_name' : [] | [string], @@ -2421,6 +2425,7 @@ export interface UserSummary { 'username' : string, 'diamond_member' : boolean, 'diamond_membership_status' : DiamondMembershipStatus, + 'is_unique_person' : boolean, 'user_id' : UserId, 'is_bot' : boolean, 'display_name' : [] | [string], @@ -2431,6 +2436,7 @@ export interface UserSummary { export interface UserSummaryStable { 'username' : string, 'diamond_membership_status' : DiamondMembershipStatus, + 'is_unique_person' : boolean, 'is_bot' : boolean, 'display_name' : [] | [string], 'avatar_id' : [] | [bigint], @@ -2473,6 +2479,7 @@ export interface VerifiedCredentialGate { export interface VerifiedCredentialGateArgs { 'credential_jwt' : string, 'ii_origin' : string, + 'credential_jwts' : Array, 'user_ii_principal' : Principal, } export type Version = number; diff --git a/frontend/openchat-agent/src/services/user/mappers.ts b/frontend/openchat-agent/src/services/user/mappers.ts index cc80f0f20b..c5ba77c139 100644 --- a/frontend/openchat-agent/src/services/user/mappers.ts +++ b/frontend/openchat-agent/src/services/user/mappers.ts @@ -304,7 +304,7 @@ export function achievementType(candid: ApiAchievement): Achievement { return "proved_unique_personhood"; } if ("DeletedMessage" in candid) { - return "deleted_messge"; + return "deleted_message"; } if ("SentText" in candid) { return "sent_text"; diff --git a/frontend/openchat-agent/src/services/user/user.client.ts b/frontend/openchat-agent/src/services/user/user.client.ts index 4ad8e5374d..e006aa77af 100644 --- a/frontend/openchat-agent/src/services/user/user.client.ts +++ b/frontend/openchat-agent/src/services/user/user.client.ts @@ -959,7 +959,8 @@ export class UserClient extends CandidService { otherUserId: string, messageId: bigint, reaction: string, - threadRootMessageIndex?: number, + threadRootMessageIndex: number | undefined, + newAchievement: boolean, ): Promise { return this.handleResponse( this.userService.add_reaction({ @@ -970,6 +971,7 @@ export class UserClient extends CandidService { correlation_id: generateUint64(), }), addRemoveReactionResponse, + newAchievement, ); } diff --git a/frontend/openchat-agent/src/services/userIndex/candid/idl.js b/frontend/openchat-agent/src/services/userIndex/candid/idl.js index 6b2a85c10c..35f5521d1e 100644 --- a/frontend/openchat-agent/src/services/userIndex/candid/idl.js +++ b/frontend/openchat-agent/src/services/userIndex/candid/idl.js @@ -87,6 +87,7 @@ export const idlFactory = ({ IDL }) => { 'diamond_membership_status' : DiamondMembershipStatusFull, 'wasm_version' : BuildVersion, 'icp_account' : AccountIdentifier, + 'is_unique_person' : IDL.Bool, 'referrals' : IDL.Vec(UserId), 'user_id' : UserId, 'display_name' : IDL.Opt(IDL.Text), @@ -218,6 +219,7 @@ export const idlFactory = ({ IDL }) => { 'username' : IDL.Text, 'diamond_member' : IDL.Bool, 'diamond_membership_status' : DiamondMembershipStatus, + 'is_unique_person' : IDL.Bool, 'user_id' : UserId, 'is_bot' : IDL.Bool, 'display_name' : IDL.Opt(IDL.Text), @@ -273,6 +275,14 @@ export const idlFactory = ({ IDL }) => { 'Success' : IDL.Null, 'UserNotFound' : IDL.Null, }); + const SubmitProofOfUniquePersonhoodArgs = IDL.Record({ + 'credential_jwt' : IDL.Text, + }); + const SubmitProofOfUniquePersonhoodResponse = IDL.Variant({ + 'Invalid' : IDL.Text, + 'Success' : IDL.Null, + 'UserNotFound' : IDL.Null, + }); const SuspectedBotsArgs = IDL.Record({ 'after' : IDL.Opt(UserId), 'count' : IDL.Nat32, @@ -332,6 +342,7 @@ export const idlFactory = ({ IDL }) => { const UserSummaryStable = IDL.Record({ 'username' : IDL.Text, 'diamond_membership_status' : DiamondMembershipStatus, + 'is_unique_person' : IDL.Bool, 'is_bot' : IDL.Bool, 'display_name' : IDL.Opt(IDL.Text), 'avatar_id' : IDL.Opt(IDL.Nat), @@ -350,6 +361,7 @@ export const idlFactory = ({ IDL }) => { 'username' : IDL.Text, 'is_platform_operator' : IDL.Bool, 'diamond_membership_status' : DiamondMembershipStatusFull, + 'is_unique_person' : IDL.Bool, 'user_id' : UserId, 'is_bot' : IDL.Bool, 'display_name' : IDL.Opt(IDL.Text), @@ -477,6 +489,11 @@ export const idlFactory = ({ IDL }) => { [], ), 'set_username' : IDL.Func([SetUsernameArgs], [SetUsernameResponse], []), + 'submit_proof_of_unique_personhood' : IDL.Func( + [SubmitProofOfUniquePersonhoodArgs], + [SubmitProofOfUniquePersonhoodResponse], + [], + ), 'suspected_bots' : IDL.Func( [SuspectedBotsArgs], [SuspectedBotsResponse], diff --git a/frontend/openchat-agent/src/services/userIndex/candid/types.d.ts b/frontend/openchat-agent/src/services/userIndex/candid/types.d.ts index 10d959bb9b..be3f9dfbee 100644 --- a/frontend/openchat-agent/src/services/userIndex/candid/types.d.ts +++ b/frontend/openchat-agent/src/services/userIndex/candid/types.d.ts @@ -7,6 +7,7 @@ export type AccessGate = { 'UniquePerson' : null } | { 'VerifiedCredential' : VerifiedCredentialGate } | { 'SnsNeuron' : SnsNeuronGate } | { 'TokenBalance' : TokenBalanceGate } | + { 'Composite' : { 'and' : boolean, 'inner' : Array } } | { 'DiamondMember' : null } | { 'Payment' : PaymentGate } | { 'LifetimeDiamondMember' : null }; @@ -457,6 +458,7 @@ export type CurrentUserResponse = { 'diamond_membership_status' : DiamondMembershipStatusFull, 'wasm_version' : BuildVersion, 'icp_account' : AccountIdentifier, + 'is_unique_person' : boolean, 'referrals' : Array, 'user_id' : UserId, 'display_name' : [] | [string], @@ -474,6 +476,7 @@ export interface CurrentUserSummary { 'username' : string, 'is_platform_operator' : boolean, 'diamond_membership_status' : DiamondMembershipStatusFull, + 'is_unique_person' : boolean, 'user_id' : UserId, 'is_bot' : boolean, 'display_name' : [] | [string], @@ -1646,6 +1649,10 @@ export interface SnsProposal { 'minimum_yes_proportion_of_exercised' : number, } export type Subaccount = Uint8Array | number[]; +export interface SubmitProofOfUniquePersonhoodArgs { 'credential_jwt' : string } +export type SubmitProofOfUniquePersonhoodResponse = { 'Invalid' : string } | + { 'Success' : null } | + { 'UserNotFound' : null }; export interface Subscription { 'value' : SubscriptionInfo, 'last_active' : TimestampMillis, @@ -1780,6 +1787,7 @@ export interface UserSummary { 'username' : string, 'diamond_member' : boolean, 'diamond_membership_status' : DiamondMembershipStatus, + 'is_unique_person' : boolean, 'user_id' : UserId, 'is_bot' : boolean, 'display_name' : [] | [string], @@ -1790,6 +1798,7 @@ export interface UserSummary { export interface UserSummaryStable { 'username' : string, 'diamond_membership_status' : DiamondMembershipStatus, + 'is_unique_person' : boolean, 'is_bot' : boolean, 'display_name' : [] | [string], 'avatar_id' : [] | [bigint], @@ -1845,6 +1854,7 @@ export interface VerifiedCredentialGate { export interface VerifiedCredentialGateArgs { 'credential_jwt' : string, 'ii_origin' : string, + 'credential_jwts' : Array, 'user_ii_principal' : Principal, } export type Version = number; @@ -1965,6 +1975,10 @@ export interface _SERVICE { SetUserUpgradeConcurrencyResponse >, 'set_username' : ActorMethod<[SetUsernameArgs], SetUsernameResponse>, + 'submit_proof_of_unique_personhood' : ActorMethod< + [SubmitProofOfUniquePersonhoodArgs], + SubmitProofOfUniquePersonhoodResponse + >, 'suspected_bots' : ActorMethod<[SuspectedBotsArgs], SuspectedBotsResponse>, 'suspend_user' : ActorMethod<[SuspendUserArgs], SuspendUserResponse>, 'unsuspend_user' : ActorMethod<[UnsuspendUserArgs], UnsuspendUserResponse>, diff --git a/frontend/openchat-client/src/openchat.ts b/frontend/openchat-client/src/openchat.ts index c255c636b9..69795e132b 100644 --- a/frontend/openchat-client/src/openchat.ts +++ b/frontend/openchat-client/src/openchat.ts @@ -408,6 +408,7 @@ import type { ChitEventsResponse, GenerateChallengeResponse, ChallengeAttempt, + Achievement, } from "openchat-shared"; import { AuthProvider, @@ -1958,12 +1959,15 @@ export class OpenChat extends OpenChatAgentWorker { localMessageUpdates.markUndeleted(messageId); } + const newAchievement = !this._liveState.globalState.achievements.has("deleted_message"); + return this.sendRequest({ kind: "deleteMessage", chatId: id, messageId, threadRootMessageIndex, asPlatformModerator, + newAchievement, }) .then((resp) => { const success = resp === "success"; @@ -2083,6 +2087,8 @@ export class OpenChat extends OpenChatAgentWorker { this.dispatchEvent(new ReactionSelected(messageId, kind)); + const newAchievement = !this._liveState.globalState.achievements.has("reacted_to_message"); + const result = ( kind == "add" ? this.sendRequest({ @@ -2093,6 +2099,7 @@ export class OpenChat extends OpenChatAgentWorker { username, displayName, threadRootMessageIndex, + newAchievement, }) : this.sendRequest({ kind: "removeReaction", @@ -3436,6 +3443,8 @@ export class OpenChat extends OpenChatAgentWorker { get(messageFiltersStore), ); + const newAchievement = this.isNewSendMessageAchievement(messageContext, eventWrapper.event); + return this.sendRequest({ kind: "sendMessage", chatType: chat.kind, @@ -3446,6 +3455,7 @@ export class OpenChat extends OpenChatAgentWorker { acceptedRules, messageFilterFailed, pin, + newAchievement, }) .then(([resp, msg]) => { if (resp.kind === "success" || resp.kind === "transfer_success") { @@ -3516,6 +3526,83 @@ export class OpenChat extends OpenChatAgentWorker { }); } + private isNewSendMessageAchievement( + message_context: MessageContext, + message: Message, + ): boolean { + let achievement: Achievement | undefined = undefined; + + switch (message.content.kind) { + case "audio_content": + achievement = "sent_audio"; + break; + case "crypto_content": + achievement = "sent_crypto"; + break; + case "file_content": + achievement = "sent_file"; + break; + case "giphy_content": + achievement = "sent_giphy"; + break; + case "image_content": + achievement = "sent_image"; + break; + case "meme_fighter_content": + achievement = "sent_meme"; + break; + case "p2p_swap_content_initial": + achievement = "sent_swap_offer"; + break; + case "poll_content": + achievement = "sent_poll"; + break; + case "prize_content_initial": + achievement = "sent_prize"; + break; + case "text_content": + achievement = "sent_text"; + break; + case "video_call_content": + achievement = "started_call"; + break; + case "video_content": + achievement = "sent_video"; + break; + } + + let achievements: Achievement[] = []; + + if (achievement !== undefined) { + achievements.push(achievement); + } + + if (message_context.chatId.kind === "direct_chat") { + achievements.push("sent_direct_message"); + } + + if (message.forwarded) { + achievements.push("forwarded_message"); + } + + if (message.repliesTo !== undefined) { + achievements.push("quote_replied"); + } else if ( + message_context.threadRootMessageIndex !== undefined && + message.messageIndex == 0 + ) { + achievements.push("replied_in_thread"); + } + + for (const a of achievements.values()) { + if (!this._liveState.globalState.achievements.has(a as Achievement)) { + return true; + } + } + + return false; + } + private rulesNeedAccepting(): boolean { const chatRules = this._liveState.currentChatRules; const chat = this._liveState.selectedChat; @@ -3796,12 +3883,15 @@ export class OpenChat extends OpenChatAgentWorker { localMessageUpdates.setBlockLevelMarkdown(msg.messageId, updatedBlockLevelMarkdown); } + const newAchievement = !this._liveState.globalState.achievements.has("edited_message"); + return this.sendRequest({ kind: "editMessage", chatId: chat.id, msg, threadRootMessageIndex: messageContext.threadRootMessageIndex, blockLevelMarkdown: updatedBlockLevelMarkdown, + newAchievement, }) .then((resp) => { if (resp !== "success") { @@ -3840,6 +3930,7 @@ export class OpenChat extends OpenChatAgentWorker { chatId: messageContext.chatId, msg, threadRootMessageIndex: messageContext.threadRootMessageIndex, + newAchievement: false, }) .then((resp) => { if (resp !== "success") { diff --git a/frontend/openchat-shared/src/domain/chit.ts b/frontend/openchat-shared/src/domain/chit.ts index 9f3a51c0a2..5aa0ca8430 100644 --- a/frontend/openchat-shared/src/domain/chit.ts +++ b/frontend/openchat-shared/src/domain/chit.ts @@ -23,71 +23,74 @@ export type MemeContestWinner = { }; export const achievements = [ - "appointed_group_mod", - "direct_chat_5", - "changed_theme", - "appointed_as_group_mod", - "favourited_chat", - "appointed_group_admin", - "received_reaction", - "voted_on_poll", - "appointed_as_group_admin", - "own_group_with_100_diamond_members", + "streak_3", + "streak_7", + "streak_14", + "streak_30", + "set_bio", + "set_avatar", + "joined_group", + "joined_community", + "sent_direct_message", + "received_direct_message", + "upgraded_to_diamond", + "set_display_name", + "upgrade_to_gold_diamond", + + "sent_text", // SUCCEEDED + "sent_image", // SUCCEEDED + "sent_file", // SUCCEEDED + "quote_replied", // SUCCEEDED + "replied_in_thread", // FAILED + "sent_poll", + "sent_crypto", + "sent_video", + "sent_audio", + "sent_giphy", + "sent_prize", + "sent_meme", + "sent_reminder", + "sent_swap_offer", + "started_call", + "edited_message", + "reacted_to_message", + "forwarded_message", + "deleted_message", + "tipped_message", + + "proved_unique_personhood", "set_community_display_name", "appointed_group_owner", - "own_group_with_10_diamond_members", "joined_gated_group_or_community", - "started_call", "appointed_as_group_owner", - "tipped_message", - "sent_giphy", "set_community_access_gate", "had_message_tipped", "swapped_from_wallet", - "edited_message", - "reacted_to_message", "accepted_swap_offer", "joined_call", - "sent_image", "enabled_disappearing_messages", - "forwarded_message", - "sent_prize", "followed_thread", - "sent_reminder", "proved_unique_personhood", - "deleted_messge", - "sent_text", - "owned_group_with_1000_diamond_members", - "sent_swap_offer", - "quote_replied", - "owned_group_with_1_diamond_member", - "sent_crypto", "pinned_message", "received_crypto", "translation_accepted", - "replied_in_thread", - "direct_chats_10", - "direct_chats_20", "set_group_access_gate", - "sent_file", - "sent_meme", - "sent_poll", - "sent_audio", "suggested_translation", - "sent_video", - "streak_3", - "streak_7", - "streak_14", - "streak_30", - "set_bio", - "set_avatar", - "joined_group", - "joined_community", - "sent_direct_message", - "received_direct_message", - "upgraded_to_diamond", - "set_display_name", - "upgrade_to_gold_diamond", + "appointed_group_mod", + "changed_theme", + "appointed_as_group_mod", + "favourited_chat", + "appointed_group_admin", + "received_reaction", + "voted_on_poll", + "appointed_as_group_admin", + "owned_group_with_1_diamond_member", + "own_group_with_10_diamond_members", + "own_group_with_100_diamond_members", + "owned_group_with_1000_diamond_members", + "direct_chat_5", + "direct_chats_10", + "direct_chats_20", ] as const; type AchievementType = typeof achievements; export type Achievement = AchievementType[number]; diff --git a/frontend/openchat-shared/src/domain/worker.ts b/frontend/openchat-shared/src/domain/worker.ts index 72e4ea9136..003981461c 100644 --- a/frontend/openchat-shared/src/domain/worker.ts +++ b/frontend/openchat-shared/src/domain/worker.ts @@ -782,8 +782,9 @@ type EditMessage = { chatId: ChatIdentifier; msg: Message; threadRootMessageIndex?: number; - kind: "editMessage"; blockLevelMarkdown?: boolean; + newAchievement: boolean; + kind: "editMessage"; }; type SendMessage = { @@ -794,6 +795,7 @@ type SendMessage = { acceptedRules: AcceptedRules | undefined; messageFilterFailed: bigint | undefined; pin: string | undefined; + newAchievement: boolean; kind: "sendMessage"; }; @@ -848,6 +850,7 @@ type AddReaction = { username: string; displayName: string | undefined; threadRootMessageIndex?: number; + newAchievement: boolean; kind: "addReaction"; }; @@ -856,6 +859,7 @@ type DeleteMessage = { messageId: bigint; threadRootMessageIndex?: number; asPlatformModerator?: boolean; + newAchievement: boolean; kind: "deleteMessage"; }; diff --git a/frontend/openchat-worker/src/worker.ts b/frontend/openchat-worker/src/worker.ts index 14b3ec69ac..fcb73715c3 100644 --- a/frontend/openchat-worker/src/worker.ts +++ b/frontend/openchat-worker/src/worker.ts @@ -538,6 +538,7 @@ self.addEventListener("message", (msg: MessageEvent) => payload.messageId, payload.threadRootMessageIndex, payload.asPlatformModerator, + payload.newAchievement, ), ); break; @@ -565,6 +566,7 @@ self.addEventListener("message", (msg: MessageEvent) => payload.username, payload.displayName, payload.threadRootMessageIndex, + payload.newAchievement, ), ); break; @@ -646,6 +648,7 @@ self.addEventListener("message", (msg: MessageEvent) => payload.acceptedRules, payload.messageFilterFailed, payload.pin, + payload.newAchievement, ), ); break; @@ -659,6 +662,7 @@ self.addEventListener("message", (msg: MessageEvent) => payload.msg, payload.threadRootMessageIndex, payload.blockLevelMarkdown, + payload.newAchievement, ), ); break; From f1a274f08d747bb6a477cf63f56d538d5c9d1a5e Mon Sep 17 00:00:00 2001 From: megrogan Date: Wed, 17 Jul 2024 10:05:30 +0100 Subject: [PATCH 2/5] Fixes --- .../canisters/community/impl/src/updates/edit_message.rs | 2 +- backend/canisters/group/impl/src/updates/edit_message.rs | 2 +- backend/canisters/user/impl/src/updates/edit_message.rs | 2 +- backend/libraries/types/src/message_content.rs | 8 +++++++- 4 files changed, 10 insertions(+), 4 deletions(-) diff --git a/backend/canisters/community/impl/src/updates/edit_message.rs b/backend/canisters/community/impl/src/updates/edit_message.rs index 4ea2e65ac9..32df2034db 100644 --- a/backend/canisters/community/impl/src/updates/edit_message.rs +++ b/backend/canisters/community/impl/src/updates/edit_message.rs @@ -45,7 +45,7 @@ fn edit_message_impl(args: Args, state: &mut RuntimeState) -> Response { handle_activity_notification(state); if args.new_achievement { - state.notify_user_of_achievements(sender, vec![Achievement::ReactedToMessage]); + state.notify_user_of_achievements(sender, vec![Achievement::EditedMessage]); } Success diff --git a/backend/canisters/group/impl/src/updates/edit_message.rs b/backend/canisters/group/impl/src/updates/edit_message.rs index e38cdcc8f5..72b09cf1ca 100644 --- a/backend/canisters/group/impl/src/updates/edit_message.rs +++ b/backend/canisters/group/impl/src/updates/edit_message.rs @@ -48,7 +48,7 @@ fn edit_message_impl(args: Args, state: &mut RuntimeState) -> Response { handle_activity_notification(state); if args.new_achievement { - state.notify_user_of_achievements(sender, vec![Achievement::ReactedToMessage]); + state.notify_user_of_achievements(sender, vec![Achievement::EditedMessage]); } Success diff --git a/backend/canisters/user/impl/src/updates/edit_message.rs b/backend/canisters/user/impl/src/updates/edit_message.rs index d4d54a08ab..a88ace34fb 100644 --- a/backend/canisters/user/impl/src/updates/edit_message.rs +++ b/backend/canisters/user/impl/src/updates/edit_message.rs @@ -55,7 +55,7 @@ fn edit_message_impl(args: Args, state: &mut RuntimeState) -> Response { })), ); - state.data.award_achievement_and_notify(Achievement::ReactedToMessage, now); + state.data.award_achievement_and_notify(Achievement::EditedMessage, now); } Success } diff --git a/backend/libraries/types/src/message_content.rs b/backend/libraries/types/src/message_content.rs index 666e1be568..21e1d26dfc 100644 --- a/backend/libraries/types/src/message_content.rs +++ b/backend/libraries/types/src/message_content.rs @@ -218,7 +218,13 @@ impl MessageContent { MessageContent::ReportedMessage(_) => None, MessageContent::P2PSwap(_) => Some(Achievement::SentP2PSwapOffer), MessageContent::VideoCall(_) => Some(Achievement::StartedCall), - MessageContent::Custom(_) => None, + MessageContent::Custom(c) => { + if c.kind == "meme_fighter" { + Some(Achievement::SentMeme) + } else { + None + } + } } } From 40eb87310404fb2c1bb7181364d5ac4394c59eb8 Mon Sep 17 00:00:00 2001 From: megrogan Date: Wed, 17 Jul 2024 10:14:00 +0100 Subject: [PATCH 3/5] Remove `is_unique_person` field from gen'ed code --- .../openchat-agent/src/services/community/candid/types.d.ts | 3 --- frontend/openchat-agent/src/services/group/candid/types.d.ts | 3 --- .../openchat-agent/src/services/groupIndex/candid/types.d.ts | 3 --- .../src/services/localUserIndex/candid/types.d.ts | 3 --- .../src/services/notifications/candid/types.d.ts | 3 --- frontend/openchat-agent/src/services/online/candid/types.d.ts | 3 --- .../src/services/proposalsBot/candid/types.d.ts | 3 --- .../openchat-agent/src/services/registry/candid/types.d.ts | 3 --- .../src/services/storageBucket/candid/types.d.ts | 3 --- .../src/services/storageIndex/candid/types.d.ts | 3 --- .../src/services/translations/candid/types.d.ts | 3 --- frontend/openchat-agent/src/services/user/candid/types.d.ts | 3 --- frontend/openchat-agent/src/services/userIndex/candid/idl.js | 4 ---- .../openchat-agent/src/services/userIndex/candid/types.d.ts | 4 ---- 14 files changed, 44 deletions(-) diff --git a/frontend/openchat-agent/src/services/community/candid/types.d.ts b/frontend/openchat-agent/src/services/community/candid/types.d.ts index 333c681823..cae1a65f2d 100644 --- a/frontend/openchat-agent/src/services/community/candid/types.d.ts +++ b/frontend/openchat-agent/src/services/community/candid/types.d.ts @@ -622,7 +622,6 @@ export interface CurrentUserSummary { 'username' : string, 'is_platform_operator' : boolean, 'diamond_membership_status' : DiamondMembershipStatusFull, - 'is_unique_person' : boolean, 'user_id' : UserId, 'is_bot' : boolean, 'display_name' : [] | [string], @@ -2363,7 +2362,6 @@ export interface UserSummary { 'username' : string, 'diamond_member' : boolean, 'diamond_membership_status' : DiamondMembershipStatus, - 'is_unique_person' : boolean, 'user_id' : UserId, 'is_bot' : boolean, 'display_name' : [] | [string], @@ -2374,7 +2372,6 @@ export interface UserSummary { export interface UserSummaryStable { 'username' : string, 'diamond_membership_status' : DiamondMembershipStatus, - 'is_unique_person' : boolean, 'is_bot' : boolean, 'display_name' : [] | [string], 'avatar_id' : [] | [bigint], diff --git a/frontend/openchat-agent/src/services/group/candid/types.d.ts b/frontend/openchat-agent/src/services/group/candid/types.d.ts index 0382261745..89c995af3f 100644 --- a/frontend/openchat-agent/src/services/group/candid/types.d.ts +++ b/frontend/openchat-agent/src/services/group/candid/types.d.ts @@ -522,7 +522,6 @@ export interface CurrentUserSummary { 'username' : string, 'is_platform_operator' : boolean, 'diamond_membership_status' : DiamondMembershipStatusFull, - 'is_unique_person' : boolean, 'user_id' : UserId, 'is_bot' : boolean, 'display_name' : [] | [string], @@ -2054,7 +2053,6 @@ export interface UserSummary { 'username' : string, 'diamond_member' : boolean, 'diamond_membership_status' : DiamondMembershipStatus, - 'is_unique_person' : boolean, 'user_id' : UserId, 'is_bot' : boolean, 'display_name' : [] | [string], @@ -2065,7 +2063,6 @@ export interface UserSummary { export interface UserSummaryStable { 'username' : string, 'diamond_membership_status' : DiamondMembershipStatus, - 'is_unique_person' : boolean, 'is_bot' : boolean, 'display_name' : [] | [string], 'avatar_id' : [] | [bigint], diff --git a/frontend/openchat-agent/src/services/groupIndex/candid/types.d.ts b/frontend/openchat-agent/src/services/groupIndex/candid/types.d.ts index fffbb072fd..70d4b9e78a 100644 --- a/frontend/openchat-agent/src/services/groupIndex/candid/types.d.ts +++ b/frontend/openchat-agent/src/services/groupIndex/candid/types.d.ts @@ -445,7 +445,6 @@ export interface CurrentUserSummary { 'username' : string, 'is_platform_operator' : boolean, 'diamond_membership_status' : DiamondMembershipStatusFull, - 'is_unique_person' : boolean, 'user_id' : UserId, 'is_bot' : boolean, 'display_name' : [] | [string], @@ -1766,7 +1765,6 @@ export interface UserSummary { 'username' : string, 'diamond_member' : boolean, 'diamond_membership_status' : DiamondMembershipStatus, - 'is_unique_person' : boolean, 'user_id' : UserId, 'is_bot' : boolean, 'display_name' : [] | [string], @@ -1777,7 +1775,6 @@ export interface UserSummary { export interface UserSummaryStable { 'username' : string, 'diamond_membership_status' : DiamondMembershipStatus, - 'is_unique_person' : boolean, 'is_bot' : boolean, 'display_name' : [] | [string], 'avatar_id' : [] | [bigint], diff --git a/frontend/openchat-agent/src/services/localUserIndex/candid/types.d.ts b/frontend/openchat-agent/src/services/localUserIndex/candid/types.d.ts index b5daeb354c..9d921185b7 100644 --- a/frontend/openchat-agent/src/services/localUserIndex/candid/types.d.ts +++ b/frontend/openchat-agent/src/services/localUserIndex/candid/types.d.ts @@ -465,7 +465,6 @@ export interface CurrentUserSummary { 'username' : string, 'is_platform_operator' : boolean, 'diamond_membership_status' : DiamondMembershipStatusFull, - 'is_unique_person' : boolean, 'user_id' : UserId, 'is_bot' : boolean, 'display_name' : [] | [string], @@ -1771,7 +1770,6 @@ export interface UserSummary { 'username' : string, 'diamond_member' : boolean, 'diamond_membership_status' : DiamondMembershipStatus, - 'is_unique_person' : boolean, 'user_id' : UserId, 'is_bot' : boolean, 'display_name' : [] | [string], @@ -1782,7 +1780,6 @@ export interface UserSummary { export interface UserSummaryStable { 'username' : string, 'diamond_membership_status' : DiamondMembershipStatus, - 'is_unique_person' : boolean, 'is_bot' : boolean, 'display_name' : [] | [string], 'avatar_id' : [] | [bigint], diff --git a/frontend/openchat-agent/src/services/notifications/candid/types.d.ts b/frontend/openchat-agent/src/services/notifications/candid/types.d.ts index 7fa20a90da..bd54ac37f0 100644 --- a/frontend/openchat-agent/src/services/notifications/candid/types.d.ts +++ b/frontend/openchat-agent/src/services/notifications/candid/types.d.ts @@ -425,7 +425,6 @@ export interface CurrentUserSummary { 'username' : string, 'is_platform_operator' : boolean, 'diamond_membership_status' : DiamondMembershipStatusFull, - 'is_unique_person' : boolean, 'user_id' : UserId, 'is_bot' : boolean, 'display_name' : [] | [string], @@ -1589,7 +1588,6 @@ export interface UserSummary { 'username' : string, 'diamond_member' : boolean, 'diamond_membership_status' : DiamondMembershipStatus, - 'is_unique_person' : boolean, 'user_id' : UserId, 'is_bot' : boolean, 'display_name' : [] | [string], @@ -1600,7 +1598,6 @@ export interface UserSummary { export interface UserSummaryStable { 'username' : string, 'diamond_membership_status' : DiamondMembershipStatus, - 'is_unique_person' : boolean, 'is_bot' : boolean, 'display_name' : [] | [string], 'avatar_id' : [] | [bigint], diff --git a/frontend/openchat-agent/src/services/online/candid/types.d.ts b/frontend/openchat-agent/src/services/online/candid/types.d.ts index 5f5a37e890..57fffe31b5 100644 --- a/frontend/openchat-agent/src/services/online/candid/types.d.ts +++ b/frontend/openchat-agent/src/services/online/candid/types.d.ts @@ -425,7 +425,6 @@ export interface CurrentUserSummary { 'username' : string, 'is_platform_operator' : boolean, 'diamond_membership_status' : DiamondMembershipStatusFull, - 'is_unique_person' : boolean, 'user_id' : UserId, 'is_bot' : boolean, 'display_name' : [] | [string], @@ -1589,7 +1588,6 @@ export interface UserSummary { 'username' : string, 'diamond_member' : boolean, 'diamond_membership_status' : DiamondMembershipStatus, - 'is_unique_person' : boolean, 'user_id' : UserId, 'is_bot' : boolean, 'display_name' : [] | [string], @@ -1600,7 +1598,6 @@ export interface UserSummary { export interface UserSummaryStable { 'username' : string, 'diamond_membership_status' : DiamondMembershipStatus, - 'is_unique_person' : boolean, 'is_bot' : boolean, 'display_name' : [] | [string], 'avatar_id' : [] | [bigint], diff --git a/frontend/openchat-agent/src/services/proposalsBot/candid/types.d.ts b/frontend/openchat-agent/src/services/proposalsBot/candid/types.d.ts index 06c1bdb8a3..db653da53d 100644 --- a/frontend/openchat-agent/src/services/proposalsBot/candid/types.d.ts +++ b/frontend/openchat-agent/src/services/proposalsBot/candid/types.d.ts @@ -425,7 +425,6 @@ export interface CurrentUserSummary { 'username' : string, 'is_platform_operator' : boolean, 'diamond_membership_status' : DiamondMembershipStatusFull, - 'is_unique_person' : boolean, 'user_id' : UserId, 'is_bot' : boolean, 'display_name' : [] | [string], @@ -1613,7 +1612,6 @@ export interface UserSummary { 'username' : string, 'diamond_member' : boolean, 'diamond_membership_status' : DiamondMembershipStatus, - 'is_unique_person' : boolean, 'user_id' : UserId, 'is_bot' : boolean, 'display_name' : [] | [string], @@ -1624,7 +1622,6 @@ export interface UserSummary { export interface UserSummaryStable { 'username' : string, 'diamond_membership_status' : DiamondMembershipStatus, - 'is_unique_person' : boolean, 'is_bot' : boolean, 'display_name' : [] | [string], 'avatar_id' : [] | [bigint], diff --git a/frontend/openchat-agent/src/services/registry/candid/types.d.ts b/frontend/openchat-agent/src/services/registry/candid/types.d.ts index 7d60476d5b..538e7fb4e2 100644 --- a/frontend/openchat-agent/src/services/registry/candid/types.d.ts +++ b/frontend/openchat-agent/src/services/registry/candid/types.d.ts @@ -431,7 +431,6 @@ export interface CurrentUserSummary { 'username' : string, 'is_platform_operator' : boolean, 'diamond_membership_status' : DiamondMembershipStatusFull, - 'is_unique_person' : boolean, 'user_id' : UserId, 'is_bot' : boolean, 'display_name' : [] | [string], @@ -1634,7 +1633,6 @@ export interface UserSummary { 'username' : string, 'diamond_member' : boolean, 'diamond_membership_status' : DiamondMembershipStatus, - 'is_unique_person' : boolean, 'user_id' : UserId, 'is_bot' : boolean, 'display_name' : [] | [string], @@ -1645,7 +1643,6 @@ export interface UserSummary { export interface UserSummaryStable { 'username' : string, 'diamond_membership_status' : DiamondMembershipStatus, - 'is_unique_person' : boolean, 'is_bot' : boolean, 'display_name' : [] | [string], 'avatar_id' : [] | [bigint], diff --git a/frontend/openchat-agent/src/services/storageBucket/candid/types.d.ts b/frontend/openchat-agent/src/services/storageBucket/candid/types.d.ts index 010872929a..bf01d092b2 100644 --- a/frontend/openchat-agent/src/services/storageBucket/candid/types.d.ts +++ b/frontend/openchat-agent/src/services/storageBucket/candid/types.d.ts @@ -425,7 +425,6 @@ export interface CurrentUserSummary { 'username' : string, 'is_platform_operator' : boolean, 'diamond_membership_status' : DiamondMembershipStatusFull, - 'is_unique_person' : boolean, 'user_id' : UserId, 'is_bot' : boolean, 'display_name' : [] | [string], @@ -1632,7 +1631,6 @@ export interface UserSummary { 'username' : string, 'diamond_member' : boolean, 'diamond_membership_status' : DiamondMembershipStatus, - 'is_unique_person' : boolean, 'user_id' : UserId, 'is_bot' : boolean, 'display_name' : [] | [string], @@ -1643,7 +1641,6 @@ export interface UserSummary { export interface UserSummaryStable { 'username' : string, 'diamond_membership_status' : DiamondMembershipStatus, - 'is_unique_person' : boolean, 'is_bot' : boolean, 'display_name' : [] | [string], 'avatar_id' : [] | [bigint], diff --git a/frontend/openchat-agent/src/services/storageIndex/candid/types.d.ts b/frontend/openchat-agent/src/services/storageIndex/candid/types.d.ts index fdf91fbb71..f7fdb807b8 100644 --- a/frontend/openchat-agent/src/services/storageIndex/candid/types.d.ts +++ b/frontend/openchat-agent/src/services/storageIndex/candid/types.d.ts @@ -455,7 +455,6 @@ export interface CurrentUserSummary { 'username' : string, 'is_platform_operator' : boolean, 'diamond_membership_status' : DiamondMembershipStatusFull, - 'is_unique_person' : boolean, 'user_id' : UserId, 'is_bot' : boolean, 'display_name' : [] | [string], @@ -1626,7 +1625,6 @@ export interface UserSummary { 'username' : string, 'diamond_member' : boolean, 'diamond_membership_status' : DiamondMembershipStatus, - 'is_unique_person' : boolean, 'user_id' : UserId, 'is_bot' : boolean, 'display_name' : [] | [string], @@ -1637,7 +1635,6 @@ export interface UserSummary { export interface UserSummaryStable { 'username' : string, 'diamond_membership_status' : DiamondMembershipStatus, - 'is_unique_person' : boolean, 'is_bot' : boolean, 'display_name' : [] | [string], 'avatar_id' : [] | [bigint], diff --git a/frontend/openchat-agent/src/services/translations/candid/types.d.ts b/frontend/openchat-agent/src/services/translations/candid/types.d.ts index ae0ec3b262..4ac362e861 100644 --- a/frontend/openchat-agent/src/services/translations/candid/types.d.ts +++ b/frontend/openchat-agent/src/services/translations/candid/types.d.ts @@ -437,7 +437,6 @@ export interface CurrentUserSummary { 'username' : string, 'is_platform_operator' : boolean, 'diamond_membership_status' : DiamondMembershipStatusFull, - 'is_unique_person' : boolean, 'user_id' : UserId, 'is_bot' : boolean, 'display_name' : [] | [string], @@ -1633,7 +1632,6 @@ export interface UserSummary { 'username' : string, 'diamond_member' : boolean, 'diamond_membership_status' : DiamondMembershipStatus, - 'is_unique_person' : boolean, 'user_id' : UserId, 'is_bot' : boolean, 'display_name' : [] | [string], @@ -1644,7 +1642,6 @@ export interface UserSummary { export interface UserSummaryStable { 'username' : string, 'diamond_membership_status' : DiamondMembershipStatus, - 'is_unique_person' : boolean, 'is_bot' : boolean, 'display_name' : [] | [string], 'avatar_id' : [] | [bigint], diff --git a/frontend/openchat-agent/src/services/user/candid/types.d.ts b/frontend/openchat-agent/src/services/user/candid/types.d.ts index fccf0c19ee..1bcf1865c4 100644 --- a/frontend/openchat-agent/src/services/user/candid/types.d.ts +++ b/frontend/openchat-agent/src/services/user/candid/types.d.ts @@ -614,7 +614,6 @@ export interface CurrentUserSummary { 'username' : string, 'is_platform_operator' : boolean, 'diamond_membership_status' : DiamondMembershipStatusFull, - 'is_unique_person' : boolean, 'user_id' : UserId, 'is_bot' : boolean, 'display_name' : [] | [string], @@ -2425,7 +2424,6 @@ export interface UserSummary { 'username' : string, 'diamond_member' : boolean, 'diamond_membership_status' : DiamondMembershipStatus, - 'is_unique_person' : boolean, 'user_id' : UserId, 'is_bot' : boolean, 'display_name' : [] | [string], @@ -2436,7 +2434,6 @@ export interface UserSummary { export interface UserSummaryStable { 'username' : string, 'diamond_membership_status' : DiamondMembershipStatus, - 'is_unique_person' : boolean, 'is_bot' : boolean, 'display_name' : [] | [string], 'avatar_id' : [] | [bigint], diff --git a/frontend/openchat-agent/src/services/userIndex/candid/idl.js b/frontend/openchat-agent/src/services/userIndex/candid/idl.js index 35f5521d1e..682dcf6f91 100644 --- a/frontend/openchat-agent/src/services/userIndex/candid/idl.js +++ b/frontend/openchat-agent/src/services/userIndex/candid/idl.js @@ -87,7 +87,6 @@ export const idlFactory = ({ IDL }) => { 'diamond_membership_status' : DiamondMembershipStatusFull, 'wasm_version' : BuildVersion, 'icp_account' : AccountIdentifier, - 'is_unique_person' : IDL.Bool, 'referrals' : IDL.Vec(UserId), 'user_id' : UserId, 'display_name' : IDL.Opt(IDL.Text), @@ -219,7 +218,6 @@ export const idlFactory = ({ IDL }) => { 'username' : IDL.Text, 'diamond_member' : IDL.Bool, 'diamond_membership_status' : DiamondMembershipStatus, - 'is_unique_person' : IDL.Bool, 'user_id' : UserId, 'is_bot' : IDL.Bool, 'display_name' : IDL.Opt(IDL.Text), @@ -342,7 +340,6 @@ export const idlFactory = ({ IDL }) => { const UserSummaryStable = IDL.Record({ 'username' : IDL.Text, 'diamond_membership_status' : DiamondMembershipStatus, - 'is_unique_person' : IDL.Bool, 'is_bot' : IDL.Bool, 'display_name' : IDL.Opt(IDL.Text), 'avatar_id' : IDL.Opt(IDL.Nat), @@ -361,7 +358,6 @@ export const idlFactory = ({ IDL }) => { 'username' : IDL.Text, 'is_platform_operator' : IDL.Bool, 'diamond_membership_status' : DiamondMembershipStatusFull, - 'is_unique_person' : IDL.Bool, 'user_id' : UserId, 'is_bot' : IDL.Bool, 'display_name' : IDL.Opt(IDL.Text), diff --git a/frontend/openchat-agent/src/services/userIndex/candid/types.d.ts b/frontend/openchat-agent/src/services/userIndex/candid/types.d.ts index be3f9dfbee..64915527f5 100644 --- a/frontend/openchat-agent/src/services/userIndex/candid/types.d.ts +++ b/frontend/openchat-agent/src/services/userIndex/candid/types.d.ts @@ -458,7 +458,6 @@ export type CurrentUserResponse = { 'diamond_membership_status' : DiamondMembershipStatusFull, 'wasm_version' : BuildVersion, 'icp_account' : AccountIdentifier, - 'is_unique_person' : boolean, 'referrals' : Array, 'user_id' : UserId, 'display_name' : [] | [string], @@ -476,7 +475,6 @@ export interface CurrentUserSummary { 'username' : string, 'is_platform_operator' : boolean, 'diamond_membership_status' : DiamondMembershipStatusFull, - 'is_unique_person' : boolean, 'user_id' : UserId, 'is_bot' : boolean, 'display_name' : [] | [string], @@ -1787,7 +1785,6 @@ export interface UserSummary { 'username' : string, 'diamond_member' : boolean, 'diamond_membership_status' : DiamondMembershipStatus, - 'is_unique_person' : boolean, 'user_id' : UserId, 'is_bot' : boolean, 'display_name' : [] | [string], @@ -1798,7 +1795,6 @@ export interface UserSummary { export interface UserSummaryStable { 'username' : string, 'diamond_membership_status' : DiamondMembershipStatus, - 'is_unique_person' : boolean, 'is_bot' : boolean, 'display_name' : [] | [string], 'avatar_id' : [] | [bigint], From 919e8f895d3f621c5efd03b3220f67e6ae618a26 Mon Sep 17 00:00:00 2001 From: megrogan Date: Wed, 17 Jul 2024 11:02:28 +0100 Subject: [PATCH 4/5] Order achievements logically --- frontend/openchat-client/src/openchat.ts | 2 +- frontend/openchat-shared/src/domain/chit.ts | 75 ++++++++++----------- 2 files changed, 37 insertions(+), 40 deletions(-) diff --git a/frontend/openchat-client/src/openchat.ts b/frontend/openchat-client/src/openchat.ts index 69795e132b..94123a6bbd 100644 --- a/frontend/openchat-client/src/openchat.ts +++ b/frontend/openchat-client/src/openchat.ts @@ -3571,7 +3571,7 @@ export class OpenChat extends OpenChatAgentWorker { break; } - let achievements: Achievement[] = []; + const achievements: Achievement[] = []; if (achievement !== undefined) { achievements.push(achievement); diff --git a/frontend/openchat-shared/src/domain/chit.ts b/frontend/openchat-shared/src/domain/chit.ts index 5aa0ca8430..7b8471473d 100644 --- a/frontend/openchat-shared/src/domain/chit.ts +++ b/frontend/openchat-shared/src/domain/chit.ts @@ -23,25 +23,22 @@ export type MemeContestWinner = { }; export const achievements = [ - "streak_3", - "streak_7", - "streak_14", - "streak_30", + "joined_community", + "joined_group", + "sent_text", + "reacted_to_message", "set_bio", "set_avatar", - "joined_group", - "joined_community", "sent_direct_message", "received_direct_message", - "upgraded_to_diamond", - "set_display_name", - "upgrade_to_gold_diamond", - - "sent_text", // SUCCEEDED - "sent_image", // SUCCEEDED - "sent_file", // SUCCEEDED - "quote_replied", // SUCCEEDED - "replied_in_thread", // FAILED + "edited_message", + "deleted_message", + "forwarded_message", + "tipped_message", + "sent_image", + "started_call", + "joined_call", + "sent_file", "sent_poll", "sent_crypto", "sent_video", @@ -49,48 +46,48 @@ export const achievements = [ "sent_giphy", "sent_prize", "sent_meme", - "sent_reminder", + "quote_replied", + "replied_in_thread", + "changed_theme", + "upgraded_to_diamond", + "set_community_display_name", + "set_display_name", "sent_swap_offer", - "started_call", - "edited_message", - "reacted_to_message", - "forwarded_message", - "deleted_message", - "tipped_message", - + "streak_3", + "streak_7", + "streak_14", + "streak_30", + "sent_reminder", "proved_unique_personhood", - "set_community_display_name", - "appointed_group_owner", + "pinned_message", + "favourited_chat", + "received_reaction", + "voted_on_poll", + "enabled_disappearing_messages", "joined_gated_group_or_community", - "appointed_as_group_owner", "set_community_access_gate", "had_message_tipped", "swapped_from_wallet", "accepted_swap_offer", - "joined_call", - "enabled_disappearing_messages", "followed_thread", - "proved_unique_personhood", - "pinned_message", "received_crypto", + "direct_chat_5", + "direct_chats_10", + "direct_chats_20", + "suggested_translation", "translation_accepted", "set_group_access_gate", - "suggested_translation", "appointed_group_mod", - "changed_theme", - "appointed_as_group_mod", - "favourited_chat", "appointed_group_admin", - "received_reaction", - "voted_on_poll", + "appointed_group_owner", + "appointed_as_group_mod", "appointed_as_group_admin", + "appointed_as_group_owner", + "upgrade_to_gold_diamond", "owned_group_with_1_diamond_member", "own_group_with_10_diamond_members", "own_group_with_100_diamond_members", "owned_group_with_1000_diamond_members", - "direct_chat_5", - "direct_chats_10", - "direct_chats_20", ] as const; type AchievementType = typeof achievements; export type Achievement = AchievementType[number]; From 57023abe58f17e2127c56c69b09ea9f786d45846 Mon Sep 17 00:00:00 2001 From: megrogan Date: Wed, 17 Jul 2024 11:24:40 +0100 Subject: [PATCH 5/5] Typo --- frontend/app/src/i18n/cn.json | 4 ++-- frontend/app/src/i18n/de.json | 4 ++-- frontend/app/src/i18n/en.json | 4 ++-- frontend/app/src/i18n/es.json | 4 ++-- frontend/app/src/i18n/fr.json | 4 ++-- frontend/app/src/i18n/hi.json | 4 ++-- frontend/app/src/i18n/it.json | 4 ++-- frontend/app/src/i18n/iw.json | 4 ++-- frontend/app/src/i18n/jp.json | 4 ++-- frontend/app/src/i18n/ru.json | 4 ++-- frontend/app/src/i18n/uk.json | 4 ++-- frontend/app/src/i18n/vi.json | 4 ++-- frontend/openchat-agent/src/services/user/mappers.ts | 4 ++-- frontend/openchat-shared/src/domain/chit.ts | 4 ++-- 14 files changed, 28 insertions(+), 28 deletions(-) diff --git a/frontend/app/src/i18n/cn.json b/frontend/app/src/i18n/cn.json index 7b80567a37..6dfb7831db 100644 --- a/frontend/app/src/i18n/cn.json +++ b/frontend/app/src/i18n/cn.json @@ -541,8 +541,8 @@ "joined_community": "加入你的第一个社区", "joined_gated_group_or_community": "加入你的第一个封闭群组/频道", "joined_group": "加入了你的第一个群组", - "own_group_with_10_diamond_members": "拥有第一个群组/社区,其中有 10 名经过验证的成员", - "own_group_with_100_diamond_members": "拥有第一个拥有 100 名经过验证的成员的群组/社区", + "owned_group_with_10_diamond_members": "拥有第一个群组/社区,其中有 10 名经过验证的成员", + "owned_group_with_100_diamond_members": "拥有第一个拥有 100 名经过验证的成员的群组/社区", "owned_group_with_1_diamond_member": "拥有第一个群组/社区,其中有 1 名经过验证的成员", "owned_group_with_1000_diamond_members": "拥有第一个拥有 1000 名经过验证的成员的群组/社区", "percentageComplete": "{perc}% 完成", diff --git a/frontend/app/src/i18n/de.json b/frontend/app/src/i18n/de.json index 217f91de04..bb78e3a449 100644 --- a/frontend/app/src/i18n/de.json +++ b/frontend/app/src/i18n/de.json @@ -541,8 +541,8 @@ "joined_community": "Ihrer ersten Community beigetreten", "joined_gated_group_or_community": "Ihrer ersten geschlossenen Gruppe/Ihrem ersten geschlossenen Kanal beigetreten", "joined_group": "Ihrer ersten Gruppe beigetreten", - "own_group_with_10_diamond_members": "Besitzen Sie Ihre erste Gruppe/Community mit 10 verifizierten Mitgliedern.", - "own_group_with_100_diamond_members": "Besitzen Sie Ihre erste Gruppe/Community mit 100 verifizierten Mitgliedern.", + "owned_group_with_10_diamond_members": "Besitzen Sie Ihre erste Gruppe/Community mit 10 verifizierten Mitgliedern.", + "owned_group_with_100_diamond_members": "Besitzen Sie Ihre erste Gruppe/Community mit 100 verifizierten Mitgliedern.", "owned_group_with_1_diamond_member": "Besitzen Sie Ihre erste Gruppe/Community mit 1 verifiziertem Mitglied.", "owned_group_with_1000_diamond_members": "Besitzen Sie Ihre erste Gruppe/Community mit 1000 verifizierten Mitgliedern.", "percentageComplete": "{perc} % abgeschlossen", diff --git a/frontend/app/src/i18n/en.json b/frontend/app/src/i18n/en.json index 1b5b3963df..cf1f7174ea 100644 --- a/frontend/app/src/i18n/en.json +++ b/frontend/app/src/i18n/en.json @@ -541,8 +541,8 @@ "joined_community": "Joined your first community", "joined_gated_group_or_community": "Joined your first gated group/channel", "joined_group": "Joined your first group", - "own_group_with_10_diamond_members": "Owned your first group/community with 10 verified members", - "own_group_with_100_diamond_members": "Owned your first group/community with 100 verified members", + "owned_group_with_10_diamond_members": "Owned your first group/community with 10 verified members", + "owned_group_with_100_diamond_members": "Owned your first group/community with 100 verified members", "owned_group_with_1_diamond_member": "Owned your first group/community with 1 verified member", "owned_group_with_1000_diamond_members": "Owned your first group/community with 1000 verified members", "percentageComplete": "{perc}% Complete", diff --git a/frontend/app/src/i18n/es.json b/frontend/app/src/i18n/es.json index 54a873dab5..a7d9ba0857 100644 --- a/frontend/app/src/i18n/es.json +++ b/frontend/app/src/i18n/es.json @@ -541,8 +541,8 @@ "joined_community": "Se unió a su primera comunidad", "joined_gated_group_or_community": "Se unió a su primer grupo/canal privado", "joined_group": "Se unió a su primer grupo", - "own_group_with_10_diamond_members": "Fue propietario de su primer grupo/comunidad con 10 miembros verificados", - "own_group_with_100_diamond_members": "Sea propietario de su primer grupo/comunidad con 100 miembros verificados", + "owned_group_with_10_diamond_members": "Fue propietario de su primer grupo/comunidad con 10 miembros verificados", + "owned_group_with_100_diamond_members": "Sea propietario de su primer grupo/comunidad con 100 miembros verificados", "owned_group_with_1_diamond_member": "Era propietario de su primer grupo/comunidad con 1 miembro verificado", "owned_group_with_1000_diamond_members": "Fue propietario de su primer grupo/comunidad con 1000 miembros verificados", "percentageComplete": "{perc}% completado", diff --git a/frontend/app/src/i18n/fr.json b/frontend/app/src/i18n/fr.json index ae7c999628..7fe8bc53d7 100644 --- a/frontend/app/src/i18n/fr.json +++ b/frontend/app/src/i18n/fr.json @@ -541,8 +541,8 @@ "joined_community": "Vous avez rejoint votre première communauté", "joined_gated_group_or_community": "Vous avez rejoint votre premier groupe/canal fermé", "joined_group": "Vous avez rejoint votre premier groupe", - "own_group_with_10_diamond_members": "Posséder votre premier groupe/communauté avec 10 membres vérifiés", - "own_group_with_100_diamond_members": "Posséder votre premier groupe/communauté avec 100 membres vérifiés", + "owned_group_with_10_diamond_members": "Posséder votre premier groupe/communauté avec 10 membres vérifiés", + "owned_group_with_100_diamond_members": "Posséder votre premier groupe/communauté avec 100 membres vérifiés", "owned_group_with_1_diamond_member": "Posséder votre premier groupe/communauté avec 1 membre vérifié", "owned_group_with_1000_diamond_members": "Posséder votre premier groupe/communauté avec 1 000 membres vérifiés", "percentageComplete": "{perc} % terminé", diff --git a/frontend/app/src/i18n/hi.json b/frontend/app/src/i18n/hi.json index 96877bdbde..bd53e508db 100644 --- a/frontend/app/src/i18n/hi.json +++ b/frontend/app/src/i18n/hi.json @@ -541,8 +541,8 @@ "joined_community": "अपने पहले समुदाय में शामिल हुए", "joined_gated_group_or_community": "अपने पहले गेटेड ग्रुप/चैनल में शामिल हुए", "joined_group": "अपने पहले समूह में शामिल हो गए", - "own_group_with_10_diamond_members": "10 सत्यापित सदस्यों के साथ अपना पहला समूह/समुदाय बनाएं", - "own_group_with_100_diamond_members": "100 सत्यापित सदस्यों के साथ अपना पहला समूह/समुदाय बनाएं", + "owned_group_with_10_diamond_members": "10 सत्यापित सदस्यों के साथ अपना पहला समूह/समुदाय बनाएं", + "owned_group_with_100_diamond_members": "100 सत्यापित सदस्यों के साथ अपना पहला समूह/समुदाय बनाएं", "owned_group_with_1_diamond_member": "1 सत्यापित सदस्य के साथ अपना पहला समूह/समुदाय बनाएं", "owned_group_with_1000_diamond_members": "1000 सत्यापित सदस्यों के साथ अपना पहला समूह/समुदाय बनाएं", "percentageComplete": "{perc}% पूर्ण", diff --git a/frontend/app/src/i18n/it.json b/frontend/app/src/i18n/it.json index 7f2f4a7f8a..f2283357ad 100644 --- a/frontend/app/src/i18n/it.json +++ b/frontend/app/src/i18n/it.json @@ -541,8 +541,8 @@ "joined_community": "Ti sei unito alla tua prima community", "joined_gated_group_or_community": "Ti sei unito al tuo primo gruppo/canale delimitato", "joined_group": "Ti sei unito al tuo primo gruppo", - "own_group_with_10_diamond_members": "Hai posseduto il tuo primo gruppo/community con 10 membri verificati", - "own_group_with_100_diamond_members": "Hai posseduto il tuo primo gruppo/community con 100 membri verificati", + "owned_group_with_10_diamond_members": "Hai posseduto il tuo primo gruppo/community con 10 membri verificati", + "owned_group_with_100_diamond_members": "Hai posseduto il tuo primo gruppo/community con 100 membri verificati", "owned_group_with_1_diamond_member": "Hai posseduto il tuo primo gruppo/community con 1 membro verificato", "owned_group_with_1000_diamond_members": "Hai posseduto il tuo primo gruppo/community con 1000 membri verificati", "percentageComplete": "{perc}% completato", diff --git a/frontend/app/src/i18n/iw.json b/frontend/app/src/i18n/iw.json index f4793e9603..dd15ec38d4 100644 --- a/frontend/app/src/i18n/iw.json +++ b/frontend/app/src/i18n/iw.json @@ -541,8 +541,8 @@ "joined_community": "הצטרף לקהילה הראשונה שלך", "joined_gated_group_or_community": "הצטרף לקבוצה/ערוץ הסגור הראשון שלך", "joined_group": "הצטרף לקבוצה הראשונה שלך", - "own_group_with_10_diamond_members": "הבעלים של הקבוצה/הקהילה הראשונה שלך עם 10 חברים מאומתים", - "own_group_with_100_diamond_members": "הבעלים של הקבוצה/הקהילה הראשונה שלך עם 100 חברים מאומתים", + "owned_group_with_10_diamond_members": "הבעלים של הקבוצה/הקהילה הראשונה שלך עם 10 חברים מאומתים", + "owned_group_with_100_diamond_members": "הבעלים של הקבוצה/הקהילה הראשונה שלך עם 100 חברים מאומתים", "owned_group_with_1_diamond_member": "הבעלים של הקבוצה/הקהילה הראשונה שלך עם חבר מאומת אחד", "owned_group_with_1000_diamond_members": "הבעלים של הקבוצה/הקהילה הראשונה שלך עם 1000 חברים מאומתים", "percentageComplete": "{perc}% הושלם", diff --git a/frontend/app/src/i18n/jp.json b/frontend/app/src/i18n/jp.json index 48ddf84da4..7903e1b5a9 100644 --- a/frontend/app/src/i18n/jp.json +++ b/frontend/app/src/i18n/jp.json @@ -541,8 +541,8 @@ "joined_community": "最初のコミュニティに参加しました", "joined_gated_group_or_community": "最初のゲートグループ/チャンネルに参加しました", "joined_group": "最初のグループに参加しました", - "own_group_with_10_diamond_members": "10 人の認証済みメンバーを持つ最初のグループ/コミュニティを所有しました", - "own_group_with_100_diamond_members": "100人の認証済みメンバーを持つ最初のグループ/コミュニティを所有しました", + "owned_group_with_10_diamond_members": "10 人の認証済みメンバーを持つ最初のグループ/コミュニティを所有しました", + "owned_group_with_100_diamond_members": "100人の認証済みメンバーを持つ最初のグループ/コミュニティを所有しました", "owned_group_with_1_diamond_member": "認証済みメンバー 1 名を含む最初のグループ/コミュニティを所有しました", "owned_group_with_1000_diamond_members": "1000人の認証済みメンバーを持つ最初のグループ/コミュニティを所有しました", "percentageComplete": "{perc}% 完了", diff --git a/frontend/app/src/i18n/ru.json b/frontend/app/src/i18n/ru.json index b3ae87b08c..7bba56f661 100644 --- a/frontend/app/src/i18n/ru.json +++ b/frontend/app/src/i18n/ru.json @@ -541,8 +541,8 @@ "joined_community": "Присоединился к вашему первому сообществу", "joined_gated_group_or_community": "Присоединился к вашей первой закрытой группе/каналу", "joined_group": "Присоединился к вашей первой группе", - "own_group_with_10_diamond_members": "Владелец вашей первой группы/сообщества с 10 проверенными участниками.", - "own_group_with_100_diamond_members": "Владелец вашей первой группы/сообщества со 100 проверенными участниками.", + "owned_group_with_10_diamond_members": "Владелец вашей первой группы/сообщества с 10 проверенными участниками.", + "owned_group_with_100_diamond_members": "Владелец вашей первой группы/сообщества со 100 проверенными участниками.", "owned_group_with_1_diamond_member": "Вы являетесь владельцем первой группы/сообщества с 1 проверенным участником.", "owned_group_with_1000_diamond_members": "Владелец вашей первой группы/сообщества с 1000 проверенными участниками.", "percentageComplete": "{perc} % выполнено", diff --git a/frontend/app/src/i18n/uk.json b/frontend/app/src/i18n/uk.json index 1737ca35e5..0e8e4b3bf1 100644 --- a/frontend/app/src/i18n/uk.json +++ b/frontend/app/src/i18n/uk.json @@ -541,8 +541,8 @@ "joined_community": "Приєднався до вашої першої спільноти", "joined_gated_group_or_community": "Приєднався до вашої першої закритої групи/каналу", "joined_group": "Приєднався до вашої першої групи", - "own_group_with_10_diamond_members": "Був власником вашої першої групи/спільноти з 10 підтвердженими учасниками", - "own_group_with_100_diamond_members": "Був власником вашої першої групи/спільноти зі 100 підтвердженими учасниками", + "owned_group_with_10_diamond_members": "Був власником вашої першої групи/спільноти з 10 підтвердженими учасниками", + "owned_group_with_100_diamond_members": "Був власником вашої першої групи/спільноти зі 100 підтвердженими учасниками", "owned_group_with_1_diamond_member": "Був власником вашої першої групи/спільноти з 1 підтвердженим учасником", "owned_group_with_1000_diamond_members": "Був власником вашої першої групи/спільноти з 1000 перевірених учасників", "percentageComplete": "{perc}% виконано", diff --git a/frontend/app/src/i18n/vi.json b/frontend/app/src/i18n/vi.json index 949f44a887..043a1875c9 100644 --- a/frontend/app/src/i18n/vi.json +++ b/frontend/app/src/i18n/vi.json @@ -541,8 +541,8 @@ "joined_community": "Đã tham gia cộng đồng đầu tiên của bạn", "joined_gated_group_or_community": "Đã tham gia nhóm/kênh kiểm soát đầu tiên của bạn", "joined_group": "Đã tham gia nhóm đầu tiên của bạn", - "own_group_with_10_diamond_members": "Sở hữu nhóm/cộng đồng đầu tiên của bạn với 10 thành viên đã được xác minh", - "own_group_with_100_diamond_members": "Sở hữu nhóm/cộng đồng đầu tiên của bạn với 100 thành viên đã được xác minh", + "owned_group_with_10_diamond_members": "Sở hữu nhóm/cộng đồng đầu tiên của bạn với 10 thành viên đã được xác minh", + "owned_group_with_100_diamond_members": "Sở hữu nhóm/cộng đồng đầu tiên của bạn với 100 thành viên đã được xác minh", "owned_group_with_1_diamond_member": "Sở hữu nhóm/cộng đồng đầu tiên của bạn với 1 thành viên đã được xác minh", "owned_group_with_1000_diamond_members": "Sở hữu nhóm/cộng đồng đầu tiên của bạn với 1000 thành viên đã được xác minh", "percentageComplete": "Đã hoàn thành {perc}%", diff --git a/frontend/openchat-agent/src/services/user/mappers.ts b/frontend/openchat-agent/src/services/user/mappers.ts index c5ba77c139..563d9a52ee 100644 --- a/frontend/openchat-agent/src/services/user/mappers.ts +++ b/frontend/openchat-agent/src/services/user/mappers.ts @@ -235,7 +235,7 @@ export function achievementType(candid: ApiAchievement): Achievement { return "appointed_as_group_admin"; } if ("OwnGroupWithOneHundredDiamondMembers" in candid) { - return "own_group_with_100_diamond_members"; + return "owned_group_with_100_diamond_members"; } if ("SetCommunityDisplayName" in candid) { return "set_community_display_name"; @@ -244,7 +244,7 @@ export function achievementType(candid: ApiAchievement): Achievement { return "appointed_group_owner"; } if ("OwnGroupWithTenDiamondMembers" in candid) { - return "own_group_with_10_diamond_members"; + return "owned_group_with_10_diamond_members"; } if ("JoinedGatedGroupOrCommunity" in candid) { return "joined_gated_group_or_community"; diff --git a/frontend/openchat-shared/src/domain/chit.ts b/frontend/openchat-shared/src/domain/chit.ts index 7b8471473d..ac15f06d00 100644 --- a/frontend/openchat-shared/src/domain/chit.ts +++ b/frontend/openchat-shared/src/domain/chit.ts @@ -85,8 +85,8 @@ export const achievements = [ "appointed_as_group_owner", "upgrade_to_gold_diamond", "owned_group_with_1_diamond_member", - "own_group_with_10_diamond_members", - "own_group_with_100_diamond_members", + "owned_group_with_10_diamond_members", + "owned_group_with_100_diamond_members", "owned_group_with_1000_diamond_members", ] as const; type AchievementType = typeof achievements;