mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-05-03 06:35:08 -04:00
added protocol for Avatar exchange in private chat. See http://retroshare.sourceforge.net/wiki/index.php/Chat.
git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@959 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
parent
ba6260d9cb
commit
cdd7377280
8 changed files with 927 additions and 603 deletions
|
@ -146,18 +146,41 @@ void p3Msgs::initRsChatInfo(RsChatItem *c, ChatInfo &i)
|
|||
{
|
||||
i.rsid = c -> PeerId();
|
||||
i.name = mAuthMgr->getName(i.rsid);
|
||||
|
||||
i.chatflags = 0 ;
|
||||
i.msg = c -> message;
|
||||
if (c -> chatFlags & RS_CHAT_FLAG_PRIVATE)
|
||||
|
||||
if (c -> chatFlags & RS_CHAT_FLAG_PRIVATE)
|
||||
{
|
||||
i.chatflags = RS_CHAT_PRIVATE;
|
||||
i.chatflags |= RS_CHAT_PRIVATE;
|
||||
//std::cerr << "RsServer::initRsChatInfo() Chat Private!!!";
|
||||
}
|
||||
else
|
||||
{
|
||||
i.chatflags = RS_CHAT_PUBLIC;
|
||||
i.chatflags |= RS_CHAT_PUBLIC;
|
||||
//std::cerr << "RsServer::initRsChatInfo() Chat Public!!!";
|
||||
}
|
||||
//std::cerr << std::endl;
|
||||
|
||||
if(c->chatFlags & RS_CHAT_FLAG_AVATAR_AVAILABLE)
|
||||
{
|
||||
std::cerr << "p3msgs::initRsChatInfo(): new avatar available for peer " << i.rsid << ". Sending above." << std::endl ;
|
||||
i.chatflags |= RS_CHAT_AVATAR_AVAILABLE;
|
||||
}
|
||||
}
|
||||
|
||||
void p3Msgs::getOwnAvatarData(unsigned char *& data,int& size)
|
||||
{
|
||||
mChatSrv->getOwnAvatarJpegData(data,size) ;
|
||||
}
|
||||
|
||||
void p3Msgs::setOwnAvatarData(const unsigned char *data,int size)
|
||||
{
|
||||
mChatSrv->setOwnAvatarJpegData(data,size) ;
|
||||
}
|
||||
|
||||
void p3Msgs::getAvatarData(std::string pid,unsigned char *& data,int& size)
|
||||
{
|
||||
mChatSrv->getAvatarJpegData(pid,data,size) ;
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -36,38 +36,43 @@ class RsChatItem;
|
|||
|
||||
class p3Msgs: public RsMsgs
|
||||
{
|
||||
public:
|
||||
public:
|
||||
|
||||
p3Msgs(p3AuthMgr *p3a, p3MsgService *p3m, p3ChatService *p3c)
|
||||
:mAuthMgr(p3a), mMsgSrv(p3m), mChatSrv(p3c) { return; }
|
||||
virtual ~p3Msgs() { return; }
|
||||
p3Msgs(p3AuthMgr *p3a, p3MsgService *p3m, p3ChatService *p3c)
|
||||
:mAuthMgr(p3a), mMsgSrv(p3m), mChatSrv(p3c) { return; }
|
||||
virtual ~p3Msgs() { return; }
|
||||
|
||||
/****************************************/
|
||||
/* Message Items */
|
||||
/****************************************/
|
||||
/* Message Items */
|
||||
|
||||
virtual bool getMessageSummaries(std::list<MsgInfoSummary> &msgList);
|
||||
virtual bool getMessage(std::string mId, MessageInfo &msg);
|
||||
virtual bool getMessageSummaries(std::list<MsgInfoSummary> &msgList);
|
||||
virtual bool getMessage(std::string mId, MessageInfo &msg);
|
||||
|
||||
virtual bool MessageSend(MessageInfo &info);
|
||||
virtual bool MessageDelete(std::string mid);
|
||||
virtual bool MessageRead(std::string mid);
|
||||
virtual bool MessageSend(MessageInfo &info);
|
||||
virtual bool MessageDelete(std::string mid);
|
||||
virtual bool MessageRead(std::string mid);
|
||||
|
||||
/****************************************/
|
||||
/* Chat */
|
||||
virtual bool chatAvailable();
|
||||
virtual bool ChatSend(ChatInfo &ci);
|
||||
virtual bool getNewChat(std::list<ChatInfo> &chats);
|
||||
// gets avatar from peer id in jpeg format.
|
||||
virtual void getAvatarData(std::string pid,unsigned char *& data,int& size);
|
||||
virtual void setOwnAvatarData(const unsigned char *data,int size);
|
||||
virtual void getOwnAvatarData(unsigned char *& data,int& size);
|
||||
|
||||
/****************************************/
|
||||
/****************************************/
|
||||
/* Chat */
|
||||
virtual bool chatAvailable();
|
||||
virtual bool ChatSend(ChatInfo &ci);
|
||||
virtual bool getNewChat(std::list<ChatInfo> &chats);
|
||||
|
||||
/****************************************/
|
||||
|
||||
|
||||
private:
|
||||
private:
|
||||
|
||||
void initRsChatInfo(RsChatItem *c, ChatInfo &i);
|
||||
void initRsChatInfo(RsChatItem *c, ChatInfo &i);
|
||||
|
||||
p3AuthMgr *mAuthMgr;
|
||||
p3MsgService *mMsgSrv;
|
||||
p3ChatService *mChatSrv;
|
||||
p3AuthMgr *mAuthMgr;
|
||||
p3MsgService *mMsgSrv;
|
||||
p3ChatService *mChatSrv;
|
||||
};
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue