diff --git a/freechat-client/src/messages.js b/freechat-client/src/messages.js index 91d5bef..9ad9f5d 100644 --- a/freechat-client/src/messages.js +++ b/freechat-client/src/messages.js @@ -1,32 +1,7 @@ -const members = require('./members.js') +const { Message } = require('./types') const got = require('got') const $ = require('jquery') -class Message { - - static TYPES = ['text', 'jpeg', 'png', 'webm', 'mp4'] - - constructor(id, time, content, type, uid, uname, cid) { - this.id = id - this.time = time - this.uid = uid - this.uname = uname - this.cid = cid - - this.type = type - - // basically throw away the content since its not valid and we don't - // bother dealing with invalid data - if(Message.TYPES.indexOf(type) == -1) { - this.content = null - } else { - this.content = content - - } - } - -} -exports.Message = Message /** * @param {String} auth.jwt | jwt for quick auth @@ -123,3 +98,7 @@ exports.recent_messages = async function (auth, server, channel, start_time, end push_message(message) } } + +exports.send = async function() { + console.log('todo') +}