FeedReader: Added check for forum author.

git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@8404 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
thunder2 2015-06-09 18:03:09 +00:00
parent 465e057c13
commit ceb2825f83
5 changed files with 26 additions and 13 deletions

View File

@ -397,7 +397,7 @@ void AddFeedDialog::loadForumGroups(const uint32_t &token)
const RsGxsForumGroup &group = *it;
/* show only own forums */
if (IS_GROUP_PUBLISHER(group.mMeta.mSubscribeFlags) && IS_GROUP_ADMIN(group.mMeta.mSubscribeFlags)) {
if (IS_GROUP_PUBLISHER(group.mMeta.mSubscribeFlags) && IS_GROUP_ADMIN(group.mMeta.mSubscribeFlags) && !group.mMeta.mAuthorId.isNull()) {
ui->forumComboBox->addItem(QString::fromUtf8(group.mMeta.mGroupName.c_str()), QString::fromStdString(group.mMeta.mGroupId.toStdString()));
}
}

View File

@ -119,6 +119,9 @@ QString FeedReaderStringDefs::errorString(RsFeedReaderErrorState errorState, con
case RS_FEED_ERRORSTATE_PROCESS_FORUM_NO_ADMIN:
errorText = QApplication::translate("FeedReaderStringDefs", "You are not admin of the forum");
break;
case RS_FEED_ERRORSTATE_PROCESS_FORUM_NO_AUTHOR:
errorText = QApplication::translate("FeedReaderStringDefs", "Forum has no author");
break;
case RS_FEED_ERRORSTATE_PROCESS_HTML_ERROR:
errorText = QApplication::translate("FeedReaderStringDefs", "Can't read html");

View File

@ -45,6 +45,7 @@ enum RsFeedReaderErrorState {
RS_FEED_ERRORSTATE_PROCESS_FORUM_CREATE = 100,
RS_FEED_ERRORSTATE_PROCESS_FORUM_NOT_FOUND = 101,
RS_FEED_ERRORSTATE_PROCESS_FORUM_NO_ADMIN = 102,
RS_FEED_ERRORSTATE_PROCESS_FORUM_NO_AUTHOR = 103,
RS_FEED_ERRORSTATE_PROCESS_HTML_ERROR = 150,
RS_FEED_ERRORSTATE_PROCESS_XPATH_INTERNAL_ERROR = 151,

View File

@ -659,7 +659,7 @@
</message>
<message>
<location filename="../gui/FeedReaderStringDefs.cpp" line="74"/>
<location filename="../gui/FeedReaderStringDefs.cpp" line="167"/>
<location filename="../gui/FeedReaderStringDefs.cpp" line="170"/>
<source>Unknown</source>
<translation type="unfinished"></translation>
</message>
@ -714,57 +714,62 @@
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../gui/FeedReaderStringDefs.cpp" line="124"/>
<source>Can&apos;t read html</source>
<location filename="../gui/FeedReaderStringDefs.cpp" line="123"/>
<source>Forum has no author</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../gui/FeedReaderStringDefs.cpp" line="127"/>
<source>Internal XPath error</source>
<source>Can&apos;t read html</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../gui/FeedReaderStringDefs.cpp" line="130"/>
<source>Wrong XPath expression</source>
<source>Internal XPath error</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../gui/FeedReaderStringDefs.cpp" line="133"/>
<source>Empty XPath result</source>
<source>Wrong XPath expression</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../gui/FeedReaderStringDefs.cpp" line="136"/>
<source>XSLT format error</source>
<source>Empty XPath result</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../gui/FeedReaderStringDefs.cpp" line="139"/>
<source>XSLT transformation error</source>
<source>XSLT format error</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../gui/FeedReaderStringDefs.cpp" line="142"/>
<source>XSLT transformation error</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../gui/FeedReaderStringDefs.cpp" line="145"/>
<source>Empty XSLT result</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../gui/FeedReaderStringDefs.cpp" line="146"/>
<location filename="../gui/FeedReaderStringDefs.cpp" line="149"/>
<source>Unknown error</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../gui/FeedReaderStringDefs.cpp" line="160"/>
<location filename="../gui/FeedReaderStringDefs.cpp" line="163"/>
<source>No transformation</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../gui/FeedReaderStringDefs.cpp" line="162"/>
<location filename="../gui/FeedReaderStringDefs.cpp" line="165"/>
<source>XPath</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../gui/FeedReaderStringDefs.cpp" line="164"/>
<location filename="../gui/FeedReaderStringDefs.cpp" line="167"/>
<source>XSLT</source>
<translation type="unfinished"></translation>
</message>

View File

@ -1920,6 +1920,10 @@ void p3FeedReader::onProcessSuccess_addMsgs(const std::string &feedId, std::list
if (IS_GROUP_PUBLISHER(forumGroup.mMeta.mSubscribeFlags) && IS_GROUP_ADMIN(forumGroup.mMeta.mSubscribeFlags)) {
forumId = fi->forumId;
authorId = forumGroup.mMeta.mAuthorId;
if (authorId.isNull()) {
errorState = RS_FEED_ERRORSTATE_PROCESS_FORUM_NO_AUTHOR;
}
} else {
errorState = RS_FEED_ERRORSTATE_PROCESS_FORUM_NO_ADMIN;
}