if the user exists in the database but was not loaded on daemon startup,
attempt to load it from the database before instructing the operator to
restart the daemon.
---
server.go | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/server.go b/server.go
index 7d1d305..79c19f2 100644
--- a/server.go+++ b/server.go
@@ -390,6 +390,13 @@ func (s *Server) forEachUser(f func(*user)) {
func (s *Server) getUser(name string) *user {
s.lock.Lock()
u := s.users[name]
+ if u == nil {+ dbu, err := s.db.GetUser(context.TODO(), name)+ if err == nil {+ s.addUserLocked(dbu)+ u = s.users[name]+ }+ } s.lock.Unlock()
return u
}
--
2.37.3
--
Lauri Tirkkonen | lotheac @ IRCnet
Thanks for the patch, but this feature has already been rejected in the
past:
https://lists.sr.ht/~emersion/soju-dev/patches/25249
https://lists.sr.ht/~emersion/soju-dev/patches/26042