-
Notifications
You must be signed in to change notification settings - Fork 54
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add support for a message activity feed
- Loading branch information
Showing
35 changed files
with
488 additions
and
70 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
26 changes: 26 additions & 0 deletions
26
backend/canisters/user/api/src/queries/message_activity_feed.rs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
use candid::CandidType; | ||
use serde::{Deserialize, Serialize}; | ||
use ts_export::ts_export; | ||
use types::TimestampMillis; | ||
|
||
use crate::MessageActivityEvent; | ||
|
||
#[ts_export(user, activity_feed)] | ||
#[derive(CandidType, Serialize, Deserialize, Debug)] | ||
pub struct Args { | ||
pub since: TimestampMillis, | ||
pub max: u32, | ||
} | ||
|
||
#[ts_export(user, activity_feed)] | ||
#[derive(CandidType, Serialize, Deserialize, Debug)] | ||
pub enum Response { | ||
Success(SuccessResult), | ||
} | ||
|
||
#[ts_export(user, activity_feed)] | ||
#[derive(CandidType, Serialize, Deserialize, Debug)] | ||
pub struct SuccessResult { | ||
pub events: Vec<MessageActivityEvent>, | ||
pub total: u32, | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
13 changes: 13 additions & 0 deletions
13
backend/canisters/user/api/src/updates/c2c_notify_community_canister_events.rs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
use crate::CommunityCanisterEvent; | ||
use serde::{Deserialize, Serialize}; | ||
|
||
#[derive(Serialize, Deserialize, Debug)] | ||
pub struct Args { | ||
pub events: Vec<CommunityCanisterEvent>, | ||
} | ||
|
||
#[derive(Serialize, Deserialize, Debug)] | ||
pub enum Response { | ||
Success, | ||
Blocked, | ||
} |
12 changes: 12 additions & 0 deletions
12
backend/canisters/user/api/src/updates/c2c_notify_group_canister_events.rs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
use crate::GroupCanisterEvent; | ||
use serde::{Deserialize, Serialize}; | ||
|
||
#[derive(Serialize, Deserialize, Debug)] | ||
pub struct Args { | ||
pub events: Vec<GroupCanisterEvent>, | ||
} | ||
|
||
#[derive(Serialize, Deserialize, Debug)] | ||
pub enum Response { | ||
Success, | ||
} |
16 changes: 16 additions & 0 deletions
16
backend/canisters/user/api/src/updates/mark_message_activity_feed_read.rs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
use candid::CandidType; | ||
use serde::{Deserialize, Serialize}; | ||
use ts_export::ts_export; | ||
use types::TimestampMillis; | ||
|
||
#[ts_export(user, mark_read)] | ||
#[derive(CandidType, Serialize, Deserialize, Debug)] | ||
pub struct Args { | ||
pub read_up_to: TimestampMillis, | ||
} | ||
|
||
#[ts_export(user, mark_read)] | ||
#[derive(CandidType, Serialize, Deserialize, Debug)] | ||
pub enum Response { | ||
Success, | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.