2018-11-14 15:14:40 -05:00
|
|
|
/*******************************************************************************
|
|
|
|
* retroshare-gui/src/gui/gxs/GxsUserNotify.cpp *
|
|
|
|
* *
|
|
|
|
* Copyright 2014 Retroshare Team <retroshare.project@gmail.com> *
|
|
|
|
* *
|
|
|
|
* This program is free software: you can redistribute it and/or modify *
|
|
|
|
* it under the terms of the GNU Affero General Public License as *
|
|
|
|
* published by the Free Software Foundation, either version 3 of the *
|
|
|
|
* License, or (at your option) any later version. *
|
|
|
|
* *
|
|
|
|
* This program is distributed in the hope that it will be useful, *
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
|
|
|
|
* GNU Affero General Public License for more details. *
|
|
|
|
* *
|
|
|
|
* You should have received a copy of the GNU Affero General Public License *
|
|
|
|
* along with this program. If not, see <https://www.gnu.org/licenses/>. *
|
|
|
|
* *
|
|
|
|
*******************************************************************************/
|
2014-07-06 06:32:13 -04:00
|
|
|
|
|
|
|
#include "GxsUserNotify.h"
|
2020-02-06 13:57:23 -05:00
|
|
|
//#include "gui/gxs/RsGxsUpdateBroadcastBase.h"
|
2014-07-06 06:32:13 -04:00
|
|
|
|
|
|
|
#include "retroshare/rsgxsifacehelper.h"
|
2020-04-05 04:47:27 -04:00
|
|
|
#include "util/qtthreadsutils.h"
|
2014-07-06 06:32:13 -04:00
|
|
|
|
|
|
|
#define TOKEN_TYPE_STATISTICS 1
|
|
|
|
|
2020-04-08 15:11:53 -04:00
|
|
|
GxsUserNotify::GxsUserNotify(RsGxsIfaceHelper *ifaceImpl, const GxsGroupFrameDialog *g,QObject *parent) : UserNotify(parent), mGroupFrameDialog(g)
|
2014-07-06 06:32:13 -04:00
|
|
|
{
|
2014-09-24 19:57:47 -04:00
|
|
|
mNewThreadMessageCount = 0;
|
|
|
|
mNewChildMessageCount = 0;
|
|
|
|
mCountChildMsgs = false;
|
2014-07-06 06:32:13 -04:00
|
|
|
}
|
|
|
|
|
2020-04-04 16:54:54 -04:00
|
|
|
GxsUserNotify::~GxsUserNotify() {}
|
2014-07-06 06:32:13 -04:00
|
|
|
|
|
|
|
void GxsUserNotify::startUpdate()
|
|
|
|
{
|
2014-09-24 19:57:47 -04:00
|
|
|
mNewThreadMessageCount = 0;
|
|
|
|
mNewChildMessageCount = 0;
|
2014-07-06 06:32:13 -04:00
|
|
|
|
|
|
|
|
2020-04-08 15:11:53 -04:00
|
|
|
GxsServiceStatistic stats;
|
|
|
|
mGroupFrameDialog->getServiceStatistics(stats);
|
2020-04-04 16:54:54 -04:00
|
|
|
|
2020-04-08 15:11:53 -04:00
|
|
|
/* Here it goes any code you want to be executed on the Qt Gui
|
2020-04-04 16:54:54 -04:00
|
|
|
* thread, for example to update the data model with new information
|
|
|
|
* after a blocking call to RetroShare API complete */
|
2014-07-06 06:32:13 -04:00
|
|
|
|
2020-04-08 15:11:53 -04:00
|
|
|
mNewThreadMessageCount = stats.mNumThreadMsgsNew;
|
|
|
|
mNewChildMessageCount = stats.mNumChildMsgsNew;
|
2020-04-04 16:54:54 -04:00
|
|
|
|
2020-04-08 15:11:53 -04:00
|
|
|
update();
|
2014-07-06 06:32:13 -04:00
|
|
|
}
|
2020-04-04 16:54:54 -04:00
|
|
|
|