From 91d210ce798a8b5872124759fb88b9756c3fd90b Mon Sep 17 00:00:00 2001 From: Dessalines Date: Tue, 26 Jan 2021 11:45:36 -0500 Subject: [PATCH] Fixing modlog not showing bans and adds. Fixes #1376 --- crates/db_views_moderator/src/mod_add_community_view.rs | 2 +- crates/db_views_moderator/src/mod_add_view.rs | 2 +- crates/db_views_moderator/src/mod_ban_from_community_view.rs | 4 +++- crates/db_views_moderator/src/mod_ban_view.rs | 2 +- 4 files changed, 6 insertions(+), 4 deletions(-) diff --git a/crates/db_views_moderator/src/mod_add_community_view.rs b/crates/db_views_moderator/src/mod_add_community_view.rs index 1b31e02d4..dfb7de7e6 100644 --- a/crates/db_views_moderator/src/mod_add_community_view.rs +++ b/crates/db_views_moderator/src/mod_add_community_view.rs @@ -31,7 +31,7 @@ impl ModAddCommunityView { let mut query = mod_add_community::table .inner_join(user_::table.on(mod_add_community::mod_user_id.eq(user_::id))) .inner_join(community::table) - .inner_join(user_alias_1::table.on(mod_add_community::other_user_id.eq(user_::id))) + .inner_join(user_alias_1::table.on(mod_add_community::other_user_id.eq(user_alias_1::id))) .select(( mod_add_community::all_columns, User_::safe_columns_tuple(), diff --git a/crates/db_views_moderator/src/mod_add_view.rs b/crates/db_views_moderator/src/mod_add_view.rs index bc858728f..06c7091cc 100644 --- a/crates/db_views_moderator/src/mod_add_view.rs +++ b/crates/db_views_moderator/src/mod_add_view.rs @@ -27,7 +27,7 @@ impl ModAddView { ) -> Result, Error> { let mut query = mod_add::table .inner_join(user_::table.on(mod_add::mod_user_id.eq(user_::id))) - .inner_join(user_alias_1::table.on(mod_add::other_user_id.eq(user_::id))) + .inner_join(user_alias_1::table.on(mod_add::other_user_id.eq(user_alias_1::id))) .select(( mod_add::all_columns, User_::safe_columns_tuple(), diff --git a/crates/db_views_moderator/src/mod_ban_from_community_view.rs b/crates/db_views_moderator/src/mod_ban_from_community_view.rs index 00ac452e7..1d9b1fafd 100644 --- a/crates/db_views_moderator/src/mod_ban_from_community_view.rs +++ b/crates/db_views_moderator/src/mod_ban_from_community_view.rs @@ -31,7 +31,9 @@ impl ModBanFromCommunityView { let mut query = mod_ban_from_community::table .inner_join(user_::table.on(mod_ban_from_community::mod_user_id.eq(user_::id))) .inner_join(community::table) - .inner_join(user_alias_1::table.on(mod_ban_from_community::other_user_id.eq(user_::id))) + .inner_join( + user_alias_1::table.on(mod_ban_from_community::other_user_id.eq(user_alias_1::id)), + ) .select(( mod_ban_from_community::all_columns, User_::safe_columns_tuple(), diff --git a/crates/db_views_moderator/src/mod_ban_view.rs b/crates/db_views_moderator/src/mod_ban_view.rs index 1a7743194..ff599e187 100644 --- a/crates/db_views_moderator/src/mod_ban_view.rs +++ b/crates/db_views_moderator/src/mod_ban_view.rs @@ -27,7 +27,7 @@ impl ModBanView { ) -> Result, Error> { let mut query = mod_ban::table .inner_join(user_::table.on(mod_ban::mod_user_id.eq(user_::id))) - .inner_join(user_alias_1::table.on(mod_ban::other_user_id.eq(user_::id))) + .inner_join(user_alias_1::table.on(mod_ban::other_user_id.eq(user_alias_1::id))) .select(( mod_ban::all_columns, User_::safe_columns_tuple(),