feat: split out messages table from main database

This commit is contained in:
spiral
2022-11-23 09:17:19 +00:00
parent 09ac002d26
commit bf7747ab34
14 changed files with 119 additions and 84 deletions

View File

@@ -375,7 +375,7 @@ public class ProxyService
// cache is out of date or channel is empty.
return proxyName;
var pkMessage = await _db.Execute(conn => _repo.GetMessage(conn, lastMessage.Id));
var pkMessage = await _repo.GetMessage(lastMessage.Id);
if (lastMessage.AuthorUsername == proxyName)
{
@@ -385,12 +385,12 @@ public class ProxyService
return FixSameNameInner(proxyName);
// last message was proxied by a different member
if (pkMessage.Member?.Id != member.Id)
if (pkMessage.Member != member.Id)
return FixSameNameInner(proxyName);
}
// if we fixed the name last message and it's the same member proxying, we want to fix it again
if (lastMessage.AuthorUsername == FixSameNameInner(proxyName) && pkMessage?.Member?.Id == member.Id)
if (lastMessage.AuthorUsername == FixSameNameInner(proxyName) && pkMessage?.Member == member.Id)
return FixSameNameInner(proxyName);
// No issues found, current proxy name is fine.