--- a/synapse/cmd.sh Fri Mar 04 11:01:00 2022 +0100
+++ b/synapse/cmd.sh Fri Mar 04 16:11:51 2022 +0100
@@ -76,15 +76,16 @@
echo "=== User data ==="
$CMD "SELECT display_name FROM user_directory WHERE user_id='$ARG'"
+ $CMD "SELECT name,password_hash,to_timestamp(creation_ts) AS creation,admin,is_guest,deactivated,shadow_banned FROM users WHERE name='$ARG'"
$CMD "SELECT medium, address, unts(validated_at) AS validated_at, unts(added_at) AS added_at FROM user_threepids WHERE user_id='$ARG'"
$CMD "SELECT joined_rooms FROM user_stats_current WHERE user_id='$ARG'"
echo "=== Logins ==="
- $CMD "SELECT user_id,device_id,ip,unts(last_seen) AS last_seen,user_agent FROM user_ips WHERE user_id='$ARG'"
- $CMD "SELECT device_id, user_agent, unts(timestamp) FROM user_daily_visits WHERE user_id='$ARG' ORDER BY 1 ASC, 3 DESC LIMIT 10"
+ $CMD "SELECT user_id,device_id,ip,unts(last_seen) AS last_seen,user_agent FROM user_ips WHERE user_id='$ARG' ORDER BY last_seen DESC"
+ $CMD "SELECT device_id, user_agent, unts(timestamp) AS stamp FROM user_daily_visits WHERE user_id='$ARG' ORDER BY 1 ASC, 3 DESC LIMIT 10"
echo "=== Shared private rooms ==="
- $CMD "select * from users_who_share_private_rooms where user_id='$ARG'"
+ $CMD "select * from users_who_share_private_rooms where user_id='$ARG' ORDER BY room_id,other_user_id"
echo "=== Rooms the user has been ==="
$CMD "SELECT rm.room_id, rm.event_id, rm.sender, rm.membership,
@@ -94,7 +95,7 @@
JOIN room_stats_state rss USING(room_id)
JOIN events e USING(event_id)
WHERE user_id='$ARG'
- ORDER BY e.origin_server_ts" | more
+ ORDER BY e.origin_server_ts DESC" | more
exit
fi