1
0
mirror of https://gitlab.com/comunic/comunicapiv2 synced 2025-06-21 09:05:17 +00:00

Can open new conversations

This commit is contained in:
2019-11-30 15:17:47 +01:00
parent abd6514b59
commit 46f6e15b02
4 changed files with 124 additions and 0 deletions

View File

@ -0,0 +1,42 @@
import { pathUserData } from "../utils/UserDataUtils";
/**
* Single conversation message
*
* @author Pierre HUBERT
*/
export interface ConversationMessageInfo {
id: number,
convID: number,
userID: number,
timeSent: number,
imagePath: string,
message: string
}
export class ConversationMessage implements ConversationMessageInfo {
public id: number;
public convID: number;
public userID: number;
public timeSent: number;
public imagePath: string;
public message: string;
constructor(info: ConversationMessageInfo) {
this.id = info.id;
this.convID = info.convID;
this.userID = info.userID;
this.timeSent = info.timeSent;
this.imagePath = info.imagePath;
this.message = info.message;
}
get hasImage() : boolean {
return this.imagePath.length > 1;
}
get imageURL() : string {
return pathUserData(this.imagePath);
}
}