update onion URL to new server, fix forum listing

This commit is contained in:
dsc 2023-08-30 00:42:23 +03:00
parent 24ff2b7120
commit 9c58913ee2
6 changed files with 15 additions and 14 deletions

View file

@ -246,7 +246,8 @@ target_link_libraries(wowlet PUBLIC
${OPENSSL_LIBRARIES}
${CMAKE_DL_LIBS}
${Iconv_LIBRARIES}
/usr/local/lib/libunbound.a
${UNBOUND_LIBRARIES}
# /usr/local/lib/libunbound.a
${EXTRA_LIBRARIES})
# Link Qt libraries

View file

@ -554,10 +554,10 @@ void AppContext::onWSForum(const QJsonArray& forum_data) {
for (auto &&entry: forum_data) {
auto obj = entry.toObject();
auto forumPost = new ForumPost(
obj.value("title").toString(),
obj.value("author").toString(),
obj.value("thread").toString(),
obj.value("member_name").toString(),
obj.value("permalink").toString(),
obj.value("comments").toInt());
obj.value("member_name").toString());
QSharedPointer<ForumPost> r = QSharedPointer<ForumPost>(forumPost);
l.append(r);
}

View file

@ -67,7 +67,7 @@ public:
QString tmpTxDescription;
// https://git.wownero.com/wowlet/wowlet-backend/
QString backendHost = "6wku2m4zrv6j666crlo7lzofv6ud6enzllyhou3ijeigpukymi37caad.onion";
QString backendHost = "l3hkasj5nnrh24yzj4acj5dgqlscq56o5xjvvqsftj55fkonqly5aiid.onion";
unsigned int backendPort = 80;
bool backendTLS = false;
QString backendWSUrl;

View file

@ -56,15 +56,15 @@ QVariant ForumModel::data(const QModelIndex &index, int role) const
return post->title;
case Author:
return post->author;
case Comments:
return QString::number(post->comments);
case DateAdded:
return post->date_added;
default:
return QVariant();
}
}
else if (role == Qt::TextAlignmentRole) {
switch(index.column()) {
case Comments:
case DateAdded:
return Qt::AlignRight;
default:
return QVariant();
@ -85,8 +85,8 @@ QVariant ForumModel::headerData(int section, Qt::Orientation orientation, int ro
return QString("Forum Post");
case Author:
return QString("Author");
case Comments:
return QString("Comments");
case DateAdded:
return QString("Date");
default:
return QVariant();
}

View file

@ -18,7 +18,7 @@ public:
{
Title = 0,
Author,
Comments,
DateAdded,
COUNT
};

View file

@ -7,13 +7,13 @@
#include <QString>
struct ForumPost {
ForumPost(const QString &title, const QString &author, const QString &permalink, int comments)
: title(title), author(author), permalink(permalink), comments(comments){};
ForumPost(const QString &title, const QString &author, const QString &permalink, const QString date_added)
: title(title), author(author), permalink(permalink), date_added(date_added){};
QString title;
QString author;
QString permalink;
int comments;
QString date_added;
};
#endif //WOWLET_FORUMPOST_H