Commit 79e5d7e5 authored by Mohammed Sadiq's avatar Mohammed Sadiq

history: Strip room name from username

In chat rooms, the username can be in the form room-name/username.

Since the user will be interested only in username, strip the room
name from username
parent 92124ee0
Pipeline #60825 passed with stages
in 12 minutes and 21 seconds
......@@ -380,7 +380,12 @@ get_messages_before_id (ChattyHistory *self,
status = sqlite3_prepare_v2 (self->db, "SELECT timestamp,direction,message,uid FROM chatty_im "
"WHERE account=(?) AND who=(?) AND id < (?) AND message != \"\" ORDER BY timestamp DESC, id DESC LIMIT (?)", -1, &stmt, NULL);
else
status = sqlite3_prepare_v2 (self->db, "SELECT timestamp,direction,message,uid,who FROM chatty_chat "
status = sqlite3_prepare_v2 (self->db, "SELECT timestamp,direction,message,uid,"
"CASE "
"WHEN who LIKE room || '/%' THEN substr(who, length(room) + 2) "
"ELSE who "
"END "
"FROM chatty_chat "
"WHERE account=(?) AND room=(?) AND id < (?) AND message != \"\" ORDER BY timestamp DESC, id DESC LIMIT (?)", -1, &stmt, NULL);
warn_if_sql_error (status, "preparing to get messages");
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment