2008-02-04 12:55:13 -05:00
|
|
|
|
|
|
|
/*
|
|
|
|
* "$Id: p3face-msgs.cc,v 1.7 2007-05-05 16:10:06 rmf24 Exp $"
|
|
|
|
*
|
|
|
|
* RetroShare C++ Interface.
|
|
|
|
*
|
|
|
|
* Copyright 2004-2006 by Robert Fernie.
|
|
|
|
*
|
|
|
|
* This library is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU Library General Public
|
|
|
|
* License Version 2 as published by the Free Software Foundation.
|
|
|
|
*
|
|
|
|
* This library is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
|
* Library General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU Library General Public
|
|
|
|
* License along with this library; if not, write to the Free Software
|
|
|
|
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
|
|
|
|
* USA.
|
|
|
|
*
|
|
|
|
* Please report all bugs and problems to "retroshare@lunamutt.com".
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#include <iostream>
|
|
|
|
|
2008-07-10 12:29:18 -04:00
|
|
|
#include "util/rsdir.h"
|
|
|
|
#include "util/rsdebug.h"
|
2008-02-04 12:55:13 -05:00
|
|
|
const int p3facemsgzone = 11453;
|
|
|
|
|
|
|
|
#include <sys/time.h>
|
|
|
|
#include <time.h>
|
|
|
|
|
2010-08-06 05:40:23 -04:00
|
|
|
#include "retroshare/rstypes.h"
|
2008-02-04 12:55:13 -05:00
|
|
|
#include "rsserver/p3msgs.h"
|
|
|
|
|
2008-06-24 00:22:42 -04:00
|
|
|
#include "services/p3msgservice.h"
|
2014-11-11 11:10:54 -05:00
|
|
|
#include "chat/p3chatservice.h"
|
2008-06-24 00:22:42 -04:00
|
|
|
|
2010-01-13 16:22:52 -05:00
|
|
|
#include "pqi/authgpg.h"
|
2010-01-13 15:56:55 -05:00
|
|
|
|
2015-03-22 00:45:01 -04:00
|
|
|
using namespace Rs::Msgs;
|
|
|
|
|
2008-02-04 12:55:13 -05:00
|
|
|
/* external reference point */
|
|
|
|
RsMsgs *rsMsgs = NULL;
|
|
|
|
|
|
|
|
/****************************************/
|
|
|
|
/****************************************/
|
|
|
|
|
2014-12-29 16:41:05 -05:00
|
|
|
ChatId::ChatId():
|
|
|
|
type(TYPE_NOT_SET),
|
|
|
|
lobby_id(0)
|
|
|
|
{
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
ChatId::ChatId(RsPeerId id):
|
|
|
|
lobby_id(0)
|
|
|
|
{
|
|
|
|
type = TYPE_PRIVATE;
|
|
|
|
peer_id = id;
|
|
|
|
}
|
|
|
|
|
|
|
|
ChatId::ChatId(RsGxsId id):
|
|
|
|
lobby_id(0)
|
|
|
|
{
|
|
|
|
type = TYPE_PRIVATE_DISTANT;
|
|
|
|
gxs_id = id;
|
|
|
|
}
|
|
|
|
|
|
|
|
ChatId::ChatId(ChatLobbyId id):
|
|
|
|
lobby_id(0)
|
|
|
|
{
|
|
|
|
type = TYPE_LOBBY;
|
|
|
|
lobby_id = id;
|
|
|
|
}
|
|
|
|
|
|
|
|
ChatId::ChatId(std::string str):
|
|
|
|
lobby_id(0)
|
|
|
|
{
|
|
|
|
type = TYPE_NOT_SET;
|
|
|
|
if(str.empty())
|
|
|
|
return;
|
|
|
|
if(str[0] == 'P')
|
|
|
|
{
|
|
|
|
type = TYPE_PRIVATE;
|
|
|
|
peer_id = RsPeerId(str.substr(1));
|
|
|
|
}
|
|
|
|
else if(str[0] == 'D')
|
|
|
|
{
|
|
|
|
type = TYPE_PRIVATE_DISTANT;
|
|
|
|
gxs_id == GXSId(str.substr(1));
|
|
|
|
}
|
|
|
|
else if(str[0] == 'L')
|
|
|
|
{
|
|
|
|
if(sizeof(ChatLobbyId) != 8)
|
|
|
|
{
|
|
|
|
std::cerr << "ChatId::ChatId(std::string) Error: sizeof(ChatLobbyId) != 8. please report this" << std::endl;
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
str = str.substr(1);
|
|
|
|
if(str.size() != 16)
|
|
|
|
return;
|
|
|
|
ChatLobbyId id = 0;
|
|
|
|
for(int i = 0; i<16; i++)
|
|
|
|
{
|
|
|
|
uint8_t c = str[i];
|
|
|
|
if(c <= '9')
|
2015-02-13 14:09:03 -05:00
|
|
|
c -= '0';
|
2014-12-29 16:41:05 -05:00
|
|
|
else
|
2015-02-13 14:09:03 -05:00
|
|
|
c -= 'A' - 10;
|
2014-12-29 16:41:05 -05:00
|
|
|
id = id << 4;
|
|
|
|
id |= c;
|
|
|
|
}
|
|
|
|
type = TYPE_LOBBY;
|
|
|
|
lobby_id = id;
|
|
|
|
}
|
|
|
|
else if(str[0] == 'B')
|
|
|
|
{
|
|
|
|
type = TYPE_BROADCAST;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
ChatId ChatId::makeBroadcastId()
|
|
|
|
{
|
|
|
|
ChatId id;
|
|
|
|
id.type = TYPE_BROADCAST;
|
|
|
|
return id;
|
|
|
|
}
|
|
|
|
|
|
|
|
std::string ChatId::toStdString() const
|
|
|
|
{
|
|
|
|
std::string str;
|
|
|
|
if(type == TYPE_PRIVATE)
|
|
|
|
{
|
|
|
|
str += "P";
|
|
|
|
str += peer_id.toStdString();
|
|
|
|
}
|
|
|
|
else if(type == TYPE_PRIVATE_DISTANT)
|
|
|
|
{
|
|
|
|
str += "D";
|
|
|
|
str += gxs_id.toStdString();
|
|
|
|
}
|
|
|
|
else if(type == TYPE_LOBBY)
|
|
|
|
{
|
|
|
|
if(sizeof(ChatLobbyId) != 8)
|
|
|
|
{
|
|
|
|
std::cerr << "ChatId::toStdString() Error: sizeof(ChatLobbyId) != 8. please report this" << std::endl;
|
|
|
|
return "";
|
|
|
|
}
|
2015-01-22 10:57:24 -05:00
|
|
|
str += "L";
|
|
|
|
|
2014-12-29 16:41:05 -05:00
|
|
|
ChatLobbyId id = lobby_id;
|
|
|
|
for(int i = 0; i<16; i++)
|
|
|
|
{
|
|
|
|
uint8_t c = id >>(64-4);
|
|
|
|
if(c > 9)
|
2015-02-13 14:09:03 -05:00
|
|
|
c += 'A' - 10;
|
2014-12-29 16:41:05 -05:00
|
|
|
else
|
2015-02-13 14:09:03 -05:00
|
|
|
c += '0';
|
2014-12-29 16:41:05 -05:00
|
|
|
str += c;
|
|
|
|
id = id << 4;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else if(type == TYPE_BROADCAST)
|
|
|
|
{
|
|
|
|
str += "B";
|
|
|
|
}
|
|
|
|
return str;
|
|
|
|
}
|
|
|
|
|
|
|
|
bool ChatId::operator <(const ChatId& other) const
|
|
|
|
{
|
|
|
|
if(type != other.type)
|
|
|
|
return type < other.type;
|
|
|
|
else
|
|
|
|
{
|
|
|
|
switch(type)
|
|
|
|
{
|
|
|
|
case TYPE_NOT_SET:
|
|
|
|
return false;
|
|
|
|
case TYPE_PRIVATE:
|
|
|
|
return peer_id < other.peer_id;
|
|
|
|
case TYPE_PRIVATE_DISTANT:
|
|
|
|
return gxs_id < other.gxs_id;
|
|
|
|
case TYPE_LOBBY:
|
|
|
|
return lobby_id < other.lobby_id;
|
|
|
|
case TYPE_BROADCAST:
|
|
|
|
return false;
|
|
|
|
default:
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
bool ChatId::isSameEndpoint(const ChatId &other) const
|
|
|
|
{
|
|
|
|
if(type != other.type)
|
|
|
|
return false;
|
|
|
|
else
|
|
|
|
{
|
|
|
|
switch(type)
|
|
|
|
{
|
|
|
|
case TYPE_NOT_SET:
|
|
|
|
return false;
|
|
|
|
case TYPE_PRIVATE:
|
|
|
|
return peer_id == other.peer_id;
|
|
|
|
case TYPE_PRIVATE_DISTANT:
|
|
|
|
return gxs_id == other.gxs_id;
|
|
|
|
case TYPE_LOBBY:
|
|
|
|
return lobby_id == other.lobby_id;
|
|
|
|
case TYPE_BROADCAST:
|
|
|
|
return true;
|
|
|
|
default:
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
bool ChatId::isNotSet() const
|
|
|
|
{
|
|
|
|
return type == TYPE_NOT_SET;
|
|
|
|
}
|
|
|
|
bool ChatId::isPeerId() const
|
|
|
|
{
|
|
|
|
return type == TYPE_PRIVATE;
|
|
|
|
}
|
|
|
|
bool ChatId::isGxsId() const
|
|
|
|
{
|
|
|
|
return type == TYPE_PRIVATE_DISTANT;
|
|
|
|
}
|
|
|
|
bool ChatId::isLobbyId() const
|
|
|
|
{
|
|
|
|
return type == TYPE_LOBBY;
|
|
|
|
}
|
|
|
|
bool ChatId::isBroadcast() const
|
|
|
|
{
|
|
|
|
return type == TYPE_BROADCAST;
|
|
|
|
}
|
|
|
|
RsPeerId ChatId::toPeerId() const
|
|
|
|
{
|
|
|
|
if(type == TYPE_PRIVATE)
|
|
|
|
return peer_id;
|
|
|
|
else
|
|
|
|
{
|
2015-04-21 16:09:20 -04:00
|
|
|
std::cerr << "ChatId Warning: conversation to RsPeerId requested, but type is different. Current value=\"" << toStdString() << "\"" << std::endl;
|
2014-12-29 16:41:05 -05:00
|
|
|
return RsPeerId();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
RsGxsId ChatId::toGxsId() const
|
|
|
|
{
|
|
|
|
if(type == TYPE_PRIVATE_DISTANT)
|
|
|
|
return gxs_id;
|
|
|
|
else
|
|
|
|
{
|
2015-04-21 16:09:20 -04:00
|
|
|
std::cerr << "ChatId Warning: conversation to RsGxsId requested, but type is different. Current value=\"" << toStdString() << "\"" << std::endl;
|
2014-12-29 16:41:05 -05:00
|
|
|
return RsGxsId();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
ChatLobbyId ChatId::toLobbyId() const
|
|
|
|
{
|
|
|
|
if(type == TYPE_LOBBY)
|
|
|
|
return lobby_id;
|
|
|
|
else
|
|
|
|
{
|
2015-04-21 16:09:20 -04:00
|
|
|
std::cerr << "ChatId Warning: conversation to ChatLobbyId requested, but type is different. Current value=\"" << toStdString() << "\"" << std::endl;
|
2014-12-29 16:41:05 -05:00
|
|
|
return 0;
|
|
|
|
}
|
2011-09-29 05:20:09 -04:00
|
|
|
}
|
|
|
|
|
2008-02-04 12:55:13 -05:00
|
|
|
bool p3Msgs::getMessageSummaries(std::list<MsgInfoSummary> &msgList)
|
|
|
|
{
|
|
|
|
return mMsgSrv->getMessageSummaries(msgList);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
2010-11-02 17:11:11 -04:00
|
|
|
bool p3Msgs::getMessage(const std::string &mid, MessageInfo &msg)
|
2008-02-04 12:55:13 -05:00
|
|
|
{
|
|
|
|
return mMsgSrv->getMessage(mid, msg);
|
|
|
|
}
|
|
|
|
|
2010-05-28 10:42:54 -04:00
|
|
|
void p3Msgs::getMessageCount(unsigned int *pnInbox, unsigned int *pnInboxNew, unsigned int *pnOutbox, unsigned int *pnDraftbox, unsigned int *pnSentbox, unsigned int *pnTrashbox)
|
2010-05-13 15:20:40 -04:00
|
|
|
{
|
2010-05-28 10:42:54 -04:00
|
|
|
mMsgSrv->getMessageCount(pnInbox, pnInboxNew, pnOutbox, pnDraftbox, pnSentbox, pnTrashbox);
|
2010-05-13 15:20:40 -04:00
|
|
|
}
|
2008-02-04 12:55:13 -05:00
|
|
|
|
|
|
|
/****************************************/
|
|
|
|
/****************************************/
|
|
|
|
/* Message Items */
|
|
|
|
bool p3Msgs::MessageSend(MessageInfo &info)
|
|
|
|
{
|
|
|
|
return mMsgSrv->MessageSend(info);
|
|
|
|
}
|
|
|
|
|
2013-07-31 12:34:34 -04:00
|
|
|
void p3Msgs::enableDistantMessaging(bool b)
|
|
|
|
{
|
|
|
|
mMsgSrv->enableDistantMessaging(b);
|
|
|
|
}
|
|
|
|
bool p3Msgs::distantMessagingEnabled()
|
|
|
|
{
|
|
|
|
return mMsgSrv->distantMessagingEnabled();
|
|
|
|
}
|
2013-04-29 16:44:48 -04:00
|
|
|
|
2013-10-03 17:41:34 -04:00
|
|
|
bool p3Msgs::SystemMessage(const std::string &title, const std::string &message, uint32_t systemFlag)
|
2012-05-01 05:18:55 -04:00
|
|
|
{
|
|
|
|
return mMsgSrv->SystemMessage(title, message, systemFlag);
|
|
|
|
}
|
|
|
|
|
2010-11-02 17:11:11 -04:00
|
|
|
bool p3Msgs::MessageToDraft(MessageInfo &info, const std::string &msgParentId)
|
2010-05-25 05:32:14 -04:00
|
|
|
{
|
2010-11-02 17:11:11 -04:00
|
|
|
return mMsgSrv->MessageToDraft(info, msgParentId);
|
2010-05-25 05:32:14 -04:00
|
|
|
}
|
|
|
|
|
2010-11-02 17:11:11 -04:00
|
|
|
bool p3Msgs::MessageToTrash(const std::string &mid, bool bTrash)
|
2010-05-28 10:42:54 -04:00
|
|
|
{
|
2010-11-02 17:11:11 -04:00
|
|
|
return mMsgSrv->MessageToTrash(mid, bTrash);
|
|
|
|
}
|
|
|
|
|
|
|
|
bool p3Msgs::getMsgParentId(const std::string &msgId, std::string &msgParentId)
|
|
|
|
{
|
|
|
|
return mMsgSrv->getMsgParentId(msgId, msgParentId);
|
2010-05-28 10:42:54 -04:00
|
|
|
}
|
|
|
|
|
2008-02-04 12:55:13 -05:00
|
|
|
/****************************************/
|
|
|
|
/****************************************/
|
2010-11-02 17:11:11 -04:00
|
|
|
bool p3Msgs::MessageDelete(const std::string &mid)
|
2008-02-04 12:55:13 -05:00
|
|
|
{
|
2008-07-10 12:29:18 -04:00
|
|
|
//std::cerr << "p3Msgs::MessageDelete() ";
|
|
|
|
//std::cerr << "mid: " << mid << std::endl;
|
2008-02-04 12:55:13 -05:00
|
|
|
|
2010-08-22 18:12:26 -04:00
|
|
|
return mMsgSrv -> removeMsgId(mid);
|
2008-02-04 12:55:13 -05:00
|
|
|
}
|
|
|
|
|
2011-05-23 19:45:31 -04:00
|
|
|
bool p3Msgs::MessageRead(const std::string &mid, bool unreadByUser)
|
2008-02-04 12:55:13 -05:00
|
|
|
{
|
2008-07-10 12:29:18 -04:00
|
|
|
//std::cerr << "p3Msgs::MessageRead() ";
|
|
|
|
//std::cerr << "mid: " << mid << std::endl;
|
2008-02-04 12:55:13 -05:00
|
|
|
|
2011-05-23 19:45:31 -04:00
|
|
|
return mMsgSrv -> markMsgIdRead(mid, unreadByUser);
|
2010-08-22 18:12:26 -04:00
|
|
|
}
|
|
|
|
|
2010-11-02 17:11:11 -04:00
|
|
|
bool p3Msgs::MessageReplied(const std::string &mid, bool replied)
|
|
|
|
{
|
|
|
|
return mMsgSrv->setMsgFlag(mid, replied ? RS_MSG_FLAGS_REPLIED : 0, RS_MSG_FLAGS_REPLIED);
|
|
|
|
}
|
|
|
|
|
|
|
|
bool p3Msgs::MessageForwarded(const std::string &mid, bool forwarded)
|
|
|
|
{
|
|
|
|
return mMsgSrv->setMsgFlag(mid, forwarded ? RS_MSG_FLAGS_FORWARDED : 0, RS_MSG_FLAGS_FORWARDED);
|
|
|
|
}
|
|
|
|
|
2013-09-24 16:19:21 -04:00
|
|
|
bool p3Msgs::MessageLoadEmbeddedImages(const std::string &mid, bool load)
|
|
|
|
{
|
|
|
|
return mMsgSrv->setMsgFlag(mid, load ? RS_MSG_FLAGS_LOAD_EMBEDDED_IMAGES : 0, RS_MSG_FLAGS_LOAD_EMBEDDED_IMAGES);
|
|
|
|
}
|
|
|
|
|
2010-08-22 18:12:26 -04:00
|
|
|
bool p3Msgs::getMessageTagTypes(MsgTagType& tags)
|
|
|
|
{
|
|
|
|
return mMsgSrv->getMessageTagTypes(tags);
|
|
|
|
}
|
2008-02-04 12:55:13 -05:00
|
|
|
|
2011-05-23 19:45:31 -04:00
|
|
|
bool p3Msgs::MessageStar(const std::string &mid, bool star)
|
|
|
|
|
|
|
|
{
|
|
|
|
return mMsgSrv->setMsgFlag(mid, star ? RS_MSG_FLAGS_STAR : 0, RS_MSG_FLAGS_STAR);
|
|
|
|
}
|
|
|
|
|
2010-08-22 18:12:26 -04:00
|
|
|
bool p3Msgs::setMessageTagType(uint32_t tagId, std::string& text, uint32_t rgb_color)
|
|
|
|
{
|
|
|
|
return mMsgSrv->setMessageTagType(tagId, text, rgb_color);
|
2008-02-04 12:55:13 -05:00
|
|
|
}
|
|
|
|
|
2010-08-22 18:12:26 -04:00
|
|
|
bool p3Msgs::removeMessageTagType(uint32_t tagId)
|
2010-08-19 17:47:26 -04:00
|
|
|
{
|
2010-08-22 18:12:26 -04:00
|
|
|
return mMsgSrv->removeMessageTagType(tagId);
|
2010-08-19 17:47:26 -04:00
|
|
|
}
|
|
|
|
|
2010-11-02 17:11:11 -04:00
|
|
|
bool p3Msgs::getMessageTag(const std::string &msgId, MsgTagInfo& info)
|
2010-08-19 17:47:26 -04:00
|
|
|
{
|
2010-08-22 18:12:26 -04:00
|
|
|
return mMsgSrv->getMessageTag(msgId, info);
|
2010-08-19 17:47:26 -04:00
|
|
|
}
|
|
|
|
|
2010-11-02 17:11:11 -04:00
|
|
|
bool p3Msgs::setMessageTag(const std::string &msgId, uint32_t tagId, bool set)
|
2010-08-19 17:47:26 -04:00
|
|
|
{
|
2010-08-22 18:12:26 -04:00
|
|
|
return mMsgSrv->setMessageTag(msgId, tagId, set);
|
2010-08-19 17:47:26 -04:00
|
|
|
}
|
|
|
|
|
2010-08-22 18:12:26 -04:00
|
|
|
bool p3Msgs::resetMessageStandardTagTypes(MsgTagType& tags)
|
2010-08-19 17:47:26 -04:00
|
|
|
{
|
2010-08-22 18:12:26 -04:00
|
|
|
return mMsgSrv->resetMessageStandardTagTypes(tags);
|
2010-08-19 17:47:26 -04:00
|
|
|
}
|
|
|
|
|
2008-02-04 12:55:13 -05:00
|
|
|
/****************************************/
|
|
|
|
/****************************************/
|
2014-12-29 16:41:05 -05:00
|
|
|
bool p3Msgs::sendChat(ChatId destination, std::string msg)
|
2010-09-01 13:56:15 -04:00
|
|
|
{
|
2014-12-29 16:41:05 -05:00
|
|
|
return mChatSrv->sendChat(destination, msg);
|
2010-09-01 13:56:15 -04:00
|
|
|
}
|
|
|
|
|
2014-12-29 16:41:05 -05:00
|
|
|
uint32_t p3Msgs::getMaxMessageSecuritySize(int type)
|
2010-09-20 20:08:06 -04:00
|
|
|
{
|
2014-12-29 16:41:05 -05:00
|
|
|
return mChatSrv->getMaxMessageSecuritySize(type);
|
2009-01-30 14:52:47 -05:00
|
|
|
}
|
|
|
|
|
2014-12-29 16:41:05 -05:00
|
|
|
void p3Msgs::sendStatusString(const ChatId& peer_id, const std::string& status_string)
|
2014-07-06 07:33:04 -04:00
|
|
|
{
|
2014-12-29 16:41:05 -05:00
|
|
|
mChatSrv->sendStatusString(peer_id, status_string);
|
2014-07-06 07:33:04 -04:00
|
|
|
}
|
|
|
|
|
2009-01-30 14:52:47 -05:00
|
|
|
void p3Msgs::getOwnAvatarData(unsigned char *& data,int& size)
|
|
|
|
{
|
|
|
|
mChatSrv->getOwnAvatarJpegData(data,size) ;
|
2008-02-04 12:55:13 -05:00
|
|
|
}
|
|
|
|
|
2009-01-30 14:52:47 -05:00
|
|
|
void p3Msgs::setOwnAvatarData(const unsigned char *data,int size)
|
|
|
|
{
|
|
|
|
mChatSrv->setOwnAvatarJpegData(data,size) ;
|
|
|
|
}
|
|
|
|
|
2014-03-17 16:56:06 -04:00
|
|
|
void p3Msgs::getAvatarData(const RsPeerId& pid,unsigned char *& data,int& size)
|
2009-01-30 14:52:47 -05:00
|
|
|
{
|
|
|
|
mChatSrv->getAvatarJpegData(pid,data,size) ;
|
|
|
|
}
|
|
|
|
|
2014-03-17 16:56:06 -04:00
|
|
|
std::string p3Msgs::getCustomStateString(const RsPeerId& peer_id)
|
2009-10-04 18:27:42 -04:00
|
|
|
{
|
|
|
|
return mChatSrv->getCustomStateString(peer_id) ;
|
|
|
|
}
|
|
|
|
|
2009-09-29 16:37:20 -04:00
|
|
|
std::string p3Msgs::getCustomStateString()
|
|
|
|
{
|
2009-10-04 18:27:42 -04:00
|
|
|
return mChatSrv->getOwnCustomStateString() ;
|
2009-09-29 16:37:20 -04:00
|
|
|
}
|
2009-01-30 14:52:47 -05:00
|
|
|
|
2009-09-29 16:37:20 -04:00
|
|
|
void p3Msgs::setCustomStateString(const std::string& state_string)
|
|
|
|
{
|
2009-10-04 18:27:42 -04:00
|
|
|
mChatSrv->setOwnCustomStateString(state_string) ;
|
2009-09-29 16:37:20 -04:00
|
|
|
}
|
2009-10-04 18:27:42 -04:00
|
|
|
|
2014-03-17 16:56:06 -04:00
|
|
|
bool p3Msgs::getVirtualPeerId(const ChatLobbyId& id,RsPeerId& peer_id)
|
2011-12-04 17:03:54 -05:00
|
|
|
{
|
|
|
|
return mChatSrv->getVirtualPeerId(id,peer_id) ;
|
|
|
|
}
|
2014-03-17 16:56:06 -04:00
|
|
|
bool p3Msgs::isLobbyId(const RsPeerId& peer_id,ChatLobbyId& id)
|
2011-11-23 17:10:37 -05:00
|
|
|
{
|
2011-12-04 09:31:48 -05:00
|
|
|
return mChatSrv->isLobbyId(peer_id,id) ;
|
2011-11-23 17:10:37 -05:00
|
|
|
}
|
2011-12-04 09:31:48 -05:00
|
|
|
|
2015-03-06 16:13:23 -05:00
|
|
|
bool p3Msgs::getChatLobbyInfo(const ChatLobbyId& id,ChatLobbyInfo& linfo)
|
2011-11-23 17:10:37 -05:00
|
|
|
{
|
2015-03-06 16:13:23 -05:00
|
|
|
return mChatSrv->getChatLobbyInfo(id,linfo) ;
|
|
|
|
}
|
|
|
|
void p3Msgs::getChatLobbyList(std::list<ChatLobbyId>& lids)
|
|
|
|
{
|
|
|
|
mChatSrv->getChatLobbyList(lids) ;
|
2011-11-23 17:10:37 -05:00
|
|
|
}
|
2014-03-17 16:56:06 -04:00
|
|
|
void p3Msgs::invitePeerToLobby(const ChatLobbyId& lobby_id, const RsPeerId& peer_id)
|
2011-11-23 17:10:37 -05:00
|
|
|
{
|
|
|
|
mChatSrv->invitePeerToLobby(lobby_id,peer_id) ;
|
|
|
|
}
|
2011-11-27 16:04:10 -05:00
|
|
|
void p3Msgs::unsubscribeChatLobby(const ChatLobbyId& lobby_id)
|
|
|
|
{
|
|
|
|
mChatSrv->unsubscribeChatLobby(lobby_id) ;
|
|
|
|
}
|
2015-03-06 16:13:23 -05:00
|
|
|
bool p3Msgs::setDefaultIdentityForChatLobby(const RsGxsId& nick)
|
2011-12-26 17:43:54 -05:00
|
|
|
{
|
2015-03-06 16:13:23 -05:00
|
|
|
return mChatSrv->setDefaultIdentityForChatLobby(nick) ;
|
2011-12-26 17:43:54 -05:00
|
|
|
}
|
2015-03-06 16:13:23 -05:00
|
|
|
bool p3Msgs::getDefaultIdentityForChatLobby(RsGxsId& nick_name)
|
2011-12-26 17:43:54 -05:00
|
|
|
{
|
2015-03-06 16:13:23 -05:00
|
|
|
return mChatSrv->getDefaultIdentityForChatLobby(nick_name) ;
|
2011-12-26 17:43:54 -05:00
|
|
|
}
|
|
|
|
|
2015-03-06 16:13:23 -05:00
|
|
|
bool p3Msgs::setIdentityForChatLobby(const ChatLobbyId& lobby_id,const RsGxsId& nick)
|
2011-11-27 16:04:10 -05:00
|
|
|
{
|
2015-03-06 16:13:23 -05:00
|
|
|
return mChatSrv->setIdentityForChatLobby(lobby_id,nick) ;
|
2011-11-27 16:04:10 -05:00
|
|
|
}
|
2015-03-06 16:13:23 -05:00
|
|
|
bool p3Msgs::getIdentityForChatLobby(const ChatLobbyId& lobby_id,RsGxsId& nick_name)
|
2011-11-27 16:04:10 -05:00
|
|
|
{
|
2015-03-06 16:13:23 -05:00
|
|
|
return mChatSrv->getIdentityForChatLobby(lobby_id,nick_name) ;
|
2011-11-27 16:04:10 -05:00
|
|
|
}
|
2011-11-23 17:10:37 -05:00
|
|
|
|
2015-03-06 16:13:23 -05:00
|
|
|
bool p3Msgs::joinVisibleChatLobby(const ChatLobbyId& lobby_id,const RsGxsId& own_id)
|
2012-01-07 14:52:58 -05:00
|
|
|
{
|
2015-03-06 16:13:23 -05:00
|
|
|
return mChatSrv->joinVisibleChatLobby(lobby_id,own_id) ;
|
2012-01-07 14:52:58 -05:00
|
|
|
}
|
|
|
|
|
2012-12-04 16:36:05 -05:00
|
|
|
void p3Msgs::getListOfNearbyChatLobbies(std::vector<VisibleChatLobbyRecord>& public_lobbies)
|
2012-01-07 14:52:58 -05:00
|
|
|
{
|
|
|
|
mChatSrv->getListOfNearbyChatLobbies(public_lobbies) ;
|
|
|
|
}
|
|
|
|
|
2015-04-17 17:36:22 -04:00
|
|
|
ChatLobbyId p3Msgs::createChatLobby(const std::string& lobby_name,const RsGxsId& lobby_identity,const std::string& lobby_topic,const std::set<RsPeerId>& invited_friends,ChatLobbyFlags privacy_type)
|
2011-11-27 16:46:49 -05:00
|
|
|
{
|
2015-03-06 16:13:23 -05:00
|
|
|
return mChatSrv->createChatLobby(lobby_name,lobby_identity,lobby_topic,invited_friends,privacy_type) ;
|
2011-11-27 16:46:49 -05:00
|
|
|
}
|
|
|
|
|
2013-06-29 12:15:33 -04:00
|
|
|
void p3Msgs::setLobbyAutoSubscribe(const ChatLobbyId& lobby_id, const bool autoSubscribe)
|
|
|
|
{
|
|
|
|
mChatSrv->setLobbyAutoSubscribe(lobby_id, autoSubscribe);
|
|
|
|
}
|
|
|
|
|
|
|
|
bool p3Msgs::getLobbyAutoSubscribe(const ChatLobbyId& lobby_id)
|
|
|
|
{
|
|
|
|
return mChatSrv->getLobbyAutoSubscribe(lobby_id);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2015-03-06 16:13:23 -05:00
|
|
|
bool p3Msgs::acceptLobbyInvite(const ChatLobbyId& id,const RsGxsId& gxs_id)
|
2011-11-28 17:36:13 -05:00
|
|
|
{
|
2015-03-06 16:13:23 -05:00
|
|
|
return mChatSrv->acceptLobbyInvite(id,gxs_id) ;
|
2011-11-28 17:36:13 -05:00
|
|
|
}
|
|
|
|
void p3Msgs::denyLobbyInvite(const ChatLobbyId& id)
|
|
|
|
{
|
|
|
|
mChatSrv->denyLobbyInvite(id) ;
|
|
|
|
}
|
|
|
|
void p3Msgs::getPendingChatLobbyInvites(std::list<ChatLobbyInvite>& invites)
|
|
|
|
{
|
|
|
|
mChatSrv->getPendingChatLobbyInvites(invites) ;
|
|
|
|
}
|
2014-11-18 10:55:31 -05:00
|
|
|
bool p3Msgs::initiateDistantChatConnexion(const RsGxsId& to_gxs_id,const RsGxsId& from_gxs_id,uint32_t& error_code)
|
2013-04-10 17:21:52 -04:00
|
|
|
{
|
2014-11-18 10:55:31 -05:00
|
|
|
return mChatSrv->initiateDistantChatConnexion(to_gxs_id,from_gxs_id,error_code) ;
|
2013-04-10 17:21:52 -04:00
|
|
|
}
|
2015-02-08 16:06:36 -05:00
|
|
|
bool p3Msgs::getDistantChatStatus(const RsGxsId &gxs_id,uint32_t &status,RsGxsId *from_gxs_id)
|
2013-04-14 11:05:24 -04:00
|
|
|
{
|
2015-02-08 16:06:36 -05:00
|
|
|
return mChatSrv->getDistantChatStatus(gxs_id,status,from_gxs_id) ;
|
2013-04-18 17:41:13 -04:00
|
|
|
}
|
2014-11-16 17:46:18 -05:00
|
|
|
bool p3Msgs::closeDistantChatConnexion(const RsGxsId& pid)
|
2013-06-12 17:10:09 -04:00
|
|
|
{
|
2014-03-17 16:56:06 -04:00
|
|
|
return mChatSrv->closeDistantChatConnexion(pid) ;
|
2013-06-12 17:10:09 -04:00
|
|
|
}
|
2011-11-23 17:10:37 -05:00
|
|
|
|