#include "ChatMessage.h"

ChatBuddy::ChatBuddy(int id, const std::string & name) {
	this->id_ = id;
	this->name_ = name;
}

int ChatBuddy::getId() {
	return id_;
}

std::string & ChatBuddy::getName() {
	return name_;
}

id_t ChatMessage::getBuddyId() {
	return buddyId_;
}

std::string & ChatMessage::getText() {
	return text_;
}
	
std::string & ChatMessage::geTimeStamp() {
	return timeStamp_;
}

ChatMessage * ChatMessage::createOutgoingMessage(id_t buddyId, const std::string & text) {
	return new ChatMessage(OUTGOING_CHAT_MESSAGE, buddyId, text, "time");
}

ChatMessage * ChatMessage::createIncomingMessage(id_t buddyId, const std::string & text, const std::string & timeStamp) {
	return new ChatMessage(INCOMING_CHAT_MESSAGE, buddyId, text, timeStamp);
}

bool ChatMessage::isIncoming() {
	return type_ == INCOMING_CHAT_MESSAGE;
}

bool ChatMessage::isOutgoing() {
	return type_ == OUTGOING_CHAT_MESSAGE;
}