Feat: add namecheck and tailwind css

This commit is contained in:
Grail Finder
2025-05-04 11:32:39 +03:00
parent 5dbb80121d
commit ca9b077070
10 changed files with 107 additions and 5 deletions

View File

@ -27,3 +27,24 @@ func getRoomIDFromCtx(ctx context.Context) string {
id, _ := ctx.Value(models.CtxRoomIDKey).(string)
return id
}
// cache
func getAllNames() []string {
names := []string{}
// will not scale
wholeMemStore := memcache.GetAll()
session := &models.Session{}
// filter by key size only sessions
for k, v := range wholeMemStore {
// xid is 20 in len
if len(k) != 20 {
continue
}
if err := json.Unmarshal(v, &session); err != nil {
log.Error("failed to unmarshal", "error", err)
continue
}
names = append(names, session.Username)
}
return names
}