File tree Expand file tree Collapse file tree 1 file changed +2
-0
lines changed
backend/PyMatcha/routes/api Expand file tree Collapse file tree 1 file changed +2
-0
lines changed Original file line number Diff line number Diff line change 3030from PyMatcha .utils .errors import NotFoundError
3131from PyMatcha .utils .success import Success
3232from PyMatcha .utils .success import SuccessOutput
33+ from timeago import format as timeago_format
3334
3435
3536REQUIRED_KEYS_NEW_MESSAGE = {"to_uid" : str , "content" : str }
@@ -44,6 +45,7 @@ def get_opened_conversations():
4445 returned_list = [
4546 {
4647 "last_message_timestamp" : c .timestamp ,
48+ "last_message_timestamp_ago" : timeago_format (c .timestamp , datetime .datetime .utcnow ()),
4749 "last_message_content" : c .content ,
4850 "is_unseen" : True if not c .is_seen and c .to_id == current_user .id else False ,
4951 "with_user" : get_user (c .to_id if c .to_id != current_user .id else c .from_id ).to_dict (),
You can’t perform that action at this time.
0 commit comments