class LivechatExternalMessage extends RocketChat.models._Base {
	constructor() {
		super('livechat_external_message');
	}

	// FIND
	findByRoomId(roomId, sort = { ts: -1 }) {
		const query = { rid: roomId };

		return this.find(query, { sort: sort });
	}
}

RocketChat.models.LivechatExternalMessage = new LivechatExternalMessage();

class LivechatExternalMessage extends RocketChat.models._Base {
	constructor() {
		super('livechat_external_message');

		if (Meteor.isClient) {
			this._initModel('livechat_external_message');
		}
	}

	// FIND
	findByRoomId(roomId, sort = { ts: -1 }) {
		const query = { rid: roomId };

		return this.find(query, { sort: sort });
	}
}

RocketChat.models.LivechatExternalMessage = new LivechatExternalMessage();

Fix livechat knowledge base by properly initiating it's model
Fix livechat knowledge base by properly initiating it's model

Closes #6101