mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-05-03 06:35:08 -04:00
Added feed item for Posted group and message
git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@7694 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
parent
7014a8f171
commit
3ef04a61c9
15 changed files with 1048 additions and 120 deletions
|
@ -70,6 +70,7 @@ const uint32_t RS_FEED_TYPE_CHAT = 0x0100;
|
|||
const uint32_t RS_FEED_TYPE_MSG = 0x0200;
|
||||
const uint32_t RS_FEED_TYPE_FILES = 0x0400;
|
||||
const uint32_t RS_FEED_TYPE_SECURITY = 0x0800;
|
||||
const uint32_t RS_FEED_TYPE_POSTED = 0x1000;
|
||||
|
||||
const uint32_t RS_FEED_ITEM_PEER_CONNECT = RS_FEED_TYPE_PEER | 0x0001;
|
||||
const uint32_t RS_FEED_ITEM_PEER_DISCONNECT = RS_FEED_TYPE_PEER | 0x0002;
|
||||
|
@ -97,6 +98,10 @@ const uint32_t RS_FEED_ITEM_FORUM_MSG = RS_FEED_TYPE_FORUM | 0x0003;
|
|||
//const uint32_t RS_FEED_ITEM_BLOG_UPDATE = RS_FEED_TYPE_BLOG | 0x0002;
|
||||
//const uint32_t RS_FEED_ITEM_BLOG_MSG = RS_FEED_TYPE_BLOG | 0x0003;
|
||||
|
||||
const uint32_t RS_FEED_ITEM_POSTED_NEW = RS_FEED_TYPE_POSTED | 0x0001;
|
||||
//const uint32_t RS_FEED_ITEM_POSTED_UPDATE = RS_FEED_TYPE_POSTED | 0x0002;
|
||||
const uint32_t RS_FEED_ITEM_POSTED_MSG = RS_FEED_TYPE_POSTED | 0x0003;
|
||||
|
||||
const uint32_t RS_FEED_ITEM_CHAT_NEW = RS_FEED_TYPE_CHAT | 0x0001;
|
||||
const uint32_t RS_FEED_ITEM_MESSAGE = RS_FEED_TYPE_MSG | 0x0001;
|
||||
const uint32_t RS_FEED_ITEM_FILES_NEW = RS_FEED_TYPE_FILES | 0x0001;
|
||||
|
|
|
@ -32,6 +32,9 @@
|
|||
#include "services/p3postbase.h"
|
||||
#include "serialiser/rsgxscommentitems.h"
|
||||
|
||||
#include "rsserver/p3face.h"
|
||||
#include "retroshare/rsnotify.h"
|
||||
|
||||
// For Dummy Msgs.
|
||||
#include "util/rsrandom.h"
|
||||
#include "util/rsstring.h"
|
||||
|
@ -86,14 +89,20 @@ void p3PostBase::notifyChanges(std::vector<RsGxsNotify *> &changes)
|
|||
std::cerr << "p3PostBase::notifyChanges()";
|
||||
std::cerr << std::endl;
|
||||
|
||||
p3Notify *notify = NULL;
|
||||
if (!changes.empty())
|
||||
{
|
||||
notify = RsServer::notify();
|
||||
}
|
||||
|
||||
std::vector<RsGxsNotify *>::iterator it;
|
||||
|
||||
for(it = changes.begin(); it != changes.end(); ++it)
|
||||
{
|
||||
RsGxsGroupChange *groupChange = dynamic_cast<RsGxsGroupChange *>(*it);
|
||||
RsGxsMsgChange *msgChange = dynamic_cast<RsGxsMsgChange *>(*it);
|
||||
if (msgChange)
|
||||
{
|
||||
RsGxsGroupChange *groupChange = dynamic_cast<RsGxsGroupChange *>(*it);
|
||||
RsGxsMsgChange *msgChange = dynamic_cast<RsGxsMsgChange *>(*it);
|
||||
if (msgChange)
|
||||
{
|
||||
std::cerr << "p3PostBase::notifyChanges() Found Message Change Notification";
|
||||
std::cerr << std::endl;
|
||||
|
||||
|
@ -107,10 +116,19 @@ void p3PostBase::notifyChanges(std::vector<RsGxsNotify *> &changes)
|
|||
// FUTURE OPTIMISATION.
|
||||
// It could be taken a step further and directly request these msgs for an update.
|
||||
addGroupForProcessing(mit->first);
|
||||
}
|
||||
}
|
||||
|
||||
/* pass on Group Changes to GUI */
|
||||
if (notify && msgChange->getType() == RsGxsNotify::TYPE_RECEIVE)
|
||||
{
|
||||
std::vector<RsGxsMessageId>::iterator mit1;
|
||||
for (mit1 = mit->second.begin(); mit1 != mit->second.end(); ++mit1)
|
||||
{
|
||||
notify->AddFeedItem(RS_FEED_ITEM_POSTED_MSG, mit->first.toStdString(), mit1->toStdString());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* pass on Group Changes to GUI */
|
||||
if (groupChange)
|
||||
{
|
||||
std::cerr << "p3PostBase::notifyChanges() Found Group Change Notification";
|
||||
|
@ -122,6 +140,11 @@ void p3PostBase::notifyChanges(std::vector<RsGxsNotify *> &changes)
|
|||
{
|
||||
std::cerr << "p3PostBase::notifyChanges() Incoming Group: " << *git;
|
||||
std::cerr << std::endl;
|
||||
|
||||
if (notify && groupChange->getType() == RsGxsNotify::TYPE_RECEIVE)
|
||||
{
|
||||
notify->AddFeedItem(RS_FEED_ITEM_POSTED_NEW, git->toStdString());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue