mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-05-29 11:01:22 -04:00
Changed the chat service from a timer tick from the gui to a service tick.
Created a new notifier for new chat available - NOTIFY_LIST_CHAT. Removed the QTimer in PeersDialog and connect the signal. Created news feed for public chat (prework of defnax, need still some gui changes) git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@3413 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
parent
c7c6f6d36a
commit
b6b5fa5cd6
18 changed files with 832 additions and 175 deletions
|
@ -159,56 +159,9 @@ void p3Msgs::sendStatusString(const std::string& peer_id,const std::string& stat
|
|||
mChatSrv->sendStatusString(peer_id,status_string);
|
||||
}
|
||||
|
||||
bool p3Msgs::chatAvailable()
|
||||
{
|
||||
return mChatSrv->receivedItems();
|
||||
}
|
||||
|
||||
bool p3Msgs::getNewChat(std::list<ChatInfo> &chats)
|
||||
{
|
||||
/* get any messages and push them to iface */
|
||||
|
||||
// get the items from the list.
|
||||
std::list<RsChatMsgItem *> clist = mChatSrv -> getChatQueue();
|
||||
if (clist.size() < 1)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
std::list<RsChatMsgItem *>::iterator it;
|
||||
for(it = clist.begin(); it != clist.end(); it++)
|
||||
{
|
||||
ChatInfo ci;
|
||||
initRsChatInfo((*it), ci);
|
||||
chats.push_back(ci);
|
||||
delete (*it);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
/**** HELPER FNS For Chat/Msg/Channel Lists ************
|
||||
*
|
||||
* The iface->Mutex is required to be locked
|
||||
* for intAddChannel / intAddChannelMsg.
|
||||
*/
|
||||
|
||||
void p3Msgs::initRsChatInfo(RsChatMsgItem *c, ChatInfo &i)
|
||||
{
|
||||
i.rsid = c -> PeerId();
|
||||
i.name = rsPeers->getPeerName(c -> PeerId());
|
||||
i.chatflags = 0 ;
|
||||
i.msg = c -> message;
|
||||
|
||||
if (c -> chatFlags & RS_CHAT_FLAG_PRIVATE)
|
||||
{
|
||||
i.chatflags |= RS_CHAT_PRIVATE;
|
||||
//std::cerr << "RsServer::initRsChatInfo() Chat Private!!!";
|
||||
}
|
||||
else
|
||||
{
|
||||
i.chatflags |= RS_CHAT_PUBLIC;
|
||||
//std::cerr << "RsServer::initRsChatInfo() Chat Public!!!";
|
||||
}
|
||||
return mChatSrv->getChatQueue(chats);
|
||||
}
|
||||
|
||||
void p3Msgs::getOwnAvatarData(unsigned char *& data,int& size)
|
||||
|
|
|
@ -107,9 +107,9 @@ class p3Msgs: public RsMsgs
|
|||
/****************************************/
|
||||
/* Chat */
|
||||
/*!
|
||||
* @return whether chat is available
|
||||
* sends chat (public and private)
|
||||
* @param ci chat info
|
||||
*/
|
||||
virtual bool chatAvailable();
|
||||
virtual bool ChatSend(ChatInfo &ci);
|
||||
|
||||
/*!
|
||||
|
@ -135,8 +135,6 @@ class p3Msgs: public RsMsgs
|
|||
|
||||
private:
|
||||
|
||||
void initRsChatInfo(RsChatMsgItem *c, ChatInfo &i);
|
||||
|
||||
p3MsgService *mMsgSrv;
|
||||
p3ChatService *mChatSrv;
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue