forked from sim0n00ps/OF-DL
Compare commits
10 Commits
ab0de376c9
...
bae0166925
| Author | SHA1 | Date | |
|---|---|---|---|
| bae0166925 | |||
| e8a763a654 | |||
| 7389cb3c30 | |||
| 56d2740c20 | |||
| 307ed708ab | |||
| 3c3250e4e3 | |||
| 257d1dc6f3 | |||
| 29d482e892 | |||
| 58eae943bc | |||
| 378a1b52ea |
@ -149,7 +149,7 @@ public class CajetanApiService(IAuthService authService, IConfigService configSe
|
|||||||
if (usersWithUnread.Contains(userId))
|
if (usersWithUnread.Contains(userId))
|
||||||
{
|
{
|
||||||
_eventHandler.OnMessage("Restoring unread state", "grey");
|
_eventHandler.OnMessage("Restoring unread state", "grey");
|
||||||
await MarkAsUnreadAsync($"chats/{userId}/mark-as-read");
|
await MarkAsUnreadAsync($"/chats/{userId}/mark-as-read");
|
||||||
}
|
}
|
||||||
|
|
||||||
return messages;
|
return messages;
|
||||||
@ -170,7 +170,7 @@ public class CajetanApiService(IAuthService authService, IConfigService configSe
|
|||||||
|
|
||||||
public async Task<HashSet<long>> GetUsersWithUnreadMessagesAsync()
|
public async Task<HashSet<long>> GetUsersWithUnreadMessagesAsync()
|
||||||
{
|
{
|
||||||
MessageDtos.ChatsDto unreadChats = await GetChatsAsync("", onlyUnread: true);
|
MessageDtos.ChatsDto unreadChats = await GetChatsAsync("/chats", onlyUnread: true);
|
||||||
HashSet<long> userWithUnread = [];
|
HashSet<long> userWithUnread = [];
|
||||||
|
|
||||||
foreach (MessageDtos.ChatItemDto chatItem in unreadChats.List)
|
foreach (MessageDtos.ChatItemDto chatItem in unreadChats.List)
|
||||||
|
|||||||
@ -9,6 +9,7 @@ public class CajetanDbService(IConfigService configService)
|
|||||||
{
|
{
|
||||||
await using SqliteConnection connection = new($"Data Source={Directory.GetCurrentDirectory()}/users.db");
|
await using SqliteConnection connection = new($"Data Source={Directory.GetCurrentDirectory()}/users.db");
|
||||||
|
|
||||||
|
connection.Open();
|
||||||
|
|
||||||
using (SqliteCommand cmdInfo = new("CREATE TABLE IF NOT EXISTS user_info (user_id INTEGER NOT NULL, name VARCHAR NOT NULL, about VARCHAR NULL, expires_on TIMESTAMP NULL, photo_count INT NOT NULL, video_count INT NOT NULL, PRIMARY KEY(user_id));", connection))
|
using (SqliteCommand cmdInfo = new("CREATE TABLE IF NOT EXISTS user_info (user_id INTEGER NOT NULL, name VARCHAR NOT NULL, about VARCHAR NULL, expires_on TIMESTAMP NULL, photo_count INT NOT NULL, video_count INT NOT NULL, PRIMARY KEY(user_id));", connection))
|
||||||
{
|
{
|
||||||
|
|||||||
@ -387,8 +387,6 @@ internal class Worker(IServiceProvider serviceProvider)
|
|||||||
async Task FetchListsAsync()
|
async Task FetchListsAsync()
|
||||||
{
|
{
|
||||||
Log.Information("Getting Lists");
|
Log.Information("Getting Lists");
|
||||||
AnsiConsole.Markup($"[green]Getting Lists\n[/]");
|
|
||||||
|
|
||||||
result.Lists = await _apiService.GetLists("/lists") ?? [];
|
result.Lists = await _apiService.GetLists("/lists") ?? [];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -200,9 +200,11 @@ public class FileNameService(IAuthService authService) : IFileNameService
|
|||||||
object? value = source;
|
object? value = source;
|
||||||
foreach (string propertyName in propertyPath.Split('.'))
|
foreach (string propertyName in propertyPath.Split('.'))
|
||||||
{
|
{
|
||||||
PropertyInfo property = value?.GetType().GetProperty(propertyName) ??
|
PropertyInfo? property = value?.GetType().GetProperty(propertyName);
|
||||||
throw new ArgumentException($"Property '{propertyName}' not found.");
|
value = property?.GetValue(value);
|
||||||
value = property.GetValue(value);
|
|
||||||
|
if (value is null)
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
return value;
|
return value;
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user