mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-12-16 17:13:58 -05:00
fixed forum/channel subscribe notifications
This commit is contained in:
parent
301874e756
commit
a54cf981a6
9 changed files with 254 additions and 135 deletions
|
|
@ -25,6 +25,7 @@
|
|||
#include "GxsForumUserNotify.h"
|
||||
#include "gui/notifyqt.h"
|
||||
#include "gui/gxs/GxsGroupShareKey.h"
|
||||
#include "util/qtthreadsutils.h"
|
||||
#include "gui/common/GroupTreeWidget.h"
|
||||
|
||||
class GxsForumGroupInfoData : public RsUserdata
|
||||
|
|
@ -41,6 +42,29 @@ GxsForumsDialog::GxsForumsDialog(QWidget *parent)
|
|||
: GxsGroupFrameDialog(rsGxsForums, parent)
|
||||
{
|
||||
mCountChildMsgs = true;
|
||||
mEventHandlerId = 0;
|
||||
// Needs to be asynced because this function is likely to be called by another thread!
|
||||
|
||||
rsEvents->registerEventsHandler( [this](std::shared_ptr<const RsEvent> event) { RsQThreadUtils::postToObject( [=]() { handleEvent_main_thread(event); }, this ); }, mEventHandlerId );
|
||||
}
|
||||
|
||||
void GxsForumsDialog::handleEvent_main_thread(std::shared_ptr<const RsEvent> event)
|
||||
{
|
||||
if(event->mType == RsEventType::GXS_FORUMS)
|
||||
{
|
||||
const RsGxsForumEvent *e = dynamic_cast<const RsGxsForumEvent*>(event.get());
|
||||
|
||||
if(!e)
|
||||
return;
|
||||
|
||||
switch(e->mForumEventCode)
|
||||
{
|
||||
case RsGxsForumEvent::SUBSCRIBE_STATUS_CHANGED: updateDisplay(true);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
GxsForumsDialog::~GxsForumsDialog()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue