LinkUp-P2P-Chat/chatBot/includes/FileMessage.js
2024-06-11 17:40:02 -04:00

27 lines
727 B
JavaScript

class FileMessage {
constructor(peerName, fileName, fileUrl, fileType, peerAvatar, topic, timestamp) {
this.peerName = peerName;
this.fileName = fileName;
this.fileUrl = fileUrl;
this.fileType = fileType;
this.peerAvatar = peerAvatar;
this.topic = topic;
this.timestamp = timestamp;
}
toJsonString() {
return JSON.stringify({
type: 'file',
name: this.peerName,
fileName: this.fileName,
fileUrl: this.fileUrl,
fileType: this.fileType,
avatar: this.peerAvatar,
topic: this.topic,
timestamp: this.timestamp,
});
}
}
export default FileMessage;