forked from Ivasoft/mattermost-mobile
* Started with Channel Post List * Added markdown hashtag * Added TouchableWithFeedback component * Added utils/bottom_sheet * Removed BottomSheet in favor of future SlideUpPanel * Added markdown_block_quote * Added markdown_list_item * Added markdown_list * Added MarkDownTableCell component * Markdown_table - in progress - need to verify TS * Added markdown_table * Update Podfile.lock * Added deep_linking constant * Added utils/draft * Update config to include ExperimentalNormalizeMarkdownLinks * Added markdown_link * Added markdown_table_row * Added ProgressiveImage and RetriableImage components and images utils * Converted Retriable component to functional component * Added type definition for commonmark * Continuing with markdown TS * Markdown - Typing props [ in progress ] * Fix boolean flag with mardown block quote * Adding observable config to markdown_link * TS Fixes [ in progress ] * TS fixes * TS fixes - TextStyles * Update markdown.tsx * TS fixes on markdown * TS Fixes - AtMention component * AtMention [ IN PROGRESS ] * Add markdown support * Fix emoji and jumboEmoji on iOS * Fix handleMyTeam operator * Fix navigation style based on theme * Fix iOS MattermostManaged deleteDatabse return error type * wrap setNavigationStackStyles under a requestAnimationFrame * Add preventDoubleTap to channel mention * Increase double tap to 750ms * Fix handleReceivedPostsInChannel chunk query * Set initial navigation theme * Swizzle FastImage on iOS * fix preventDoubleTap test Co-authored-by: Avinash Lingaloo <> Co-authored-by: Elias Nahum <nahumhbl@gmail.com>
42 lines
1.5 KiB
TypeScript
42 lines
1.5 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 from '@nozbe/watermelondb/Model';
|
|
|
|
import {MM_TABLES} from '@constants/database';
|
|
|
|
import type ChannelModel from '@typings/database/models/servers/channel';
|
|
|
|
const {CHANNEL, MY_CHANNEL} = MM_TABLES.SERVER;
|
|
|
|
/**
|
|
* MyChannel is an extension of the Channel model but it lists only the Channels the app's user belongs to
|
|
*/
|
|
export default class MyChannelModel extends Model {
|
|
/** table (name) : MyChannel */
|
|
static table = MY_CHANNEL;
|
|
|
|
/** last_post_at : The timestamp for any last post on this channel */
|
|
@field('last_post_at') lastPostAt!: number;
|
|
|
|
/** last_viewed_at : The timestamp showing the user's last viewed post on this channel */
|
|
@field('last_viewed_at') lastViewedAt!: number;
|
|
|
|
/** manually_unread : Determine if the user marked a post as unread */
|
|
@field('manually_unread') manuallyUnread!: boolean;
|
|
|
|
/** mentions_count : The number of mentions on this channel */
|
|
@field('mentions_count') mentionsCount!: number;
|
|
|
|
/** message_count : The derived number of unread messages on this channel */
|
|
@field('message_count') messageCount!: number;
|
|
|
|
/** roles : The user's privileges on this channel */
|
|
@field('roles') roles!: string;
|
|
|
|
/** channel : The relation pointing to the CHANNEL table */
|
|
@immutableRelation(CHANNEL, 'id') channel!: Relation<ChannelModel>;
|
|
}
|