<commit_before>
MAS Redis structures
====================

```
 user:<userId> (hash)
   name (string)
   email (string)
   inUse (string)
   lastlogout (int, unix time) (0 = online)
   passwd (string)
   salt (string)
   nick (string)
   token (string)
   cookie (string)
   cookie_expires (int, unix time)
   lastip (string)
   ads (int)
   maxwindows (int)
   openidurl (string)
   registrationtime (int, unix time)
   nextwindowid (int)

 sessionlist:<userId> (zset)
   sessionId1, timeStamp1, sessionId2, timeStamp2 ...

 session:<userId>:<sessionId> (hash)
   sendRcvNext (int)
   listenRcvNext (int)
   timeStamp (int)
   lastreply (string)

 sessionknownuserids:<userId>:<sessionId> set
   <userId1>, <userId2>, ...

 sessionlastrequest (zset)
   userId:sessionId1, timestamp1, userId:sessionId2, timestamp2 ...

 outbox:<userId>:<sessionId> (list) TBD: rename clientinbox!
   msg1, msg2

 index:user (hash)
   <email> (int, userId)
   <nick> (int, userId)
   <openidurl> (int, userId)

 friends:<userId> (set)
   <userId1>, <userId2> ...

 settings:<userId> (hash)
   <name> (string)

 windowlist:<userId> (set)
   <windowId1>, <windowId2> ...

 window:<userId>:<windowId> (hash)
   conversationId (string)
   sounds (bool)
   titleAlert (bool)
   visible (bool)
   row (int)

 networks:<userId>:<network> (hash)
   state (string, 'connected', 'connecting', 'disconnected')
   currentnick (text)
   retryCount (int)

 conversation:<conversationId> (hash)
   owner (string, userId) (mas group only)
   type (string, 'group', '1on1')
   name (string) (e.g. '#foo', 'bar') ('' if not group)
   network (string, 'mas or 'ircnet', 'freenode', 'w3c')
   topic (string)
   password (string)
   apikey (string)

 index:conversation (hash)
   group:<network>:<name> (int, conversationId)
   1on1:<network>:<userId1>:<userId2> (int, conversationId)

 conversationmembers:<conversationId> (hash)
   <userId>: (string, '*' (owner) '@', (op) '+' (voice), 'u' (user))
   ...

 conversationmsgs:<conversationId> (list) [oldest message on the right]

 notelist:<conversationId> (list)
   note1, note2 ...

 note:<uuid> (hash)
   ver (int)
   nick (string)
   timestamp (int)
   msg (text)

 urls:<conversationId> (list)
   url1, url2 ...

 passwordresettoken:<token> (string with expiry time)
   <userId>

 ircuserdb [TBD]

```

 Backends
 ========

```
 inbox:loopbackparser (list)
 inbox:ircparser (list)
 inbox:connectionmanager (list)
```

Global IDs
==========

```
 nextGlobalUserId (string) (integer, counter)
 nextGlobalNoteId (string) (integer, counter)
 nextGlobalMsgId (string) (integer, counter)
 nextGlobalConversationId (string) (integer, counter)
```
<commit_msg>Update backend part of the Redis schema doc<commit_after>
MAS Redis structures
====================

```
 user:<userId> (hash)
   name (string)
   email (string)
   inUse (string)
   lastlogout (int, unix time) (0 = online)
   passwd (string)
   salt (string)
   nick (string)
   token (string)
   cookie (string)
   cookie_expires (int, unix time)
   lastip (string)
   ads (int)
   maxwindows (int)
   openidurl (string)
   registrationtime (int, unix time)
   nextwindowid (int)

 sessionlist:<userId> (zset)
   sessionId1, timeStamp1, sessionId2, timeStamp2 ...

 session:<userId>:<sessionId> (hash)
   sendRcvNext (int)
   listenRcvNext (int)
   timeStamp (int)
   lastreply (string)

 sessionknownuserids:<userId>:<sessionId> set
   <userId1>, <userId2>, ...

 sessionlastrequest (zset)
   userId:sessionId1, timestamp1, userId:sessionId2, timestamp2 ...

 outbox:<userId>:<sessionId> (list) TBD: rename clientinbox!
   msg1, msg2

 index:user (hash)
   <email> (int, userId)
   <nick> (int, userId)
   <openidurl> (int, userId)

 friends:<userId> (set)
   <userId1>, <userId2> ...

 settings:<userId> (hash)
   <name> (string)

 windowlist:<userId> (set)
   <windowId1>, <windowId2> ...

 window:<userId>:<windowId> (hash)
   conversationId (string)
   sounds (bool)
   titleAlert (bool)
   visible (bool)
   row (int)

 networks:<userId>:<network> (hash)
   state (string, 'connected', 'connecting', 'disconnected')
   currentnick (text)
   retryCount (int)

 conversation:<conversationId> (hash)
   owner (string, userId) (mas group only)
   type (string, 'group', '1on1')
   name (string) (e.g. '#foo', 'bar') ('' if not group)
   network (string, 'mas or 'ircnet', 'freenode', 'w3c')
   topic (string)
   password (string)
   apikey (string)

 index:conversation (hash)
   group:<network>:<name> (int, conversationId)
   1on1:<network>:<userId1>:<userId2> (int, conversationId)

 conversationmembers:<conversationId> (hash)
   <userId>: (string, '*' (owner) '@', (op) '+' (voice), 'u' (user))
   ...

 conversationmsgs:<conversationId> (list) [oldest message on the right]

 notelist:<conversationId> (list)
   note1, note2 ...

 note:<uuid> (hash)
   ver (int)
   nick (string)
   timestamp (int)
   msg (text)

 urls:<conversationId> (list)
   url1, url2 ...

 passwordresettoken:<token> (string with expiry time)
   <userId>

 ircuserdb [TBD]

```

 IRC backend
 ===========

```
 inbox:ircparser (list)

 inbox:connectionmanager (list)

 ircuser:<userId>
   nick (string)
   network (string)

 index:ircuser (hash)
   <network>:<nick> (string, userId)
```

 Loopback backend
 ================

```
 inbox:loopbackparser (list)
```

Global IDs
==========

```
 nextGlobalUserId (string) (integer, counter)
 nextGlobalNoteId (string) (integer, counter)
 nextGlobalMsgId (string) (integer, counter)
 nextGlobalConversationId (string) (integer, counter)
```

{'fraction_non_alphanumeric': 0.1688030330384546, 'fraction_numerical': 0.010110128181982307, 'mean_word_length': 4.266159695817491, 'pattern_counts': {'":': 0, '<': 84, '<?xml version=': 0, '>': 84, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2721122', 'n_tokens_mistral': 1996, 'n_tokens_neox': 1963, 'n_words': 486}