mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-07-30 09:48:59 -04:00
finished removing last AddFeedItem from msg, posted, forums and channels
This commit is contained in:
parent
4fe6e46410
commit
3a3fc25205
10 changed files with 127 additions and 73 deletions
|
@ -192,10 +192,30 @@ void NewsFeed::handleEvent_main_thread(std::shared_ptr<const RsEvent> event)
|
|||
if(event->mType == RsEventType::GXS_FORUMS && (flags & RS_FEED_TYPE_FORUM))
|
||||
handleForumEvent(event);
|
||||
|
||||
if(event->mType == RsEventType::GXS_POSTED && (flags & RS_FEED_TYPE_POSTED))
|
||||
if(event->mType == RsEventType::GXS_POSTED && (flags & RS_FEED_TYPE_MSG))
|
||||
handleMailEvent(event);
|
||||
|
||||
if(event->mType == RsEventType::MAIL_STATUS_CHANGE && (flags & RS_FEED_TYPE_MAIL))
|
||||
handlePostedEvent(event);
|
||||
}
|
||||
|
||||
void NewsFeed::handleMailEvent(std::shared_ptr<const RsEvent> event)
|
||||
{
|
||||
const RsMailStatusEvent *pe = dynamic_cast<const RsMailStatusEvent*>(event.get());
|
||||
if(!pe)
|
||||
return;
|
||||
|
||||
switch(pe->mMailStatusEventCode)
|
||||
{
|
||||
case RsMailStatusEvent::NEW_MESSAGE:
|
||||
for(auto msgid: pe->mChangedMsgIds)
|
||||
addFeedItem( new MsgItem(this, NEWSFEED_MESSAGELIST, msgid, false));
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
void NewsFeed::handlePostedEvent(std::shared_ptr<const RsEvent> event)
|
||||
{
|
||||
const RsGxsPostedEvent *pe = dynamic_cast<const RsGxsPostedEvent*>(event.get());
|
||||
|
@ -517,10 +537,12 @@ void NewsFeed::updateDisplay()
|
|||
addFeedItemChatNew(fi, false);
|
||||
break;
|
||||
|
||||
#ifdef TO_REMOVE
|
||||
case RS_FEED_ITEM_MESSAGE:
|
||||
if (flags & RS_FEED_TYPE_MSG)
|
||||
addFeedItemMessage(fi);
|
||||
break;
|
||||
#endif
|
||||
|
||||
case RS_FEED_ITEM_FILES_NEW:
|
||||
if (flags & RS_FEED_TYPE_FILES)
|
||||
|
@ -1565,6 +1587,7 @@ void NewsFeed::addFeedItemChatNew(const RsFeedItem &fi, bool addWithoutCheck)
|
|||
addFeedItem(cm);
|
||||
}
|
||||
|
||||
#ifdef TO_REMOVE
|
||||
void NewsFeed::addFeedItemMessage(const RsFeedItem &fi)
|
||||
{
|
||||
/* make new widget */
|
||||
|
@ -1587,7 +1610,6 @@ void NewsFeed::addFeedItemFilesNew(const RsFeedItem &/*fi*/)
|
|||
#endif
|
||||
}
|
||||
|
||||
#ifdef TO_REMOVE
|
||||
void NewsFeed::addFeedItemCircleMembReq(const RsFeedItem &fi)
|
||||
{
|
||||
RsGxsCircleId circleId(fi.mId1);
|
||||
|
@ -1667,6 +1689,7 @@ void NewsFeed::deleteFeedItem(QWidget *item, uint32_t /*type*/)
|
|||
}
|
||||
}
|
||||
|
||||
#ifdef TO_REMOVE
|
||||
void NewsFeed::openChat(const RsPeerId &peerId)
|
||||
{
|
||||
#ifdef NEWS_DEBUG
|
||||
|
@ -1682,6 +1705,7 @@ void NewsFeed::openComments(uint32_t /*type*/, const RsGxsGroupId &/*groupId*/,
|
|||
std::cerr << "NewsFeed::openComments() Not Handled Yet";
|
||||
std::cerr << std::endl;
|
||||
}
|
||||
#endif
|
||||
|
||||
static void sendNewsFeedChangedCallback(FeedItem *feedItem, void *data)
|
||||
{
|
||||
|
|
|
@ -75,8 +75,8 @@ public:
|
|||
/* FeedHolder Functions (for FeedItem functionality) */
|
||||
virtual QScrollArea *getScrollArea();
|
||||
virtual void deleteFeedItem(QWidget *item, uint32_t type);
|
||||
virtual void openChat(const RsPeerId& peerId);
|
||||
virtual void openComments(uint32_t type, const RsGxsGroupId &groupId, const QVector<RsGxsMessageId> &versions, const RsGxsMessageId &msgId, const QString &title);
|
||||
// virtual void openChat(const RsPeerId& peerId);
|
||||
// virtual void openComments(uint32_t type, const RsGxsGroupId &groupId, const QVector<RsGxsMessageId> &versions, const RsGxsMessageId &msgId, const QString &title);
|
||||
|
||||
static void testFeeds(uint notifyFlags);
|
||||
static void testFeed(FeedNotify *feedNotify);
|
||||
|
@ -95,7 +95,6 @@ protected:
|
|||
virtual void loadRequest(const TokenQueue *queue, const TokenRequest &req);
|
||||
|
||||
private slots:
|
||||
// void toggleChanMsgItems(bool on);
|
||||
void feedoptions();
|
||||
void sortChanged(int index);
|
||||
|
||||
|
@ -119,9 +118,9 @@ private:
|
|||
void addFeedItemBlogMsg(const RsFeedItem &fi);
|
||||
#endif
|
||||
|
||||
void addFeedItemChatNew(const RsFeedItem &fi, bool addWithoutCheck);
|
||||
void addFeedItemMessage(const RsFeedItem &fi);
|
||||
void addFeedItemFilesNew(const RsFeedItem &fi);
|
||||
// void addFeedItemChatNew(const RsFeedItem &fi, bool addWithoutCheck);
|
||||
// void addFeedItemMessage(const RsFeedItem &fi);
|
||||
// void addFeedItemFilesNew(const RsFeedItem &fi);
|
||||
|
||||
private:
|
||||
/* UI - from Designer */
|
||||
|
|
|
@ -35,8 +35,8 @@ public:
|
|||
|
||||
virtual QScrollArea *getScrollArea() = 0;
|
||||
virtual void deleteFeedItem(QWidget *item, uint32_t type) = 0;
|
||||
virtual void openChat(const RsPeerId& peerId) = 0;
|
||||
virtual void openComments(uint32_t type, const RsGxsGroupId &groupId, const QVector<RsGxsMessageId> &msg_versions, const RsGxsMessageId &msgId, const QString &title)=0;
|
||||
// virtual void openChat(const RsPeerId& peerId) = 0;
|
||||
// virtual void openComments(uint32_t type, const RsGxsGroupId &groupId, const QVector<RsGxsMessageId> &msg_versions, const RsGxsMessageId &msgId, const QString &title)=0;
|
||||
|
||||
// Workaround for QTBUG-3372
|
||||
void lockLayout(QWidget *feedItem, bool lock);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue