From 0471ba6a6f405a03e538857e06b5872d8bac219c Mon Sep 17 00:00:00 2001
From: Paul Makles <paulmakles@gmail.com>
Date: Sat, 8 Feb 2020 17:26:01 +0000
Subject: [PATCH] Add the rest of the websocket events.

---
 src/routes/channel.rs | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/routes/channel.rs b/src/routes/channel.rs
index 7a0d3c1..7c0b5d9 100644
--- a/src/routes/channel.rs
+++ b/src/routes/channel.rs
@@ -199,13 +199,13 @@ pub fn edit_message(user: User, target: Channel, message: Message, edit: Json<Se
 		} else {
 			let col = database::get_collection("messages");
 
-			let edited = UtcDatetime(Utc::now());
+			let edited = Utc::now();
 			match col.update_one(
 				doc! { "_id": message.id.clone() },
 				doc! {
 					"$set": {
 						"content": edit.content.clone(),
-						"edited": edited.clone()
+						"edited": UtcDatetime(edited.clone())
 					}
 				},
 				None
@@ -218,7 +218,7 @@ pub fn edit_message(user: User, target: Channel, message: Message, edit: Json<Se
 							"id": message.id,
 							"channel": target.id,
 							"content": message.content.clone(),
-							"edited": edited
+							"edited": edited.timestamp()
 						}).to_string()
 					);
 
-- 
GitLab