mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-05-14 12:02:29 -04:00
Added "Mark all as read/unread" to channels.
Updated open points for forums and channels. git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@7440 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
parent
199c38b2b8
commit
6c3b6c6880
4 changed files with 19 additions and 44 deletions
|
@ -92,6 +92,7 @@ GxsChannelPostsWidget::GxsChannelPostsWidget(const RsGxsGroupId &channelId, QWid
|
|||
|
||||
ui->nameLabel->setMinimumWidth(20);
|
||||
|
||||
mSubscribeFlags = 0;
|
||||
mInProcessSettings = false;
|
||||
|
||||
/* load settings */
|
||||
|
@ -162,11 +163,6 @@ void GxsChannelPostsWidget::updateDisplay(bool complete)
|
|||
}
|
||||
}
|
||||
|
||||
//UserNotify *GxsChannelPostsWidget::getUserNotify(QObject *parent)
|
||||
//{
|
||||
// return new ChannelUserNotify(parent);
|
||||
//}
|
||||
|
||||
void GxsChannelPostsWidget::processSettings(bool load)
|
||||
{
|
||||
mInProcessSettings = true;
|
||||
|
@ -266,6 +262,8 @@ void GxsChannelPostsWidget::insertChannelDetails(const RsGxsChannelGroup &group)
|
|||
{
|
||||
mStateHelper->setActive(TOKEN_TYPE_GROUP_DATA, true);
|
||||
|
||||
mSubscribeFlags = group.mMeta.mSubscribeFlags;
|
||||
|
||||
/* IMAGE */
|
||||
QPixmap chanImage;
|
||||
if (group.mImage.mData != NULL) {
|
||||
|
@ -278,7 +276,7 @@ void GxsChannelPostsWidget::insertChannelDetails(const RsGxsChannelGroup &group)
|
|||
/* set Channel name */
|
||||
ui->nameLabel->setText(QString::fromUtf8(group.mMeta.mGroupName.c_str()));
|
||||
|
||||
if (group.mMeta.mSubscribeFlags & GXS_SERV::GROUP_SUBSCRIBE_PUBLISH)
|
||||
if (mSubscribeFlags & GXS_SERV::GROUP_SUBSCRIBE_PUBLISH)
|
||||
{
|
||||
mStateHelper->setWidgetEnabled(ui->postButton, true);
|
||||
}
|
||||
|
@ -287,7 +285,7 @@ void GxsChannelPostsWidget::insertChannelDetails(const RsGxsChannelGroup &group)
|
|||
mStateHelper->setWidgetEnabled(ui->postButton, false);
|
||||
}
|
||||
|
||||
ui->subscribeToolButton->setSubscribed(IS_GROUP_SUBSCRIBED(group.mMeta.mSubscribeFlags));
|
||||
ui->subscribeToolButton->setSubscribed(IS_GROUP_SUBSCRIBED(mSubscribeFlags));
|
||||
|
||||
bool autoDownload = rsGxsChannels->getChannelAutoDownload(group.mMeta.mGroupId);
|
||||
setAutoDownload(autoDownload);
|
||||
|
@ -557,31 +555,18 @@ void GxsChannelPostsWidget::fillThreadAddMsg(const QString &channelId, const QSt
|
|||
|
||||
void GxsChannelPostsWidget::setAllMessagesRead(bool read)
|
||||
{
|
||||
#if 0
|
||||
if (mChannelId.isNull()) {
|
||||
if (mChannelId.isNull() || !IS_GROUP_SUBSCRIBED(mSubscribeFlags)) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (!rsChannels) {
|
||||
return;
|
||||
QList<GxsChannelPostItem *>::iterator mit;
|
||||
for (mit = mChannelPostItems.begin(); mit != mChannelPostItems.end(); ++mit) {
|
||||
GxsChannelPostItem *item = *mit;
|
||||
RsGxsGrpMsgIdPair msgPair = std::make_pair(item->groupId(), item->messageId());
|
||||
|
||||
uint32_t token;
|
||||
rsGxsChannels->setMessageReadStatus(token, msgPair, read);
|
||||
}
|
||||
|
||||
ChannelInfo ci;
|
||||
if (rsChannels->getChannelInfo(mChannelId, ci) == false) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (ci.channelFlags & RS_DISTRIB_SUBSCRIBED) {
|
||||
std::list<ChannelMsgSummary> msgs;
|
||||
std::list<ChannelMsgSummary>::iterator it;
|
||||
|
||||
rsChannels->getChannelMsgList(mChannelId, msgs);
|
||||
|
||||
for(it = msgs.begin(); it != msgs.end(); it++) {
|
||||
rsChannels->setMessageStatus(mChannelId, it->msgId, CHANNEL_MSG_STATUS_READ, CHANNEL_MSG_STATUS_READ | CHANNEL_MSG_STATUS_UNREAD_BY_USER);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
void GxsChannelPostsWidget::subscribeGroup(bool subscribe)
|
||||
|
@ -641,6 +626,8 @@ void GxsChannelPostsWidget::requestGroupData(const RsGxsGroupId &grpId)
|
|||
std::cerr << std::endl;
|
||||
#endif
|
||||
|
||||
mSubscribeFlags = 0;
|
||||
|
||||
mChannelQueue->cancelActiveRequestTokens(TOKEN_TYPE_GROUP_DATA);
|
||||
|
||||
if (grpId.isNull()) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue