mirror of
https://github.com/zedeus/nitter.git
synced 2024-12-13 11:36:34 +00:00
21 lines
505 B
Nim
21 lines
505 B
Nim
import tables
|
|
import types, prefs_impl
|
|
from config import get
|
|
from parsecfg import nil
|
|
|
|
export genUpdatePrefs, genResetPrefs
|
|
|
|
var defaultPrefs* {.threadvar.}: Prefs
|
|
|
|
proc updateDefaultPrefs*(cfg: parsecfg.Config) =
|
|
genDefaultPrefs()
|
|
|
|
proc getPrefs*(cookies: Table[string, string]): Prefs =
|
|
result = defaultPrefs
|
|
genCookiePrefs(cookies)
|
|
|
|
template getPref*(cookies: Table[string, string], pref): untyped =
|
|
bind genCookiePref
|
|
var res = defaultPrefs.`pref`
|
|
genCookiePref(cookies, pref, res)
|
|
res
|