fixes for locales, improvements, more logging, stub cs translation

This commit is contained in:
2021-10-10 15:38:56 +02:00
parent 239e15afdd
commit e76da157b3
11 changed files with 130 additions and 70 deletions
+24 -22
View File
@@ -1,5 +1,4 @@
use std::collections::VecDeque;
use std::ops::Deref;
use std::sync::Arc;
use std::time::{Duration, Instant};
@@ -20,7 +19,7 @@ use crate::command::StatusCommand;
use crate::error::GroupError;
use crate::store::CommonConfig;
use crate::store::GroupConfig;
use crate::tr::{EMPTY_TRANSLATION_TABLE, TranslationTable};
use crate::tr::TranslationTable;
use crate::utils::{normalize_acct, LogError, VisExt};
mod handle_mention;
@@ -162,27 +161,31 @@ impl GroupHandle {
let socket_open_time = Instant::now();
let mut last_rx = Instant::now();
match self.catch_up_with_missed_notifications().await {
Ok(true) => {
grp_debug!(self, "Some missed notifs handled");
}
Ok(false) => {
grp_debug!(self, "No notifs missed");
}
Err(e) => {
grp_error!(self, "Failed to handle missed notifs: {}", e);
if self.cc.max_catchup_notifs > 0 {
match self.catch_up_with_missed_notifications().await {
Ok(true) => {
grp_debug!(self, "Some missed notifs handled");
}
Ok(false) => {
grp_debug!(self, "No notifs missed");
}
Err(e) => {
grp_error!(self, "Failed to handle missed notifs: {}", e);
}
}
}
match self.catch_up_with_missed_statuses().await {
Ok(true) => {
grp_debug!(self, "Some missed statuses handled");
}
Ok(false) => {
grp_debug!(self, "No statuses missed");
}
Err(e) => {
grp_error!(self, "Failed to handle missed statuses: {}", e);
if self.cc.max_catchup_statuses > 0 {
match self.catch_up_with_missed_statuses().await {
Ok(true) => {
grp_debug!(self, "Some missed statuses handled");
}
Ok(false) => {
grp_debug!(self, "No statuses missed");
}
Err(e) => {
grp_error!(self, "Failed to handle missed statuses: {}", e);
}
}
}
@@ -526,8 +529,7 @@ impl GroupHandle {
}
fn tr(&self) -> &TranslationTable {
self.cc.tr.get(self.config.get_locale())
.unwrap_or(&EMPTY_TRANSLATION_TABLE)
self.cc.tr(self.config.get_locale())
}
async fn handle_new_follow(&mut self, notif_acct: &str, notif_user_id: &str) {