Basic methods and a bit of interface for chat lobby.

Next:
- chat lobby algorithmics (cache+broadcast system)
- invitation handling
- specification of chat lobby window with list of known/unknown participants


git-svn-id: http://svn.code.sf.net/p/retroshare/code/branches/v0.5-ChatLobby@4685 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
csoler 2011-11-23 22:10:37 +00:00
parent d9244225b7
commit 5cdc36d730
9 changed files with 1137 additions and 116 deletions

View file

@ -61,6 +61,8 @@
#define RS_MSGTAGTYPE_LATER 5
#define RS_MSGTAGTYPE_USER 100
typedef uint64_t ChatLobbyId ;
class MessageInfo
{
public:
@ -135,10 +137,17 @@ class ChatInfo
std::wstring msg;
};
class ChatLobbyInfo
{
public:
ChatLobbyId lobby_id ;
std::string display_name ;
std::list<std::string> participating_friends ; // list of direct friend who participate. Used to broadcast sent messages.
std::list<std::string> additional_peers ; // list of non direct friend who participate. Used to display only.
};
std::ostream &operator<<(std::ostream &out, const MessageInfo &info);
std::ostream &operator<<(std::ostream &out, const ChatInfo &info);
//std::ostream &operator<<(std::ostream &out, const MsgTagInfo);
//std::ostream &operator<<(std::ostream &out, const MsgTagType);
bool operator==(const ChatInfo&, const ChatInfo&);
@ -185,13 +194,15 @@ virtual bool resetMessageStandardTagTypes(MsgTagType& tags) = 0;
/****************************************/
/* Chat */
virtual bool sendPublicChat(const std::wstring& msg) = 0;
virtual bool sendLobbyChat(const std::wstring& msg,const ChatLobbyId& lid) = 0;
virtual bool sendPrivateChat(const std::string& id, const std::wstring& msg) = 0;
virtual int getPublicChatQueueCount() = 0;
virtual int getPublicChatQueueCount() = 0;
virtual bool getPublicChatQueue(std::list<ChatInfo> &chats) = 0;
virtual int getPrivateChatQueueCount(bool incoming) = 0;
virtual int getPrivateChatQueueCount(bool incoming) = 0;
virtual bool getPrivateChatQueueIds(bool incoming, std::list<std::string> &ids) = 0;
virtual bool getPrivateChatQueue(bool incoming, const std::string& id, std::list<ChatInfo> &chats) = 0;
virtual bool clearPrivateChatQueue(bool incoming, const std::string& id) = 0;
virtual void sendStatusString(const std::string& id,const std::string& status_string) = 0 ;
virtual void sendGroupChatStatusString(const std::string& status_string) = 0 ;
@ -205,6 +216,9 @@ virtual void getAvatarData(const std::string& pid,unsigned char *& data,int& siz
virtual void setOwnAvatarData(const unsigned char *data,int size) = 0 ;
virtual void getOwnAvatarData(unsigned char *& data,int& size) = 0 ;
virtual void getChatLobbyList(std::list<ChatLobbyInfo>& cl_info) = 0;
virtual void invitePeerToLobby(const ChatLobbyId& lobby_id,const std::string& peer_id) = 0;
/****************************************/
};