2020-10-30 13:12:02 +00:00
|
|
|
import { Model } from '@nozbe/watermelondb';
|
|
|
|
import { field, json } from '@nozbe/watermelondb/decorators';
|
|
|
|
|
|
|
|
import { sanitizer } from '../../utils';
|
|
|
|
|
2022-02-01 13:39:09 +00:00
|
|
|
export const LOGGED_USERS_TABLE = 'users';
|
|
|
|
|
2020-10-30 13:12:02 +00:00
|
|
|
export default class User extends Model {
|
2022-02-01 13:39:09 +00:00
|
|
|
static table = LOGGED_USERS_TABLE;
|
2020-10-30 13:12:02 +00:00
|
|
|
|
|
|
|
@field('token') token;
|
|
|
|
|
|
|
|
@field('username') username;
|
|
|
|
|
|
|
|
@field('name') name;
|
|
|
|
|
|
|
|
@field('language') language;
|
|
|
|
|
|
|
|
@field('status') status;
|
|
|
|
|
|
|
|
@field('statusText') statusText;
|
|
|
|
|
|
|
|
@json('roles', sanitizer) roles;
|
|
|
|
|
|
|
|
@field('avatar_etag') avatarETag;
|
2020-11-12 17:08:17 +00:00
|
|
|
|
|
|
|
@field('show_message_in_main_thread') showMessageInMainThread;
|
2021-07-05 18:21:15 +00:00
|
|
|
|
|
|
|
@field('is_from_webview') isFromWebView;
|
2021-10-20 16:32:58 +00:00
|
|
|
|
|
|
|
@field('enable_message_parser_early_adoption') enableMessageParserEarlyAdoption;
|
2023-08-01 17:34:05 +00:00
|
|
|
|
|
|
|
@field('nickname') nickname;
|
|
|
|
|
|
|
|
@field('bio') bio;
|
2020-10-30 13:12:02 +00:00
|
|
|
}
|