Files
mattermost-mobile/app/database/models/server/channel_info.ts
Elias Nahum 2621d921d6 [Gekidou] Performance & UI fixes (#6122)
* Fix search bar style

* MM-42983 Align mention badge on channel list item

* MM-42985 polish channel intro UI

* MM-42984 update fonts on 'Show' bottom sheet

* MM-42982 Increase tap area of back button on channel view

* Set StatusBar style based on theme sidebarBg

* Reconnect other WS after 20 seconds insted of 5

* Only fetch missing profiles for DM/GMs

* Database prepare records optimization

* Do not use fallbackUsername for storing GM/DM in the database

* fix filter for fetching missing dm/gm

* remove use of indexOf inside another loop

* remove use of includes inside another loop

* remove use of find inside another loop

* Add missing translations

* disable Flipper on iOS

* Remove Flipper code from AppDelegate

* feedback review

* trim DM display name to make sure is not empty

* fixing missing direct channels display name

* UI/UX feedback

* fix WS channel viewed and mark as unread

* Remove duplicate emojis from reaction bar
2022-04-04 17:09:26 -04:00

46 lines
1.7 KiB
TypeScript

// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.
// See LICENSE.txt for license information.
import {Relation} from '@nozbe/watermelondb';
import {field, immutableRelation} from '@nozbe/watermelondb/decorators';
import Model, {Associations} from '@nozbe/watermelondb/Model';
import {MM_TABLES} from '@constants/database';
import type ChannelModel from '@typings/database/models/servers/channel';
import type ChannelInfoInterface from '@typings/database/models/servers/channel_info';
const {CHANNEL, CHANNEL_INFO} = MM_TABLES.SERVER;
/**
* ChannelInfo is an extension of the information contained in the Channel table.
* In a Separation of Concerns approach, ChannelInfo will provide additional information about a channel but on a more
* specific level.
*/
export default class ChannelInfoModel extends Model implements ChannelInfoInterface {
/** table (name) : ChannelInfo */
static table = CHANNEL_INFO;
static associations: Associations = {
[CHANNEL]: {type: 'belongs_to', key: 'id'},
};
/** guest_count : The number of guest in this channel */
@field('guest_count') guestCount!: number;
/** header : The headers at the top of each channel */
@field('header') header!: string;
/** member_count: The number of members in this channel */
@field('member_count') memberCount!: number;
/** pinned_post_count : The number of post pinned in this channel */
@field('pinned_post_count') pinnedPostCount!: number;
/** purpose: The intention behind this channel */
@field('purpose') purpose!: string;
/** channel : The lazy query property to the record from CHANNEL table */
@immutableRelation(CHANNEL, 'id') channel!: Relation<ChannelModel>;
}