From 67b6b24e6368d40de4a687a0dec59c6347b1ccf2 Mon Sep 17 00:00:00 2001 From: csoler Date: Wed, 3 Dec 2008 19:39:20 +0000 Subject: [PATCH] added display for author of forum posts git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@865 b45a01b8-16f6-495d-af2f-9b41ad6348cc --- libretroshare/src/services/p3forums.cc | 4 +++- retroshare-gui/src/gui/ForumsDialog.cpp | 10 ++++++++-- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/libretroshare/src/services/p3forums.cc b/libretroshare/src/services/p3forums.cc index b60b5de93..9c09c9e83 100644 --- a/libretroshare/src/services/p3forums.cc +++ b/libretroshare/src/services/p3forums.cc @@ -23,6 +23,7 @@ * */ +#include "rsiface/rspeers.h" #include "services/p3forums.h" uint32_t convertToInternalFlags(uint32_t extFlags); @@ -232,7 +233,7 @@ bool p3Forums::getForumMessage(std::string fId, std::string mId, ForumMsgInfo &i info.title = fmsg->title; info.msg = fmsg->msg; - info.srcId = "SRC"; + info.srcId = rsPeers->getPeerName(fmsg->srcId); return true; } @@ -285,6 +286,7 @@ std::string p3Forums::createForumMsg(std::string fId, std::string pId, fmsg->title = title; fmsg->msg = msg; + fmsg->srcId = rsPeers->getOwnId(); fmsg->timestamp = time(NULL); std::string msgId = publishMsg(fmsg, true); diff --git a/retroshare-gui/src/gui/ForumsDialog.cpp b/retroshare-gui/src/gui/ForumsDialog.cpp index 7f02a4caf..e7fc9c15d 100644 --- a/retroshare-gui/src/gui/ForumsDialog.cpp +++ b/retroshare-gui/src/gui/ForumsDialog.cpp @@ -573,8 +573,11 @@ void ForumsDialog::insertThreads() QString timestamp = qtime.toString("yyyy-MM-dd hh:mm:ss"); item -> setText(0, timestamp); } + ForumMsgInfo msginfo ; + rsForums->getForumMessage(fId,tit->msgId,msginfo) ; + item->setText(1, QString::fromStdWString(tit->title)); - item->setText(2, "author"); + item->setText(2, QString::fromStdString(msginfo.srcId)); item->setText(3, "signed"); item->setText(4, QString::fromStdString(tit->parentId)); item->setText(5, QString::fromStdString(tit->msgId)); @@ -622,8 +625,11 @@ void ForumsDialog::insertThreads() QString timestamp = qtime.toString("yyyy-MM-dd hh:mm:ss"); child -> setText(0, timestamp); } + ForumMsgInfo msginfo ; + rsForums->getForumMessage(fId,mit->msgId,msginfo) ; + child->setText(1, QString::fromStdWString(mit->title)); - child->setText(2, "author"); + child->setText(2, QString::fromStdString(msginfo.srcId)); child->setText(3, "signed"); child->setText(4, QString::fromStdString(mit->parentId)); child->setText(5, QString::fromStdString(mit->msgId));