Slanfan / MTG-Tolaria

8 stars 1 forks source link

Messages #23

Closed Slanfan closed 8 months ago

Slanfan commented 3 years ago

Players should be able to chat with one another in private groups or one on one.

Message Document

The chat documents should be created in the root collection messages

export interface MessageDocument {
  docId?: string;
  name?: string;
  createdByUid: string;
  createdDate: number; // timestamp
  latestMessage: number; // timestamp
  playerDocIds: Array<string>;
  isSingle: boolean;
}

Messages

Sub collection of a chat document in the root collection messages

export interface Message {
  timestamp: number;
  playerDocId: string;
  message: string;
  content?: MessageContent;
  type: string;
  cardName?: string;
}

export interface MessageContent {
  cardName?: string;
  setCode?: string;
  setName?: string;
  imageUrl?: string;
  rulings?: any;
}
Slanfan commented 3 years ago

Building presence is needed to check for online/offline state on a user level. https://firebase.google.com/docs/firestore/solutions/presence

Slanfan commented 3 years ago

Emojis https://github.com/scttcper/ngx-emoji-mart

Slanfan commented 3 years ago

Added Emoji Mart but need a way to parse and auto-lookup emojis on :string: input

Slanfan commented 3 years ago

https://github.com/Slanfan/Tolaria/commit/64de46b82755e70d10d42757b481425f6eb35429 Mentioning implemented image

Slanfan commented 3 years ago

Found a bug in the @ function. Moved the member fetch into the input() change method