diff options
author | Dessalines <tyhou13@gmx.com> | 2020-01-31 22:34:08 -0500 |
---|---|---|
committer | Dessalines <tyhou13@gmx.com> | 2020-01-31 22:34:08 -0500 |
commit | 8ec104cb762f58e83fde262ee25c23ddf49730bf (patch) | |
tree | 880fd0f56ac033ade8e70825f808d82c22dc4d93 /server | |
parent | 8036474ddad2f20c27a2fb023395306d6b9e577d (diff) |
Mostly done eliminating recurring fetches.
Diffstat (limited to 'server')
-rw-r--r-- | server/src/websocket/server.rs | 10 |
1 files changed, 2 insertions, 8 deletions
diff --git a/server/src/websocket/server.rs b/server/src/websocket/server.rs index 9b53f21d..1fbe4437 100644 --- a/server/src/websocket/server.rs +++ b/server/src/websocket/server.rs @@ -94,12 +94,6 @@ pub struct ChatServer { db: Pool<ConnectionManager<PgConnection>>, } -// TODO show online users for communities too -// TODO GetPosts is the community / front page join. -// What is sent: New posts, post edits, post removes, post likes, community edits, community mod adds. Notifs for new posts? -// GetPost is the PostJoin, LeavePost is the leave -// What is sent: New comments, comment edits, comment likes -// UserJoin is the user join, a disconnect should remove you from all the scopes impl ChatServer { pub fn startup(db: Pool<ConnectionManager<PgConnection>>) -> ChatServer { ChatServer { @@ -501,7 +495,7 @@ fn parse_json_message(chat: &mut ChatServer, msg: StandardMessage) -> Result<Str let res_str = to_json_string(&user_operation, &res)?; // Don't send my data with it - let mut post_sent = res.clone(); + let mut post_sent = res; post_sent.post.my_vote = None; post_sent.post.user_id = None; let post_sent_str = to_json_string(&user_operation, &post_sent)?; @@ -549,7 +543,7 @@ fn parse_json_message(chat: &mut ChatServer, msg: StandardMessage) -> Result<Str let res_str = to_json_string(&user_operation, &res)?; // Don't send my data with it - let mut post_sent = res.clone(); + let mut post_sent = res; post_sent.post.my_vote = None; post_sent.post.user_id = None; let post_sent_str = to_json_string(&user_operation, &post_sent)?; |