context::LemmyContext,
site::{GetSite, GetSiteResponse, MyUserInfo},
utils::{build_federated_instances, get_local_user_settings_view_from_jwt_opt},
- websocket::messages::GetUsersOnline,
};
-use lemmy_db_schema::source::{actor_language::SiteLanguage, language::Language, tagline::Tagline};
-use lemmy_db_views::structs::{LocalUserDiscussionLanguageView, SiteView};
+use lemmy_db_schema::source::{
+ actor_language::{LocalUserLanguage, SiteLanguage},
+ language::Language,
+ tagline::Tagline,
+};
+use lemmy_db_views::structs::SiteView;
use lemmy_db_views_actor::structs::{
CommunityBlockView,
CommunityFollowerView,
CommunityModeratorView,
PersonBlockView,
- PersonViewSafe,
+ PersonView,
};
use lemmy_utils::{error::LemmyError, version, ConnectionId};
let site_view = SiteView::read_local(context.pool()).await?;
- let admins = PersonViewSafe::admins(context.pool()).await?;
+ let admins = PersonView::admins(context.pool()).await?;
- let online = context
- .chat_server()
- .send(GetUsersOnline)
- .await
- .unwrap_or(1);
+ let online = context.chat_server().get_users_online()?;
// Build the local user
let my_user = if let Some(local_user_view) = get_local_user_settings_view_from_jwt_opt(
.await
.map_err(|e| LemmyError::from_error_message(e, "system_err_login"))?;
- let discussion_languages =
- LocalUserDiscussionLanguageView::read_languages(context.pool(), local_user_id)
- .await
- .map_err(|e| LemmyError::from_error_message(e, "system_err_login"))?;
+ let discussion_languages = LocalUserLanguage::read(context.pool(), local_user_id)
+ .await
+ .map_err(|e| LemmyError::from_error_message(e, "system_err_login"))?;
Some(MyUserInfo {
local_user_view,