merge of branch v0.6-idclean 7180

git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@7187 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
chrisparker126 2014-03-17 20:56:06 +00:00
parent 7815efb16f
commit 0f29d28b1b
397 changed files with 6503 additions and 5702 deletions

View file

@ -85,20 +85,23 @@ const ChatLobbyFlags RS_CHAT_LOBBY_FLAGS_AUTO_SUBSCRIBE( 0x00000001 ) ;
typedef uint64_t ChatLobbyId ;
typedef uint64_t ChatLobbyMsgId ;
typedef std::string ChatLobbyNickName ;
typedef std::string ChatLobbyNickName ;
typedef RsPeerId DistantChatPeerId ;
typedef RsPeerId DistantMsgPeerId ;
class MessageInfo
{
public:
MessageInfo() {}
std::string msgId;
std::string srcId;
RsPeerId srcId;
unsigned int msgflags;
std::list<std::string> msgto;
std::list<std::string> msgcc;
std::list<std::string> msgbcc;
std::list<RsPeerId> msgto;
std::list<RsPeerId> msgcc;
std::list<RsPeerId> msgbcc;
std::string title;
std::string msg;
@ -119,7 +122,7 @@ class MsgInfoSummary
MsgInfoSummary() {}
std::string msgId;
std::string srcId;
RsPeerId srcId;
uint32_t msgflags;
@ -170,7 +173,7 @@ public:
class ChatInfo
{
public:
std::string rsid;
RsPeerId rsid;
std::string peer_nickname;
unsigned int chatflags;
uint32_t sendTime;
@ -182,7 +185,7 @@ class ChatLobbyInvite
{
public:
ChatLobbyId lobby_id ;
std::string peer_id ;
RsPeerId peer_id ;
std::string lobby_name ;
std::string lobby_topic ;
uint32_t lobby_privacy_level ;
@ -196,7 +199,7 @@ class VisibleChatLobbyRecord
ChatLobbyId lobby_id ; // unique id of the lobby
std::string lobby_name ; // name to use for this lobby
std::string lobby_topic ; // topic to use for this lobby
std::set<std::string> participating_friends ; // list of direct friend who participate.
std::set<RsPeerId> participating_friends ; // list of direct friend who participate.
uint32_t total_number_of_peers ; // total number of particpating peers. Might not be
time_t last_report_time ; // last time the lobby was reported.
@ -210,7 +213,7 @@ class ChatLobbyInfo
ChatLobbyId lobby_id ; // unique id of the lobby
std::string lobby_name ; // name to use for this lobby
std::string lobby_topic ; // topic to use for this lobby
std::set<std::string> participating_friends ; // list of direct friend who participate. Used to broadcast sent messages.
std::set<RsPeerId> participating_friends ; // list of direct friend who participate. Used to broadcast sent messages.
std::string nick_name ; // nickname to use for this lobby
uint32_t lobby_privacy_level ; // see RS_CHAT_LOBBY_PRIVACY_LEVEL_PUBLIC / RS_CHAT_LOBBY_PRIVACY_LEVEL_PRIVATE
@ -220,9 +223,9 @@ class ChatLobbyInfo
struct DistantChatInviteInfo
{
std::string hash ; // hash to contact the invite and refer to it.
DistantChatPeerId pid ; // pid to contact the invite and refer to it.
std::string encrypted_radix64_string ; // encrypted radix string used to for the chat link
std::string destination_pgp_id ; // pgp is of the destination of the chat link
RsPgpId destination_pgp_id ; // pgp is of the destination of the chat link
time_t time_of_validity ; // time when te invite becomes unusable
uint32_t invite_flags ; // used to keep track of wether signature was ok or not.
};
@ -237,8 +240,8 @@ extern RsMsgs *rsMsgs;
struct DistantOfflineMessengingInvite
{
std::string issuer_pgp_id ;
std::string hash ;
RsPgpId issuer_pgp_id ;
Sha1CheckSum hash ;
time_t time_of_validity ;
};
@ -284,35 +287,37 @@ virtual bool setMessageTag(const std::string &msgId, uint32_t tagId, bool set) =
virtual bool resetMessageStandardTagTypes(MsgTagType& tags) = 0;
/* private distant messages */
/****************************************/
/* Private distant messages */
/****************************************/
virtual bool createDistantOfflineMessengingInvite(time_t validity_time_stamp, std::string& hash)=0 ;
virtual bool createDistantOfflineMessengingInvite(time_t validity_time_stamp, DistantMsgPeerId& hash)=0 ;
virtual bool getDistantOfflineMessengingInvites(std::vector<DistantOfflineMessengingInvite>& invites) = 0 ;
virtual void enableDistantMessaging(bool b) = 0;
virtual bool distantMessagingEnabled() = 0;
virtual bool getDistantMessageHash(const std::string& pgp_id, std::string& hash) = 0;
virtual bool getDistantMessagePeerId(const RsPgpId& pgp_id, DistantMsgPeerId& peerId) = 0;
/****************************************/
/* Chat */
/****************************************/
virtual bool sendPublicChat(const std::string& msg) = 0;
virtual bool sendPrivateChat(const std::string& id, const std::string& msg) = 0;
virtual bool sendPrivateChat(const RsPeerId& id, const std::string& msg) = 0;
virtual int getPublicChatQueueCount() = 0;
virtual bool getPublicChatQueue(std::list<ChatInfo> &chats) = 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 bool getPrivateChatQueueIds(bool incoming, std::list<RsPeerId> &ids) = 0;
virtual bool getPrivateChatQueue(bool incoming, const RsPeerId& id, std::list<ChatInfo> &chats) = 0;
virtual bool clearPrivateChatQueue(bool incoming, const RsPeerId& id) = 0;
virtual void sendStatusString(const std::string& id,const std::string& status_string) = 0 ;
virtual void sendStatusString(const RsPeerId& id,const std::string& status_string) = 0 ;
virtual void sendGroupChatStatusString(const std::string& status_string) = 0 ;
virtual void setCustomStateString(const std::string& status_string) = 0 ;
virtual std::string getCustomStateString() = 0 ;
virtual std::string getCustomStateString(const std::string& peer_id) = 0 ;
virtual std::string getCustomStateString(const RsPeerId& peer_id) = 0 ;
// get avatar data for peer pid
virtual void getAvatarData(const std::string& pid,unsigned char *& data,int& size) = 0 ;
virtual void getAvatarData(const RsPeerId& pid,unsigned char *& data,int& size) = 0 ;
// set own avatar data
virtual void setOwnAvatarData(const unsigned char *data,int size) = 0 ;
virtual void getOwnAvatarData(unsigned char *& data,int& size) = 0 ;
@ -322,11 +327,11 @@ virtual void getOwnAvatarData(unsigned char *& data,int& size) = 0 ;
/****************************************/
virtual bool joinVisibleChatLobby(const ChatLobbyId& lobby_id) = 0 ;
virtual bool isLobbyId(const std::string& virtual_peer_id,ChatLobbyId& lobby_id) = 0;
virtual bool getVirtualPeerId(const ChatLobbyId& lobby_id,std::string& vpid) = 0;
virtual bool isLobbyId(const RsPeerId& virtual_peer_id,ChatLobbyId& lobby_id) = 0;
virtual bool getVirtualPeerId(const ChatLobbyId& lobby_id,RsPeerId& vpid) = 0;
virtual void getChatLobbyList(std::list<ChatLobbyInfo>& cl_info) = 0;
virtual void getListOfNearbyChatLobbies(std::vector<VisibleChatLobbyRecord>& public_lobbies) = 0 ;
virtual void invitePeerToLobby(const ChatLobbyId& lobby_id,const std::string& peer_id) = 0;
virtual void invitePeerToLobby(const ChatLobbyId& lobby_id,const RsPeerId& peer_id) = 0;
virtual bool acceptLobbyInvite(const ChatLobbyId& id) = 0 ;
virtual void denyLobbyInvite(const ChatLobbyId& id) = 0 ;
virtual void getPendingChatLobbyInvites(std::list<ChatLobbyInvite>& invites) = 0;
@ -337,19 +342,19 @@ virtual bool setDefaultNickNameForChatLobby(const std::string& nick) = 0;
virtual bool getDefaultNickNameForChatLobby(std::string& nick) = 0 ;
virtual void setLobbyAutoSubscribe(const ChatLobbyId& lobby_id, const bool autoSubscribe) = 0 ;
virtual bool getLobbyAutoSubscribe(const ChatLobbyId& lobby_id) = 0 ;
virtual ChatLobbyId createChatLobby(const std::string& lobby_name,const std::string& lobby_topic,const std::list<std::string>& invited_friends,uint32_t lobby_privacy_type) = 0 ;
virtual ChatLobbyId createChatLobby(const std::string& lobby_name,const std::string& lobby_topic,const std::list<RsPeerId>& invited_friends,uint32_t lobby_privacy_type) = 0 ;
/****************************************/
/* Distant chat */
/****************************************/
virtual bool createDistantChatInvite(const std::string& pgp_id,time_t time_of_validity,std::string& encrypted_string) = 0 ;
virtual bool createDistantChatInvite(const RsPgpId& pgp_id,time_t time_of_validity,std::string& encrypted_string) = 0 ;
virtual bool getDistantChatInviteList(std::vector<DistantChatInviteInfo>& invites) = 0;
virtual bool initiateDistantChatConnexion(const std::string& encrypted_string,time_t validity_time,std::string& hash,uint32_t& error_code) = 0;
virtual bool initiateDistantChatConnexion(const std::string& hash,uint32_t& error_code) = 0;
virtual bool getDistantChatStatus(const std::string& hash,uint32_t& status,std::string& pgp_id) = 0;
virtual bool closeDistantChatConnexion(const std::string& hash) = 0;
virtual bool removeDistantChatInvite(const std::string& hash) = 0 ;
virtual bool initiateDistantChatConnexion(const std::string& encrypted_string,time_t validity_time,DistantChatPeerId& pid,uint32_t& error_code) = 0;
virtual bool initiateDistantChatConnexion(const DistantChatPeerId& pid,uint32_t& error_code) = 0;
virtual bool getDistantChatStatus(const DistantChatPeerId& pid,uint32_t& status,RsPgpId& pgp_id) = 0;
virtual bool closeDistantChatConnexion(const DistantChatPeerId& pid) = 0;
virtual bool removeDistantChatInvite(const DistantChatPeerId& pid) = 0 ;
};