From 206db67f2a20ad29d4e5994a1a5f94450e1253c1 Mon Sep 17 00:00:00 2001 From: Hamish Peebles Date: Wed, 4 Oct 2023 11:55:10 +0100 Subject: [PATCH] Remove deprecated fields from the frontend (#4490) --- .../src/services/community/candid/idl.js | 6 ------ .../src/services/community/candid/types.d.ts | 10 ---------- .../src/services/group/candid/idl.js | 13 ------------- .../src/services/group/candid/types.d.ts | 10 ---------- .../src/services/groupIndex/candid/types.d.ts | 10 ---------- .../src/services/localUserIndex/candid/idl.js | 8 -------- .../services/localUserIndex/candid/types.d.ts | 10 ---------- .../src/services/notifications/candid/types.d.ts | 10 ---------- .../src/services/online/candid/types.d.ts | 10 ---------- .../src/services/registry/candid/types.d.ts | 10 ---------- .../src/services/storageBucket/candid/types.d.ts | 10 ---------- .../src/services/storageIndex/candid/types.d.ts | 10 ---------- .../src/services/user/candid/idl.js | 12 ++++-------- .../src/services/user/candid/types.d.ts | 16 +++++----------- .../openchat-agent/src/services/user/mappers.ts | 10 ++++++---- .../src/services/userIndex/candid/types.d.ts | 10 ---------- frontend/openchat-shared/src/domain/chat/chat.ts | 5 +++++ 17 files changed, 20 insertions(+), 150 deletions(-) diff --git a/frontend/openchat-agent/src/services/community/candid/idl.js b/frontend/openchat-agent/src/services/community/candid/idl.js index ca3236d592..8b6c7dd11b 100644 --- a/frontend/openchat-agent/src/services/community/candid/idl.js +++ b/frontend/openchat-agent/src/services/community/candid/idl.js @@ -216,10 +216,6 @@ export const idlFactory = ({ IDL }) => { 'mentions' : IDL.Vec(Mention), 'my_metrics' : ChatMetrics, }); - const MessageIndexRange = IDL.Record({ - 'end' : MessageIndex, - 'start' : MessageIndex, - }); const MessageReport = IDL.Record({ 'notes' : IDL.Opt(IDL.Text), 'timestamp' : TimestampMillis, @@ -576,13 +572,11 @@ export const idlFactory = ({ IDL }) => { 'events_ttl' : IDL.Opt(Milliseconds), 'last_updated' : TimestampMillis, 'avatar_id' : IDL.Opt(IDL.Nat), - 'next_message_expiry' : IDL.Opt(TimestampMillis), 'membership' : IDL.Opt(ChannelMembership), 'latest_event_index' : EventIndex, 'history_visible_to_new_joiners' : IDL.Bool, 'min_visible_message_index' : MessageIndex, 'member_count' : IDL.Nat32, - 'expired_messages' : IDL.Vec(MessageIndexRange), 'latest_message' : IDL.Opt(MessageEventWrapper), }); const ChannelSummaryResponse = IDL.Variant({ 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 2d58a7f526..869dd31abb 100644 --- a/frontend/openchat-agent/src/services/community/candid/types.d.ts +++ b/frontend/openchat-agent/src/services/community/candid/types.d.ts @@ -328,13 +328,11 @@ export interface CommunityCanisterChannelSummary { 'events_ttl' : [] | [Milliseconds], 'last_updated' : TimestampMillis, 'avatar_id' : [] | [bigint], - 'next_message_expiry' : [] | [TimestampMillis], 'membership' : [] | [ChannelMembership], 'latest_event_index' : EventIndex, 'history_visible_to_new_joiners' : boolean, 'min_visible_message_index' : MessageIndex, 'member_count' : number, - 'expired_messages' : Array, 'latest_message' : [] | [MessageEventWrapper], } export interface CommunityCanisterChannelSummaryUpdates { @@ -579,7 +577,6 @@ export interface DirectChatSummary { 'last_updated' : TimestampMillis, 'latest_event_index' : EventIndex, 'read_by_me_up_to' : [] | [MessageIndex], - 'expired_messages' : Array, 'archived' : boolean, 'my_metrics' : ChatMetrics, 'latest_message' : MessageEventWrapper, @@ -594,7 +591,6 @@ export interface DirectChatSummaryUpdates { 'updated_events' : Array<[number, bigint]>, 'read_by_me_up_to' : [] | [MessageIndex], 'chat_id' : ChatId, - 'newly_expired_messages' : Array, 'archived' : [] | [boolean], 'my_metrics' : [] | [ChatMetrics], 'latest_message' : [] | [MessageEventWrapper], @@ -794,7 +790,6 @@ export interface GroupCanisterGroupChatSummary { 'joined' : TimestampMillis, 'avatar_id' : [] | [bigint], 'rules_accepted' : boolean, - 'next_message_expiry' : [] | [TimestampMillis], 'latest_threads' : Array, 'frozen' : [] | [FrozenGroupInfo], 'latest_event_index' : EventIndex, @@ -802,7 +797,6 @@ export interface GroupCanisterGroupChatSummary { 'min_visible_message_index' : MessageIndex, 'mentions' : Array, 'chat_id' : ChatId, - 'expired_messages' : Array, 'participant_count' : number, 'my_metrics' : ChatMetrics, 'latest_message' : [] | [MessageEventWrapper], @@ -824,14 +818,12 @@ export interface GroupCanisterGroupChatSummaryUpdates { 'unfollowed_threads' : Uint32Array | number[], 'avatar_id' : DocumentIdUpdate, 'rules_accepted' : [] | [boolean], - 'next_message_expiry' : TimestampUpdate, 'latest_threads' : Array, 'frozen' : FrozenGroupUpdate, 'latest_event_index' : [] | [EventIndex], 'updated_events' : Array<[[] | [number], number, bigint]>, 'mentions' : Array, 'chat_id' : ChatId, - 'newly_expired_messages' : Array, 'participant_count' : [] | [number], 'my_metrics' : [] | [ChatMetrics], 'latest_message' : [] | [MessageEventWrapper], @@ -865,7 +857,6 @@ export interface GroupChatSummary { 'joined' : TimestampMillis, 'avatar_id' : [] | [bigint], 'rules_accepted' : boolean, - 'next_message_expiry' : [] | [TimestampMillis], 'latest_threads' : Array, 'frozen' : [] | [FrozenGroupInfo], 'latest_event_index' : EventIndex, @@ -875,7 +866,6 @@ export interface GroupChatSummary { 'mentions' : Array, 'chat_id' : ChatId, 'date_read_pinned' : [] | [TimestampMillis], - 'expired_messages' : Array, 'archived' : boolean, 'participant_count' : number, 'my_metrics' : ChatMetrics, diff --git a/frontend/openchat-agent/src/services/group/candid/idl.js b/frontend/openchat-agent/src/services/group/candid/idl.js index 97b379dc74..d4126d4411 100644 --- a/frontend/openchat-agent/src/services/group/candid/idl.js +++ b/frontend/openchat-agent/src/services/group/candid/idl.js @@ -1053,10 +1053,6 @@ export const idlFactory = ({ IDL }) => { 'mentioned_by' : UserId, 'message_index' : MessageIndex, }); - const MessageIndexRange = IDL.Record({ - 'end' : MessageIndex, - 'start' : MessageIndex, - }); const GroupCanisterGroupChatSummary = IDL.Record({ 'is_public' : IDL.Bool, 'permissions' : GroupPermissions, @@ -1075,7 +1071,6 @@ export const idlFactory = ({ IDL }) => { 'joined' : TimestampMillis, 'avatar_id' : IDL.Opt(IDL.Nat), 'rules_accepted' : IDL.Bool, - 'next_message_expiry' : IDL.Opt(TimestampMillis), 'latest_threads' : IDL.Vec(GroupCanisterThreadDetails), 'frozen' : IDL.Opt(FrozenGroupInfo), 'latest_event_index' : EventIndex, @@ -1083,7 +1078,6 @@ export const idlFactory = ({ IDL }) => { 'min_visible_message_index' : MessageIndex, 'mentions' : IDL.Vec(Mention), 'chat_id' : ChatId, - 'expired_messages' : IDL.Vec(MessageIndexRange), 'participant_count' : IDL.Nat32, 'my_metrics' : ChatMetrics, 'latest_message' : IDL.Opt(MessageEventWrapper), @@ -1113,11 +1107,6 @@ export const idlFactory = ({ IDL }) => { 'SetToNone' : IDL.Null, 'SetToSome' : IDL.Nat, }); - const TimestampUpdate = IDL.Variant({ - 'NoChange' : IDL.Null, - 'SetToNone' : IDL.Null, - 'SetToSome' : TimestampMillis, - }); const FrozenGroupUpdate = IDL.Variant({ 'NoChange' : IDL.Null, 'SetToNone' : IDL.Null, @@ -1140,7 +1129,6 @@ export const idlFactory = ({ IDL }) => { 'unfollowed_threads' : IDL.Vec(MessageIndex), 'avatar_id' : DocumentIdUpdate, 'rules_accepted' : IDL.Opt(IDL.Bool), - 'next_message_expiry' : TimestampUpdate, 'latest_threads' : IDL.Vec(GroupCanisterThreadDetails), 'frozen' : FrozenGroupUpdate, 'latest_event_index' : IDL.Opt(EventIndex), @@ -1149,7 +1137,6 @@ export const idlFactory = ({ IDL }) => { ), 'mentions' : IDL.Vec(Mention), 'chat_id' : ChatId, - 'newly_expired_messages' : IDL.Vec(MessageIndexRange), 'participant_count' : IDL.Opt(IDL.Nat32), 'my_metrics' : IDL.Opt(ChatMetrics), 'latest_message' : IDL.Opt(MessageEventWrapper), 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 9e88d66047..4fdaa0dee2 100644 --- a/frontend/openchat-agent/src/services/group/candid/types.d.ts +++ b/frontend/openchat-agent/src/services/group/candid/types.d.ts @@ -259,13 +259,11 @@ export interface CommunityCanisterChannelSummary { 'events_ttl' : [] | [Milliseconds], 'last_updated' : TimestampMillis, 'avatar_id' : [] | [bigint], - 'next_message_expiry' : [] | [TimestampMillis], 'membership' : [] | [ChannelMembership], 'latest_event_index' : EventIndex, 'history_visible_to_new_joiners' : boolean, 'min_visible_message_index' : MessageIndex, 'member_count' : number, - 'expired_messages' : Array, 'latest_message' : [] | [MessageEventWrapper], } export interface CommunityCanisterChannelSummaryUpdates { @@ -465,7 +463,6 @@ export interface DirectChatSummary { 'last_updated' : TimestampMillis, 'latest_event_index' : EventIndex, 'read_by_me_up_to' : [] | [MessageIndex], - 'expired_messages' : Array, 'archived' : boolean, 'my_metrics' : ChatMetrics, 'latest_message' : MessageEventWrapper, @@ -480,7 +477,6 @@ export interface DirectChatSummaryUpdates { 'updated_events' : Array<[number, bigint]>, 'read_by_me_up_to' : [] | [MessageIndex], 'chat_id' : ChatId, - 'newly_expired_messages' : Array, 'archived' : [] | [boolean], 'my_metrics' : [] | [ChatMetrics], 'latest_message' : [] | [MessageEventWrapper], @@ -659,7 +655,6 @@ export interface GroupCanisterGroupChatSummary { 'joined' : TimestampMillis, 'avatar_id' : [] | [bigint], 'rules_accepted' : boolean, - 'next_message_expiry' : [] | [TimestampMillis], 'latest_threads' : Array, 'frozen' : [] | [FrozenGroupInfo], 'latest_event_index' : EventIndex, @@ -667,7 +662,6 @@ export interface GroupCanisterGroupChatSummary { 'min_visible_message_index' : MessageIndex, 'mentions' : Array, 'chat_id' : ChatId, - 'expired_messages' : Array, 'participant_count' : number, 'my_metrics' : ChatMetrics, 'latest_message' : [] | [MessageEventWrapper], @@ -689,14 +683,12 @@ export interface GroupCanisterGroupChatSummaryUpdates { 'unfollowed_threads' : Uint32Array | number[], 'avatar_id' : DocumentIdUpdate, 'rules_accepted' : [] | [boolean], - 'next_message_expiry' : TimestampUpdate, 'latest_threads' : Array, 'frozen' : FrozenGroupUpdate, 'latest_event_index' : [] | [EventIndex], 'updated_events' : Array<[[] | [number], number, bigint]>, 'mentions' : Array, 'chat_id' : ChatId, - 'newly_expired_messages' : Array, 'participant_count' : [] | [number], 'my_metrics' : [] | [ChatMetrics], 'latest_message' : [] | [MessageEventWrapper], @@ -730,7 +722,6 @@ export interface GroupChatSummary { 'joined' : TimestampMillis, 'avatar_id' : [] | [bigint], 'rules_accepted' : boolean, - 'next_message_expiry' : [] | [TimestampMillis], 'latest_threads' : Array, 'frozen' : [] | [FrozenGroupInfo], 'latest_event_index' : EventIndex, @@ -740,7 +731,6 @@ export interface GroupChatSummary { 'mentions' : Array, 'chat_id' : ChatId, 'date_read_pinned' : [] | [TimestampMillis], - 'expired_messages' : Array, 'archived' : boolean, 'participant_count' : number, 'my_metrics' : ChatMetrics, 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 a9e61166b3..f83943444e 100644 --- a/frontend/openchat-agent/src/services/groupIndex/candid/types.d.ts +++ b/frontend/openchat-agent/src/services/groupIndex/candid/types.d.ts @@ -225,13 +225,11 @@ export interface CommunityCanisterChannelSummary { 'events_ttl' : [] | [Milliseconds], 'last_updated' : TimestampMillis, 'avatar_id' : [] | [bigint], - 'next_message_expiry' : [] | [TimestampMillis], 'membership' : [] | [ChannelMembership], 'latest_event_index' : EventIndex, 'history_visible_to_new_joiners' : boolean, 'min_visible_message_index' : MessageIndex, 'member_count' : number, - 'expired_messages' : Array, 'latest_message' : [] | [MessageEventWrapper], } export interface CommunityCanisterChannelSummaryUpdates { @@ -412,7 +410,6 @@ export interface DirectChatSummary { 'last_updated' : TimestampMillis, 'latest_event_index' : EventIndex, 'read_by_me_up_to' : [] | [MessageIndex], - 'expired_messages' : Array, 'archived' : boolean, 'my_metrics' : ChatMetrics, 'latest_message' : MessageEventWrapper, @@ -427,7 +424,6 @@ export interface DirectChatSummaryUpdates { 'updated_events' : Array<[number, bigint]>, 'read_by_me_up_to' : [] | [MessageIndex], 'chat_id' : ChatId, - 'newly_expired_messages' : Array, 'archived' : [] | [boolean], 'my_metrics' : [] | [ChatMetrics], 'latest_message' : [] | [MessageEventWrapper], @@ -623,7 +619,6 @@ export interface GroupCanisterGroupChatSummary { 'joined' : TimestampMillis, 'avatar_id' : [] | [bigint], 'rules_accepted' : boolean, - 'next_message_expiry' : [] | [TimestampMillis], 'latest_threads' : Array, 'frozen' : [] | [FrozenGroupInfo], 'latest_event_index' : EventIndex, @@ -631,7 +626,6 @@ export interface GroupCanisterGroupChatSummary { 'min_visible_message_index' : MessageIndex, 'mentions' : Array, 'chat_id' : ChatId, - 'expired_messages' : Array, 'participant_count' : number, 'my_metrics' : ChatMetrics, 'latest_message' : [] | [MessageEventWrapper], @@ -653,14 +647,12 @@ export interface GroupCanisterGroupChatSummaryUpdates { 'unfollowed_threads' : Uint32Array | number[], 'avatar_id' : DocumentIdUpdate, 'rules_accepted' : [] | [boolean], - 'next_message_expiry' : TimestampUpdate, 'latest_threads' : Array, 'frozen' : FrozenGroupUpdate, 'latest_event_index' : [] | [EventIndex], 'updated_events' : Array<[[] | [number], number, bigint]>, 'mentions' : Array, 'chat_id' : ChatId, - 'newly_expired_messages' : Array, 'participant_count' : [] | [number], 'my_metrics' : [] | [ChatMetrics], 'latest_message' : [] | [MessageEventWrapper], @@ -694,7 +686,6 @@ export interface GroupChatSummary { 'joined' : TimestampMillis, 'avatar_id' : [] | [bigint], 'rules_accepted' : boolean, - 'next_message_expiry' : [] | [TimestampMillis], 'latest_threads' : Array, 'frozen' : [] | [FrozenGroupInfo], 'latest_event_index' : EventIndex, @@ -704,7 +695,6 @@ export interface GroupChatSummary { 'mentions' : Array, 'chat_id' : ChatId, 'date_read_pinned' : [] | [TimestampMillis], - 'expired_messages' : Array, 'archived' : boolean, 'participant_count' : number, 'my_metrics' : ChatMetrics, diff --git a/frontend/openchat-agent/src/services/localUserIndex/candid/idl.js b/frontend/openchat-agent/src/services/localUserIndex/candid/idl.js index 92a116f8c7..a8e783d6ee 100644 --- a/frontend/openchat-agent/src/services/localUserIndex/candid/idl.js +++ b/frontend/openchat-agent/src/services/localUserIndex/candid/idl.js @@ -157,10 +157,6 @@ export const idlFactory = ({ IDL }) => { 'mentions' : IDL.Vec(Mention), 'my_metrics' : ChatMetrics, }); - const MessageIndexRange = IDL.Record({ - 'end' : MessageIndex, - 'start' : MessageIndex, - }); const MessageReport = IDL.Record({ 'notes' : IDL.Opt(IDL.Text), 'timestamp' : TimestampMillis, @@ -515,13 +511,11 @@ export const idlFactory = ({ IDL }) => { 'events_ttl' : IDL.Opt(Milliseconds), 'last_updated' : TimestampMillis, 'avatar_id' : IDL.Opt(IDL.Nat), - 'next_message_expiry' : IDL.Opt(TimestampMillis), 'membership' : IDL.Opt(ChannelMembership), 'latest_event_index' : EventIndex, 'history_visible_to_new_joiners' : IDL.Bool, 'min_visible_message_index' : MessageIndex, 'member_count' : IDL.Nat32, - 'expired_messages' : IDL.Vec(MessageIndexRange), 'latest_message' : IDL.Opt(MessageEventWrapper), }); const CommunityPermissionRole = IDL.Variant({ @@ -644,7 +638,6 @@ export const idlFactory = ({ IDL }) => { 'joined' : TimestampMillis, 'avatar_id' : IDL.Opt(IDL.Nat), 'rules_accepted' : IDL.Bool, - 'next_message_expiry' : IDL.Opt(TimestampMillis), 'latest_threads' : IDL.Vec(GroupCanisterThreadDetails), 'frozen' : IDL.Opt(FrozenGroupInfo), 'latest_event_index' : EventIndex, @@ -652,7 +645,6 @@ export const idlFactory = ({ IDL }) => { 'min_visible_message_index' : MessageIndex, 'mentions' : IDL.Vec(Mention), 'chat_id' : ChatId, - 'expired_messages' : IDL.Vec(MessageIndexRange), 'participant_count' : IDL.Nat32, 'my_metrics' : ChatMetrics, 'latest_message' : IDL.Opt(MessageEventWrapper), 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 1a5099da96..a1be5e541e 100644 --- a/frontend/openchat-agent/src/services/localUserIndex/candid/types.d.ts +++ b/frontend/openchat-agent/src/services/localUserIndex/candid/types.d.ts @@ -205,13 +205,11 @@ export interface CommunityCanisterChannelSummary { 'events_ttl' : [] | [Milliseconds], 'last_updated' : TimestampMillis, 'avatar_id' : [] | [bigint], - 'next_message_expiry' : [] | [TimestampMillis], 'membership' : [] | [ChannelMembership], 'latest_event_index' : EventIndex, 'history_visible_to_new_joiners' : boolean, 'min_visible_message_index' : MessageIndex, 'member_count' : number, - 'expired_messages' : Array, 'latest_message' : [] | [MessageEventWrapper], } export interface CommunityCanisterChannelSummaryUpdates { @@ -371,7 +369,6 @@ export interface DirectChatSummary { 'last_updated' : TimestampMillis, 'latest_event_index' : EventIndex, 'read_by_me_up_to' : [] | [MessageIndex], - 'expired_messages' : Array, 'archived' : boolean, 'my_metrics' : ChatMetrics, 'latest_message' : MessageEventWrapper, @@ -386,7 +383,6 @@ export interface DirectChatSummaryUpdates { 'updated_events' : Array<[number, bigint]>, 'read_by_me_up_to' : [] | [MessageIndex], 'chat_id' : ChatId, - 'newly_expired_messages' : Array, 'archived' : [] | [boolean], 'my_metrics' : [] | [ChatMetrics], 'latest_message' : [] | [MessageEventWrapper], @@ -513,7 +509,6 @@ export interface GroupCanisterGroupChatSummary { 'joined' : TimestampMillis, 'avatar_id' : [] | [bigint], 'rules_accepted' : boolean, - 'next_message_expiry' : [] | [TimestampMillis], 'latest_threads' : Array, 'frozen' : [] | [FrozenGroupInfo], 'latest_event_index' : EventIndex, @@ -521,7 +516,6 @@ export interface GroupCanisterGroupChatSummary { 'min_visible_message_index' : MessageIndex, 'mentions' : Array, 'chat_id' : ChatId, - 'expired_messages' : Array, 'participant_count' : number, 'my_metrics' : ChatMetrics, 'latest_message' : [] | [MessageEventWrapper], @@ -543,14 +537,12 @@ export interface GroupCanisterGroupChatSummaryUpdates { 'unfollowed_threads' : Uint32Array | number[], 'avatar_id' : DocumentIdUpdate, 'rules_accepted' : [] | [boolean], - 'next_message_expiry' : TimestampUpdate, 'latest_threads' : Array, 'frozen' : FrozenGroupUpdate, 'latest_event_index' : [] | [EventIndex], 'updated_events' : Array<[[] | [number], number, bigint]>, 'mentions' : Array, 'chat_id' : ChatId, - 'newly_expired_messages' : Array, 'participant_count' : [] | [number], 'my_metrics' : [] | [ChatMetrics], 'latest_message' : [] | [MessageEventWrapper], @@ -584,7 +576,6 @@ export interface GroupChatSummary { 'joined' : TimestampMillis, 'avatar_id' : [] | [bigint], 'rules_accepted' : boolean, - 'next_message_expiry' : [] | [TimestampMillis], 'latest_threads' : Array, 'frozen' : [] | [FrozenGroupInfo], 'latest_event_index' : EventIndex, @@ -594,7 +585,6 @@ export interface GroupChatSummary { 'mentions' : Array, 'chat_id' : ChatId, 'date_read_pinned' : [] | [TimestampMillis], - 'expired_messages' : Array, 'archived' : boolean, 'participant_count' : number, 'my_metrics' : ChatMetrics, 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 5843140fe6..11e783b801 100644 --- a/frontend/openchat-agent/src/services/notifications/candid/types.d.ts +++ b/frontend/openchat-agent/src/services/notifications/candid/types.d.ts @@ -205,13 +205,11 @@ export interface CommunityCanisterChannelSummary { 'events_ttl' : [] | [Milliseconds], 'last_updated' : TimestampMillis, 'avatar_id' : [] | [bigint], - 'next_message_expiry' : [] | [TimestampMillis], 'membership' : [] | [ChannelMembership], 'latest_event_index' : EventIndex, 'history_visible_to_new_joiners' : boolean, 'min_visible_message_index' : MessageIndex, 'member_count' : number, - 'expired_messages' : Array, 'latest_message' : [] | [MessageEventWrapper], } export interface CommunityCanisterChannelSummaryUpdates { @@ -371,7 +369,6 @@ export interface DirectChatSummary { 'last_updated' : TimestampMillis, 'latest_event_index' : EventIndex, 'read_by_me_up_to' : [] | [MessageIndex], - 'expired_messages' : Array, 'archived' : boolean, 'my_metrics' : ChatMetrics, 'latest_message' : MessageEventWrapper, @@ -386,7 +383,6 @@ export interface DirectChatSummaryUpdates { 'updated_events' : Array<[number, bigint]>, 'read_by_me_up_to' : [] | [MessageIndex], 'chat_id' : ChatId, - 'newly_expired_messages' : Array, 'archived' : [] | [boolean], 'my_metrics' : [] | [ChatMetrics], 'latest_message' : [] | [MessageEventWrapper], @@ -513,7 +509,6 @@ export interface GroupCanisterGroupChatSummary { 'joined' : TimestampMillis, 'avatar_id' : [] | [bigint], 'rules_accepted' : boolean, - 'next_message_expiry' : [] | [TimestampMillis], 'latest_threads' : Array, 'frozen' : [] | [FrozenGroupInfo], 'latest_event_index' : EventIndex, @@ -521,7 +516,6 @@ export interface GroupCanisterGroupChatSummary { 'min_visible_message_index' : MessageIndex, 'mentions' : Array, 'chat_id' : ChatId, - 'expired_messages' : Array, 'participant_count' : number, 'my_metrics' : ChatMetrics, 'latest_message' : [] | [MessageEventWrapper], @@ -543,14 +537,12 @@ export interface GroupCanisterGroupChatSummaryUpdates { 'unfollowed_threads' : Uint32Array | number[], 'avatar_id' : DocumentIdUpdate, 'rules_accepted' : [] | [boolean], - 'next_message_expiry' : TimestampUpdate, 'latest_threads' : Array, 'frozen' : FrozenGroupUpdate, 'latest_event_index' : [] | [EventIndex], 'updated_events' : Array<[[] | [number], number, bigint]>, 'mentions' : Array, 'chat_id' : ChatId, - 'newly_expired_messages' : Array, 'participant_count' : [] | [number], 'my_metrics' : [] | [ChatMetrics], 'latest_message' : [] | [MessageEventWrapper], @@ -584,7 +576,6 @@ export interface GroupChatSummary { 'joined' : TimestampMillis, 'avatar_id' : [] | [bigint], 'rules_accepted' : boolean, - 'next_message_expiry' : [] | [TimestampMillis], 'latest_threads' : Array, 'frozen' : [] | [FrozenGroupInfo], 'latest_event_index' : EventIndex, @@ -594,7 +585,6 @@ export interface GroupChatSummary { 'mentions' : Array, 'chat_id' : ChatId, 'date_read_pinned' : [] | [TimestampMillis], - 'expired_messages' : Array, 'archived' : boolean, 'participant_count' : number, 'my_metrics' : ChatMetrics, 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 f81e90d714..480c5cb6ac 100644 --- a/frontend/openchat-agent/src/services/online/candid/types.d.ts +++ b/frontend/openchat-agent/src/services/online/candid/types.d.ts @@ -205,13 +205,11 @@ export interface CommunityCanisterChannelSummary { 'events_ttl' : [] | [Milliseconds], 'last_updated' : TimestampMillis, 'avatar_id' : [] | [bigint], - 'next_message_expiry' : [] | [TimestampMillis], 'membership' : [] | [ChannelMembership], 'latest_event_index' : EventIndex, 'history_visible_to_new_joiners' : boolean, 'min_visible_message_index' : MessageIndex, 'member_count' : number, - 'expired_messages' : Array, 'latest_message' : [] | [MessageEventWrapper], } export interface CommunityCanisterChannelSummaryUpdates { @@ -371,7 +369,6 @@ export interface DirectChatSummary { 'last_updated' : TimestampMillis, 'latest_event_index' : EventIndex, 'read_by_me_up_to' : [] | [MessageIndex], - 'expired_messages' : Array, 'archived' : boolean, 'my_metrics' : ChatMetrics, 'latest_message' : MessageEventWrapper, @@ -386,7 +383,6 @@ export interface DirectChatSummaryUpdates { 'updated_events' : Array<[number, bigint]>, 'read_by_me_up_to' : [] | [MessageIndex], 'chat_id' : ChatId, - 'newly_expired_messages' : Array, 'archived' : [] | [boolean], 'my_metrics' : [] | [ChatMetrics], 'latest_message' : [] | [MessageEventWrapper], @@ -513,7 +509,6 @@ export interface GroupCanisterGroupChatSummary { 'joined' : TimestampMillis, 'avatar_id' : [] | [bigint], 'rules_accepted' : boolean, - 'next_message_expiry' : [] | [TimestampMillis], 'latest_threads' : Array, 'frozen' : [] | [FrozenGroupInfo], 'latest_event_index' : EventIndex, @@ -521,7 +516,6 @@ export interface GroupCanisterGroupChatSummary { 'min_visible_message_index' : MessageIndex, 'mentions' : Array, 'chat_id' : ChatId, - 'expired_messages' : Array, 'participant_count' : number, 'my_metrics' : ChatMetrics, 'latest_message' : [] | [MessageEventWrapper], @@ -543,14 +537,12 @@ export interface GroupCanisterGroupChatSummaryUpdates { 'unfollowed_threads' : Uint32Array | number[], 'avatar_id' : DocumentIdUpdate, 'rules_accepted' : [] | [boolean], - 'next_message_expiry' : TimestampUpdate, 'latest_threads' : Array, 'frozen' : FrozenGroupUpdate, 'latest_event_index' : [] | [EventIndex], 'updated_events' : Array<[[] | [number], number, bigint]>, 'mentions' : Array, 'chat_id' : ChatId, - 'newly_expired_messages' : Array, 'participant_count' : [] | [number], 'my_metrics' : [] | [ChatMetrics], 'latest_message' : [] | [MessageEventWrapper], @@ -584,7 +576,6 @@ export interface GroupChatSummary { 'joined' : TimestampMillis, 'avatar_id' : [] | [bigint], 'rules_accepted' : boolean, - 'next_message_expiry' : [] | [TimestampMillis], 'latest_threads' : Array, 'frozen' : [] | [FrozenGroupInfo], 'latest_event_index' : EventIndex, @@ -594,7 +585,6 @@ export interface GroupChatSummary { 'mentions' : Array, 'chat_id' : ChatId, 'date_read_pinned' : [] | [TimestampMillis], - 'expired_messages' : Array, 'archived' : boolean, 'participant_count' : number, 'my_metrics' : ChatMetrics, 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 299987af92..bdfd04dc89 100644 --- a/frontend/openchat-agent/src/services/registry/candid/types.d.ts +++ b/frontend/openchat-agent/src/services/registry/candid/types.d.ts @@ -205,13 +205,11 @@ export interface CommunityCanisterChannelSummary { 'events_ttl' : [] | [Milliseconds], 'last_updated' : TimestampMillis, 'avatar_id' : [] | [bigint], - 'next_message_expiry' : [] | [TimestampMillis], 'membership' : [] | [ChannelMembership], 'latest_event_index' : EventIndex, 'history_visible_to_new_joiners' : boolean, 'min_visible_message_index' : MessageIndex, 'member_count' : number, - 'expired_messages' : Array, 'latest_message' : [] | [MessageEventWrapper], } export interface CommunityCanisterChannelSummaryUpdates { @@ -371,7 +369,6 @@ export interface DirectChatSummary { 'last_updated' : TimestampMillis, 'latest_event_index' : EventIndex, 'read_by_me_up_to' : [] | [MessageIndex], - 'expired_messages' : Array, 'archived' : boolean, 'my_metrics' : ChatMetrics, 'latest_message' : MessageEventWrapper, @@ -386,7 +383,6 @@ export interface DirectChatSummaryUpdates { 'updated_events' : Array<[number, bigint]>, 'read_by_me_up_to' : [] | [MessageIndex], 'chat_id' : ChatId, - 'newly_expired_messages' : Array, 'archived' : [] | [boolean], 'my_metrics' : [] | [ChatMetrics], 'latest_message' : [] | [MessageEventWrapper], @@ -513,7 +509,6 @@ export interface GroupCanisterGroupChatSummary { 'joined' : TimestampMillis, 'avatar_id' : [] | [bigint], 'rules_accepted' : boolean, - 'next_message_expiry' : [] | [TimestampMillis], 'latest_threads' : Array, 'frozen' : [] | [FrozenGroupInfo], 'latest_event_index' : EventIndex, @@ -521,7 +516,6 @@ export interface GroupCanisterGroupChatSummary { 'min_visible_message_index' : MessageIndex, 'mentions' : Array, 'chat_id' : ChatId, - 'expired_messages' : Array, 'participant_count' : number, 'my_metrics' : ChatMetrics, 'latest_message' : [] | [MessageEventWrapper], @@ -543,14 +537,12 @@ export interface GroupCanisterGroupChatSummaryUpdates { 'unfollowed_threads' : Uint32Array | number[], 'avatar_id' : DocumentIdUpdate, 'rules_accepted' : [] | [boolean], - 'next_message_expiry' : TimestampUpdate, 'latest_threads' : Array, 'frozen' : FrozenGroupUpdate, 'latest_event_index' : [] | [EventIndex], 'updated_events' : Array<[[] | [number], number, bigint]>, 'mentions' : Array, 'chat_id' : ChatId, - 'newly_expired_messages' : Array, 'participant_count' : [] | [number], 'my_metrics' : [] | [ChatMetrics], 'latest_message' : [] | [MessageEventWrapper], @@ -584,7 +576,6 @@ export interface GroupChatSummary { 'joined' : TimestampMillis, 'avatar_id' : [] | [bigint], 'rules_accepted' : boolean, - 'next_message_expiry' : [] | [TimestampMillis], 'latest_threads' : Array, 'frozen' : [] | [FrozenGroupInfo], 'latest_event_index' : EventIndex, @@ -594,7 +585,6 @@ export interface GroupChatSummary { 'mentions' : Array, 'chat_id' : ChatId, 'date_read_pinned' : [] | [TimestampMillis], - 'expired_messages' : Array, 'archived' : boolean, 'participant_count' : number, 'my_metrics' : ChatMetrics, 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 cb0a398d33..a6b6892a9d 100644 --- a/frontend/openchat-agent/src/services/storageBucket/candid/types.d.ts +++ b/frontend/openchat-agent/src/services/storageBucket/candid/types.d.ts @@ -205,13 +205,11 @@ export interface CommunityCanisterChannelSummary { 'events_ttl' : [] | [Milliseconds], 'last_updated' : TimestampMillis, 'avatar_id' : [] | [bigint], - 'next_message_expiry' : [] | [TimestampMillis], 'membership' : [] | [ChannelMembership], 'latest_event_index' : EventIndex, 'history_visible_to_new_joiners' : boolean, 'min_visible_message_index' : MessageIndex, 'member_count' : number, - 'expired_messages' : Array, 'latest_message' : [] | [MessageEventWrapper], } export interface CommunityCanisterChannelSummaryUpdates { @@ -386,7 +384,6 @@ export interface DirectChatSummary { 'last_updated' : TimestampMillis, 'latest_event_index' : EventIndex, 'read_by_me_up_to' : [] | [MessageIndex], - 'expired_messages' : Array, 'archived' : boolean, 'my_metrics' : ChatMetrics, 'latest_message' : MessageEventWrapper, @@ -401,7 +398,6 @@ export interface DirectChatSummaryUpdates { 'updated_events' : Array<[number, bigint]>, 'read_by_me_up_to' : [] | [MessageIndex], 'chat_id' : ChatId, - 'newly_expired_messages' : Array, 'archived' : [] | [boolean], 'my_metrics' : [] | [ChatMetrics], 'latest_message' : [] | [MessageEventWrapper], @@ -543,7 +539,6 @@ export interface GroupCanisterGroupChatSummary { 'joined' : TimestampMillis, 'avatar_id' : [] | [bigint], 'rules_accepted' : boolean, - 'next_message_expiry' : [] | [TimestampMillis], 'latest_threads' : Array, 'frozen' : [] | [FrozenGroupInfo], 'latest_event_index' : EventIndex, @@ -551,7 +546,6 @@ export interface GroupCanisterGroupChatSummary { 'min_visible_message_index' : MessageIndex, 'mentions' : Array, 'chat_id' : ChatId, - 'expired_messages' : Array, 'participant_count' : number, 'my_metrics' : ChatMetrics, 'latest_message' : [] | [MessageEventWrapper], @@ -573,14 +567,12 @@ export interface GroupCanisterGroupChatSummaryUpdates { 'unfollowed_threads' : Uint32Array | number[], 'avatar_id' : DocumentIdUpdate, 'rules_accepted' : [] | [boolean], - 'next_message_expiry' : TimestampUpdate, 'latest_threads' : Array, 'frozen' : FrozenGroupUpdate, 'latest_event_index' : [] | [EventIndex], 'updated_events' : Array<[[] | [number], number, bigint]>, 'mentions' : Array, 'chat_id' : ChatId, - 'newly_expired_messages' : Array, 'participant_count' : [] | [number], 'my_metrics' : [] | [ChatMetrics], 'latest_message' : [] | [MessageEventWrapper], @@ -614,7 +606,6 @@ export interface GroupChatSummary { 'joined' : TimestampMillis, 'avatar_id' : [] | [bigint], 'rules_accepted' : boolean, - 'next_message_expiry' : [] | [TimestampMillis], 'latest_threads' : Array, 'frozen' : [] | [FrozenGroupInfo], 'latest_event_index' : EventIndex, @@ -624,7 +615,6 @@ export interface GroupChatSummary { 'mentions' : Array, 'chat_id' : ChatId, 'date_read_pinned' : [] | [TimestampMillis], - 'expired_messages' : Array, 'archived' : boolean, 'participant_count' : number, 'my_metrics' : ChatMetrics, 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 31dddd98b5..7a63344d1b 100644 --- a/frontend/openchat-agent/src/services/storageIndex/candid/types.d.ts +++ b/frontend/openchat-agent/src/services/storageIndex/candid/types.d.ts @@ -235,13 +235,11 @@ export interface CommunityCanisterChannelSummary { 'events_ttl' : [] | [Milliseconds], 'last_updated' : TimestampMillis, 'avatar_id' : [] | [bigint], - 'next_message_expiry' : [] | [TimestampMillis], 'membership' : [] | [ChannelMembership], 'latest_event_index' : EventIndex, 'history_visible_to_new_joiners' : boolean, 'min_visible_message_index' : MessageIndex, 'member_count' : number, - 'expired_messages' : Array, 'latest_message' : [] | [MessageEventWrapper], } export interface CommunityCanisterChannelSummaryUpdates { @@ -401,7 +399,6 @@ export interface DirectChatSummary { 'last_updated' : TimestampMillis, 'latest_event_index' : EventIndex, 'read_by_me_up_to' : [] | [MessageIndex], - 'expired_messages' : Array, 'archived' : boolean, 'my_metrics' : ChatMetrics, 'latest_message' : MessageEventWrapper, @@ -416,7 +413,6 @@ export interface DirectChatSummaryUpdates { 'updated_events' : Array<[number, bigint]>, 'read_by_me_up_to' : [] | [MessageIndex], 'chat_id' : ChatId, - 'newly_expired_messages' : Array, 'archived' : [] | [boolean], 'my_metrics' : [] | [ChatMetrics], 'latest_message' : [] | [MessageEventWrapper], @@ -543,7 +539,6 @@ export interface GroupCanisterGroupChatSummary { 'joined' : TimestampMillis, 'avatar_id' : [] | [bigint], 'rules_accepted' : boolean, - 'next_message_expiry' : [] | [TimestampMillis], 'latest_threads' : Array, 'frozen' : [] | [FrozenGroupInfo], 'latest_event_index' : EventIndex, @@ -551,7 +546,6 @@ export interface GroupCanisterGroupChatSummary { 'min_visible_message_index' : MessageIndex, 'mentions' : Array, 'chat_id' : ChatId, - 'expired_messages' : Array, 'participant_count' : number, 'my_metrics' : ChatMetrics, 'latest_message' : [] | [MessageEventWrapper], @@ -573,14 +567,12 @@ export interface GroupCanisterGroupChatSummaryUpdates { 'unfollowed_threads' : Uint32Array | number[], 'avatar_id' : DocumentIdUpdate, 'rules_accepted' : [] | [boolean], - 'next_message_expiry' : TimestampUpdate, 'latest_threads' : Array, 'frozen' : FrozenGroupUpdate, 'latest_event_index' : [] | [EventIndex], 'updated_events' : Array<[[] | [number], number, bigint]>, 'mentions' : Array, 'chat_id' : ChatId, - 'newly_expired_messages' : Array, 'participant_count' : [] | [number], 'my_metrics' : [] | [ChatMetrics], 'latest_message' : [] | [MessageEventWrapper], @@ -614,7 +606,6 @@ export interface GroupChatSummary { 'joined' : TimestampMillis, 'avatar_id' : [] | [bigint], 'rules_accepted' : boolean, - 'next_message_expiry' : [] | [TimestampMillis], 'latest_threads' : Array, 'frozen' : [] | [FrozenGroupInfo], 'latest_event_index' : EventIndex, @@ -624,7 +615,6 @@ export interface GroupChatSummary { 'mentions' : Array, 'chat_id' : ChatId, 'date_read_pinned' : [] | [TimestampMillis], - 'expired_messages' : Array, 'archived' : boolean, 'participant_count' : number, 'my_metrics' : ChatMetrics, diff --git a/frontend/openchat-agent/src/services/user/candid/idl.js b/frontend/openchat-agent/src/services/user/candid/idl.js index 102b4988a9..c391d4b532 100644 --- a/frontend/openchat-agent/src/services/user/candid/idl.js +++ b/frontend/openchat-agent/src/services/user/candid/idl.js @@ -860,10 +860,6 @@ export const idlFactory = ({ IDL }) => { 'mentioned_by' : UserId, 'message_index' : MessageIndex, }); - const MessageIndexRange = IDL.Record({ - 'end' : MessageIndex, - 'start' : MessageIndex, - }); const MessageEventWrapper = IDL.Record({ 'event' : Message, 'timestamp' : TimestampMillis, @@ -889,7 +885,6 @@ export const idlFactory = ({ IDL }) => { 'joined' : TimestampMillis, 'avatar_id' : IDL.Opt(IDL.Nat), 'rules_accepted' : IDL.Bool, - 'next_message_expiry' : IDL.Opt(TimestampMillis), 'latest_threads' : IDL.Vec(ThreadSyncDetails), 'frozen' : IDL.Opt(FrozenGroupInfo), 'latest_event_index' : EventIndex, @@ -899,7 +894,6 @@ export const idlFactory = ({ IDL }) => { 'mentions' : IDL.Vec(Mention), 'chat_id' : ChatId, 'date_read_pinned' : IDL.Opt(TimestampMillis), - 'expired_messages' : IDL.Vec(MessageIndexRange), 'archived' : IDL.Bool, 'participant_count' : IDL.Nat32, 'my_metrics' : ChatMetrics, @@ -924,7 +918,6 @@ export const idlFactory = ({ IDL }) => { 'last_updated' : TimestampMillis, 'latest_event_index' : EventIndex, 'read_by_me_up_to' : IDL.Opt(MessageIndex), - 'expired_messages' : IDL.Vec(MessageIndexRange), 'archived' : IDL.Bool, 'my_metrics' : ChatMetrics, 'latest_message' : MessageEventWrapper, @@ -1139,6 +1132,7 @@ export const idlFactory = ({ IDL }) => { 'RecipientBlocked' : IDL.Null, 'UserSuspended' : IDL.Null, 'InvalidRequest' : IDL.Text, + 'TransferCannotBeToSelf' : IDL.Null, 'TransferFailed' : IDL.Text, 'InternalError' : IDL.Text, 'RecipientNotFound' : IDL.Null, @@ -1177,6 +1171,7 @@ export const idlFactory = ({ IDL }) => { 'CommunityFrozen' : IDL.Null, 'CommunityRulesNotAccepted' : IDL.Null, 'InvalidRequest' : IDL.Text, + 'TransferCannotBeToSelf' : IDL.Null, 'TransferFailed' : IDL.Text, 'InternalError' : IDL.Tuple(IDL.Text, CompletedCryptoTransaction), 'RulesNotAccepted' : IDL.Null, @@ -1209,6 +1204,7 @@ export const idlFactory = ({ IDL }) => { 'RecipientBlocked' : IDL.Null, 'UserSuspended' : IDL.Null, 'InvalidRequest' : IDL.Text, + 'TransferCannotBeToSelf' : IDL.Null, 'TransferFailed' : IDL.Text, 'InternalError' : IDL.Tuple(IDL.Text, CompletedCryptoTransaction), 'RulesNotAccepted' : IDL.Null, @@ -1271,6 +1267,7 @@ export const idlFactory = ({ IDL }) => { 'thread_root_message_index' : IDL.Opt(MessageIndex), }); const TipMessageResponse = IDL.Variant({ + 'Retrying' : IDL.Text, 'TransferNotToMessageSender' : IDL.Null, 'MessageNotFound' : IDL.Null, 'ChatNotFound' : IDL.Null, @@ -1367,7 +1364,6 @@ export const idlFactory = ({ IDL }) => { 'updated_events' : IDL.Vec(IDL.Tuple(IDL.Nat32, IDL.Nat64)), 'read_by_me_up_to' : IDL.Opt(MessageIndex), 'chat_id' : ChatId, - 'newly_expired_messages' : IDL.Vec(MessageIndexRange), 'archived' : IDL.Opt(IDL.Bool), 'my_metrics' : IDL.Opt(ChatMetrics), 'latest_message' : IDL.Opt(MessageEventWrapper), 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 25a0c93fb5..c9cd4fa3fd 100644 --- a/frontend/openchat-agent/src/services/user/candid/types.d.ts +++ b/frontend/openchat-agent/src/services/user/candid/types.d.ts @@ -269,13 +269,11 @@ export interface CommunityCanisterChannelSummary { 'events_ttl' : [] | [Milliseconds], 'last_updated' : TimestampMillis, 'avatar_id' : [] | [bigint], - 'next_message_expiry' : [] | [TimestampMillis], 'membership' : [] | [ChannelMembership], 'latest_event_index' : EventIndex, 'history_visible_to_new_joiners' : boolean, 'min_visible_message_index' : MessageIndex, 'member_count' : number, - 'expired_messages' : Array, 'latest_message' : [] | [MessageEventWrapper], } export interface CommunityCanisterChannelSummaryUpdates { @@ -530,7 +528,6 @@ export interface DirectChatSummary { 'last_updated' : TimestampMillis, 'latest_event_index' : EventIndex, 'read_by_me_up_to' : [] | [MessageIndex], - 'expired_messages' : Array, 'archived' : boolean, 'my_metrics' : ChatMetrics, 'latest_message' : MessageEventWrapper, @@ -545,7 +542,6 @@ export interface DirectChatSummaryUpdates { 'updated_events' : Array<[number, bigint]>, 'read_by_me_up_to' : [] | [MessageIndex], 'chat_id' : ChatId, - 'newly_expired_messages' : Array, 'archived' : [] | [boolean], 'my_metrics' : [] | [ChatMetrics], 'latest_message' : [] | [MessageEventWrapper], @@ -727,7 +723,6 @@ export interface GroupCanisterGroupChatSummary { 'joined' : TimestampMillis, 'avatar_id' : [] | [bigint], 'rules_accepted' : boolean, - 'next_message_expiry' : [] | [TimestampMillis], 'latest_threads' : Array, 'frozen' : [] | [FrozenGroupInfo], 'latest_event_index' : EventIndex, @@ -735,7 +730,6 @@ export interface GroupCanisterGroupChatSummary { 'min_visible_message_index' : MessageIndex, 'mentions' : Array, 'chat_id' : ChatId, - 'expired_messages' : Array, 'participant_count' : number, 'my_metrics' : ChatMetrics, 'latest_message' : [] | [MessageEventWrapper], @@ -757,14 +751,12 @@ export interface GroupCanisterGroupChatSummaryUpdates { 'unfollowed_threads' : Uint32Array | number[], 'avatar_id' : DocumentIdUpdate, 'rules_accepted' : [] | [boolean], - 'next_message_expiry' : TimestampUpdate, 'latest_threads' : Array, 'frozen' : FrozenGroupUpdate, 'latest_event_index' : [] | [EventIndex], 'updated_events' : Array<[[] | [number], number, bigint]>, 'mentions' : Array, 'chat_id' : ChatId, - 'newly_expired_messages' : Array, 'participant_count' : [] | [number], 'my_metrics' : [] | [ChatMetrics], 'latest_message' : [] | [MessageEventWrapper], @@ -798,7 +790,6 @@ export interface GroupChatSummary { 'joined' : TimestampMillis, 'avatar_id' : [] | [bigint], 'rules_accepted' : boolean, - 'next_message_expiry' : [] | [TimestampMillis], 'latest_threads' : Array, 'frozen' : [] | [FrozenGroupInfo], 'latest_event_index' : EventIndex, @@ -808,7 +799,6 @@ export interface GroupChatSummary { 'mentions' : Array, 'chat_id' : ChatId, 'date_read_pinned' : [] | [TimestampMillis], - 'expired_messages' : Array, 'archived' : boolean, 'participant_count' : number, 'my_metrics' : ChatMetrics, @@ -1490,6 +1480,7 @@ export type SendMessageResponse = { 'TextTooLong' : number } | { 'RecipientBlocked' : null } | { 'UserSuspended' : null } | { 'InvalidRequest' : string } | + { 'TransferCannotBeToSelf' : null } | { 'TransferFailed' : string } | { 'InternalError' : string } | { 'RecipientNotFound' : null }; @@ -1536,6 +1527,7 @@ export type SendMessageWithTransferToChannelResponse = { { 'CommunityFrozen' : null } | { 'CommunityRulesNotAccepted' : null } | { 'InvalidRequest' : string } | + { 'TransferCannotBeToSelf' : null } | { 'TransferFailed' : string } | { 'InternalError' : [string, CompletedCryptoTransaction] } | { 'RulesNotAccepted' : null } | @@ -1570,6 +1562,7 @@ export type SendMessageWithTransferToGroupResponse = { { 'RecipientBlocked' : null } | { 'UserSuspended' : null } | { 'InvalidRequest' : string } | + { 'TransferCannotBeToSelf' : null } | { 'TransferFailed' : string } | { 'InternalError' : [string, CompletedCryptoTransaction] } | { 'RulesNotAccepted' : null } | @@ -1683,7 +1676,8 @@ export interface TipMessageArgs { 'amount' : bigint, 'thread_root_message_index' : [] | [MessageIndex], } -export type TipMessageResponse = { 'TransferNotToMessageSender' : null } | +export type TipMessageResponse = { 'Retrying' : string } | + { 'TransferNotToMessageSender' : null } | { 'MessageNotFound' : null } | { 'ChatNotFound' : null } | { 'ChatFrozen' : null } | diff --git a/frontend/openchat-agent/src/services/user/mappers.ts b/frontend/openchat-agent/src/services/user/mappers.ts index fc473f4942..b527a72f8b 100644 --- a/frontend/openchat-agent/src/services/user/mappers.ts +++ b/frontend/openchat-agent/src/services/user/mappers.ts @@ -137,12 +137,11 @@ import { ReplicaNotUpToDateError } from "../error"; import type { Principal } from "@dfinity/principal"; export function tipMessageResponse(candid: ApiTipMessageResponse): TipMessageResponse { - if ("Success" in candid) { + if ("Success" in candid || "Retrying" in candid) { return CommonResponses.success(); - } else { - console.warn("tipMessage failed with: ", candid); - return CommonResponses.failure(); } + console.warn("tipMessage failed with: ", candid); + return CommonResponses.failure(); } export function publicProfileResponse(candid: ApiPublicProfileResponse): PublicProfile { @@ -359,6 +358,9 @@ export function sendMessageResponse( if ("TransferCannotBeZero" in candid) { return { kind: "transfer_cannot_be_zero" }; } + if ("TransferCannotBeToSelf" in candid) { + return { kind: "transfer_cannot_be_to_self" }; + } if ("RecipientBlocked" in candid) { return { kind: "recipient_blocked" }; } 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 7272284854..e61c98dbfb 100644 --- a/frontend/openchat-agent/src/services/userIndex/candid/types.d.ts +++ b/frontend/openchat-agent/src/services/userIndex/candid/types.d.ts @@ -227,13 +227,11 @@ export interface CommunityCanisterChannelSummary { 'events_ttl' : [] | [Milliseconds], 'last_updated' : TimestampMillis, 'avatar_id' : [] | [bigint], - 'next_message_expiry' : [] | [TimestampMillis], 'membership' : [] | [ChannelMembership], 'latest_event_index' : EventIndex, 'history_visible_to_new_joiners' : boolean, 'min_visible_message_index' : MessageIndex, 'member_count' : number, - 'expired_messages' : Array, 'latest_message' : [] | [MessageEventWrapper], } export interface CommunityCanisterChannelSummaryUpdates { @@ -411,7 +409,6 @@ export interface DirectChatSummary { 'last_updated' : TimestampMillis, 'latest_event_index' : EventIndex, 'read_by_me_up_to' : [] | [MessageIndex], - 'expired_messages' : Array, 'archived' : boolean, 'my_metrics' : ChatMetrics, 'latest_message' : MessageEventWrapper, @@ -426,7 +423,6 @@ export interface DirectChatSummaryUpdates { 'updated_events' : Array<[number, bigint]>, 'read_by_me_up_to' : [] | [MessageIndex], 'chat_id' : ChatId, - 'newly_expired_messages' : Array, 'archived' : [] | [boolean], 'my_metrics' : [] | [ChatMetrics], 'latest_message' : [] | [MessageEventWrapper], @@ -553,7 +549,6 @@ export interface GroupCanisterGroupChatSummary { 'joined' : TimestampMillis, 'avatar_id' : [] | [bigint], 'rules_accepted' : boolean, - 'next_message_expiry' : [] | [TimestampMillis], 'latest_threads' : Array, 'frozen' : [] | [FrozenGroupInfo], 'latest_event_index' : EventIndex, @@ -561,7 +556,6 @@ export interface GroupCanisterGroupChatSummary { 'min_visible_message_index' : MessageIndex, 'mentions' : Array, 'chat_id' : ChatId, - 'expired_messages' : Array, 'participant_count' : number, 'my_metrics' : ChatMetrics, 'latest_message' : [] | [MessageEventWrapper], @@ -583,14 +577,12 @@ export interface GroupCanisterGroupChatSummaryUpdates { 'unfollowed_threads' : Uint32Array | number[], 'avatar_id' : DocumentIdUpdate, 'rules_accepted' : [] | [boolean], - 'next_message_expiry' : TimestampUpdate, 'latest_threads' : Array, 'frozen' : FrozenGroupUpdate, 'latest_event_index' : [] | [EventIndex], 'updated_events' : Array<[[] | [number], number, bigint]>, 'mentions' : Array, 'chat_id' : ChatId, - 'newly_expired_messages' : Array, 'participant_count' : [] | [number], 'my_metrics' : [] | [ChatMetrics], 'latest_message' : [] | [MessageEventWrapper], @@ -624,7 +616,6 @@ export interface GroupChatSummary { 'joined' : TimestampMillis, 'avatar_id' : [] | [bigint], 'rules_accepted' : boolean, - 'next_message_expiry' : [] | [TimestampMillis], 'latest_threads' : Array, 'frozen' : [] | [FrozenGroupInfo], 'latest_event_index' : EventIndex, @@ -634,7 +625,6 @@ export interface GroupChatSummary { 'mentions' : Array, 'chat_id' : ChatId, 'date_read_pinned' : [] | [TimestampMillis], - 'expired_messages' : Array, 'archived' : boolean, 'participant_count' : number, 'my_metrics' : ChatMetrics, diff --git a/frontend/openchat-shared/src/domain/chat/chat.ts b/frontend/openchat-shared/src/domain/chat/chat.ts index 66315adad9..deba310257 100644 --- a/frontend/openchat-shared/src/domain/chat/chat.ts +++ b/frontend/openchat-shared/src/domain/chat/chat.ts @@ -1427,6 +1427,7 @@ export type SendMessageResponse = | SendMessageTooLong | SendMessageEmpty | TransferCannotBeZero + | TransferCannotBeToSelf | SendMessageRecipientNotFound | TransferFailed | TransferLimitExceeded @@ -1483,6 +1484,10 @@ export type TransferCannotBeZero = { kind: "transfer_cannot_be_zero"; }; +export type TransferCannotBeToSelf = { + kind: "transfer_cannot_be_to_self"; +}; + export type SendMessageRecipientBlocked = { kind: "recipient_blocked"; };