mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-06-24 22:30:42 -04:00
fixed transmission of pinned posts when a forum is edited
This commit is contained in:
parent
1392c7c6fe
commit
59887124ac
2 changed files with 16 additions and 1 deletions
|
@ -113,9 +113,13 @@ bool GxsForumGroupDialog::service_CreateGroup(uint32_t &token, const RsGroupMeta
|
||||||
|
|
||||||
bool GxsForumGroupDialog::service_EditGroup(uint32_t &token, RsGroupMetaData &editedMeta)
|
bool GxsForumGroupDialog::service_EditGroup(uint32_t &token, RsGroupMetaData &editedMeta)
|
||||||
{
|
{
|
||||||
RsGxsForumGroup grp;
|
RsGxsForumGroup grp(mGroupData); // start again from cached information. That allows to keep the pinned posts for instance.
|
||||||
|
|
||||||
|
// now replace data by locally edited/changed information
|
||||||
|
|
||||||
grp.mMeta = editedMeta;
|
grp.mMeta = editedMeta;
|
||||||
grp.mDescription = getDescription().toUtf8().constData();
|
grp.mDescription = getDescription().toUtf8().constData();
|
||||||
|
|
||||||
getSelectedModerators(grp.mAdminList.ids);
|
getSelectedModerators(grp.mAdminList.ids);
|
||||||
|
|
||||||
std::cerr << "GxsForumGroupDialog::service_EditGroup() submitting changes";
|
std::cerr << "GxsForumGroupDialog::service_EditGroup() submitting changes";
|
||||||
|
@ -131,6 +135,7 @@ bool GxsForumGroupDialog::service_loadGroup(uint32_t token, Mode /*mode*/, RsGro
|
||||||
std::cerr << std::endl;
|
std::cerr << std::endl;
|
||||||
|
|
||||||
std::vector<RsGxsForumGroup> groups;
|
std::vector<RsGxsForumGroup> groups;
|
||||||
|
|
||||||
if (!rsGxsForums->getGroupData(token, groups))
|
if (!rsGxsForums->getGroupData(token, groups))
|
||||||
{
|
{
|
||||||
std::cerr << "GxsForumGroupDialog::service_loadGroup() Error getting GroupData";
|
std::cerr << "GxsForumGroupDialog::service_loadGroup() Error getting GroupData";
|
||||||
|
@ -148,9 +153,16 @@ bool GxsForumGroupDialog::service_loadGroup(uint32_t token, Mode /*mode*/, RsGro
|
||||||
std::cerr << "GxsForumsGroupDialog::service_loadGroup() Unfinished Loading";
|
std::cerr << "GxsForumsGroupDialog::service_loadGroup() Unfinished Loading";
|
||||||
std::cerr << std::endl;
|
std::cerr << std::endl;
|
||||||
|
|
||||||
|
// Information handled by GxsGroupDialog. description should rather be handled here in the service part!
|
||||||
|
|
||||||
groupMetaData = groups[0].mMeta;
|
groupMetaData = groups[0].mMeta;
|
||||||
description = QString::fromUtf8(groups[0].mDescription.c_str());
|
description = QString::fromUtf8(groups[0].mDescription.c_str());
|
||||||
|
|
||||||
|
// Local information. Description should be handled here.
|
||||||
|
|
||||||
setSelectedModerators(groups[0].mAdminList.ids);
|
setSelectedModerators(groups[0].mAdminList.ids);
|
||||||
|
|
||||||
|
mGroupData = groups[0]; // keeps the private information
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
|
@ -39,6 +39,9 @@ protected:
|
||||||
virtual bool service_CreateGroup(uint32_t &token, const RsGroupMetaData &meta);
|
virtual bool service_CreateGroup(uint32_t &token, const RsGroupMetaData &meta);
|
||||||
virtual bool service_loadGroup(uint32_t token, Mode mode, RsGroupMetaData& groupMetaData, QString &description);
|
virtual bool service_loadGroup(uint32_t token, Mode mode, RsGroupMetaData& groupMetaData, QString &description);
|
||||||
virtual bool service_EditGroup(uint32_t &token, RsGroupMetaData &editedMeta);
|
virtual bool service_EditGroup(uint32_t &token, RsGroupMetaData &editedMeta);
|
||||||
|
|
||||||
|
private:
|
||||||
|
RsGxsForumGroup mGroupData;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue