Merge branch 'master' into webui

This commit is contained in:
zeners 2016-01-07 21:02:44 +01:00
commit 7413b32e2d
7 changed files with 428 additions and 425 deletions

View File

@ -1127,8 +1127,7 @@ void RsGxsNetService::locked_createTransactionFromPending(GrpCircleIdRequestVett
#ifdef NXS_NET_DEBUG_1 #ifdef NXS_NET_DEBUG_1
GXSNETDEBUG_PG(grpPend->mPeerId,entry.mGroupId) << " Group Id: " << entry.mGroupId << " PASSED" << std::endl; GXSNETDEBUG_PG(grpPend->mPeerId,entry.mGroupId) << " Group Id: " << entry.mGroupId << " PASSED" << std::endl;
#endif #endif
RsNxsSyncGrpItem* gItem = new RsNxsSyncGrpItem* gItem = new RsNxsSyncGrpItem(mServType);
RsNxsSyncGrpItem(mServType);
gItem->flag = RsNxsSyncGrpItem::FLAG_RESPONSE; gItem->flag = RsNxsSyncGrpItem::FLAG_RESPONSE;
gItem->grpId = entry.mGroupId; gItem->grpId = entry.mGroupId;
gItem->publishTs = 0; gItem->publishTs = 0;
@ -1154,6 +1153,7 @@ void RsGxsNetService::locked_createTransactionFromPending(MsgCircleIdsRequestVet
std::list<RsNxsItem*> itemL; std::list<RsNxsItem*> itemL;
uint32_t transN = locked_getTransactionId(); uint32_t transN = locked_getTransactionId();
RsGxsGroupId grp_id ;
for(; vit != msgPend->mMsgs.end(); ++vit) for(; vit != msgPend->mMsgs.end(); ++vit)
{ {
@ -1167,10 +1167,12 @@ void RsGxsNetService::locked_createTransactionFromPending(MsgCircleIdsRequestVet
mItem->PeerId(msgPend->mPeerId); mItem->PeerId(msgPend->mPeerId);
mItem->transactionNumber = transN; mItem->transactionNumber = transN;
itemL.push_back(mItem); itemL.push_back(mItem);
grp_id = msgPend->mGrpId ;
} }
if(!itemL.empty()) if(!itemL.empty())
locked_pushMsgRespFromList(itemL, msgPend->mPeerId, transN); locked_pushMsgRespFromList(itemL, msgPend->mPeerId,grp_id, transN);
} }
/*bool RsGxsNetService::locked_canReceive(const RsGxsGrpMetaData * const grpMeta /*bool RsGxsNetService::locked_canReceive(const RsGxsGrpMetaData * const grpMeta
@ -2538,8 +2540,9 @@ void RsGxsNetService::locked_genReqMsgTransaction(NxsTransaction* tr)
// we never compare times from different (and potentially badly sync-ed clocks) // we never compare times from different (and potentially badly sync-ed clocks)
std::cerr << "(EE) stepping in part of the code (" << __PRETTY_FUNCTION__ << ") where we shouldn't. This is a bug." << std::endl; std::cerr << "(EE) stepping in part of the code (" << __PRETTY_FUNCTION__ << ") where we shouldn't. This is a bug." << std::endl;
#ifdef TO_REMOVE
locked_stampPeerGroupUpdateTime(pid,grpId,tr->mTransaction->updateTS,msgItemL.size()) ; locked_stampPeerGroupUpdateTime(pid,grpId,tr->mTransaction->updateTS,msgItemL.size()) ;
#endif
return ; return ;
} }
@ -2733,8 +2736,16 @@ void RsGxsNetService::locked_genReqMsgTransaction(NxsTransaction* tr)
} }
else else
{ {
#ifdef NXS_NET_DEBUG_1
GXSNETDEBUG_PG(item->PeerId(),grpId) << " Request list is empty. Not doing anything. " << std::endl;
#endif
// The list to req is empty. That means we already have all messages that this peer can // The list to req is empty. That means we already have all messages that this peer can
// provide. So we can stamp the group from this peer to be up to date. // provide. So we can stamp the group from this peer to be up to date.
// Part of this is already achieved in two other places:
// - the GroupStats exchange system, which counts the messages at each peer. It could also supply TS for the messages, but it does not for the time being
// - client TS are updated when receiving messages
locked_stampPeerGroupUpdateTime(pid,grpId,tr->mTransaction->updateTS,msgItemL.size()) ; locked_stampPeerGroupUpdateTime(pid,grpId,tr->mTransaction->updateTS,msgItemL.size()) ;
} }
} }
@ -3692,8 +3703,7 @@ void RsGxsNetService::handleRecvSyncMessage(RsNxsSyncMsg* item)
{ {
RsGxsMsgMetaData* m = *vit; RsGxsMsgMetaData* m = *vit;
RsNxsSyncMsgItem* mItem = new RsNxsSyncMsgItem* mItem = new RsNxsSyncMsgItem(mServType);
RsNxsSyncMsgItem(mServType);
mItem->flag = RsNxsSyncGrpItem::FLAG_RESPONSE; mItem->flag = RsNxsSyncGrpItem::FLAG_RESPONSE;
mItem->grpId = m->mGroupId; mItem->grpId = m->mGroupId;
mItem->msgId = m->mMsgId; mItem->msgId = m->mMsgId;
@ -3711,7 +3721,7 @@ void RsGxsNetService::handleRecvSyncMessage(RsNxsSyncMsg* item)
#ifdef NXS_NET_DEBUG_0 #ifdef NXS_NET_DEBUG_0
GXSNETDEBUG_PG(item->PeerId(),item->grpId) << " sending final msg info list of " << itemL.size() << " items." << std::endl; GXSNETDEBUG_PG(item->PeerId(),item->grpId) << " sending final msg info list of " << itemL.size() << " items." << std::endl;
#endif #endif
locked_pushMsgRespFromList(itemL, peer, transN); locked_pushMsgRespFromList(itemL, peer, item->grpId,transN);
} }
} }
#ifdef NXS_NET_DEBUG_0 #ifdef NXS_NET_DEBUG_0
@ -3725,13 +3735,13 @@ void RsGxsNetService::handleRecvSyncMessage(RsNxsSyncMsg* item)
delete *vit; delete *vit;
} }
void RsGxsNetService::locked_pushMsgRespFromList(std::list<RsNxsItem*>& itemL, const RsPeerId& sslId, const uint32_t& transN) void RsGxsNetService::locked_pushMsgRespFromList(std::list<RsNxsItem*>& itemL, const RsPeerId& sslId, const RsGxsGroupId& grp_id,const uint32_t& transN)
{ {
#ifdef NXS_NET_DEBUG_1 #ifdef NXS_NET_DEBUG_1
GXSNETDEBUG_P_(sslId) << "locked_pushMsgResponseFromList()" << std::endl; GXSNETDEBUG_PG(sslId,grp_id) << "locked_pushMsgResponseFromList()" << std::endl;
GXSNETDEBUG_P_(sslId) << " nelems = " << itemL.size() << std::endl; GXSNETDEBUG_PG(sslId,grp_id) << " nelems = " << itemL.size() << std::endl;
GXSNETDEBUG_P_(sslId) << " peerId = " << sslId << std::endl; GXSNETDEBUG_PG(sslId,grp_id) << " peerId = " << sslId << std::endl;
GXSNETDEBUG_P_(sslId) << " transN = " << transN << std::endl; GXSNETDEBUG_PG(sslId,grp_id) << " transN = " << transN << std::endl;
#endif #endif
NxsTransaction* tr = new NxsTransaction(); NxsTransaction* tr = new NxsTransaction();
tr->mItems = itemL; tr->mItems = itemL;
@ -3739,10 +3749,22 @@ void RsGxsNetService::locked_pushMsgRespFromList(std::list<RsNxsItem*>& itemL, c
RsNxsTransac* trItem = new RsNxsTransac(mServType); RsNxsTransac* trItem = new RsNxsTransac(mServType);
trItem->transactFlag = RsNxsTransac::FLAG_BEGIN_P1 | RsNxsTransac::FLAG_TYPE_MSG_LIST_RESP; trItem->transactFlag = RsNxsTransac::FLAG_BEGIN_P1 | RsNxsTransac::FLAG_TYPE_MSG_LIST_RESP;
trItem->nItems = itemL.size(); trItem->nItems = itemL.size();
trItem->timestamp = 0; trItem->timestamp = 0 ;
trItem->PeerId(sslId); trItem->PeerId(sslId);
trItem->transactionNumber = transN; trItem->transactionNumber = transN;
ServerMsgMap::const_iterator cit = mServerMsgUpdateMap.find(grp_id);
// This time stamp is not supposed to be used on the other side. We just set it to avoid sending an uninitialiszed value.
if(cit != mServerMsgUpdateMap.end())
trItem->updateTS = cit->second->msgUpdateTS;
else
{
std::cerr << "(EE) cannot find a server TS for message of group " << grp_id << " in locked_pushMsgRespFromList. This is weird." << std::endl;
trItem->updateTS = 0 ;
}
// also make a copy for the resident transaction // also make a copy for the resident transaction
tr->mTransaction = new RsNxsTransac(*trItem); tr->mTransaction = new RsNxsTransac(*trItem);
tr->mTransaction->PeerId(mOwnId); tr->mTransaction->PeerId(mOwnId);

View File

@ -364,7 +364,7 @@ private:
void locked_pushMsgTransactionFromList(std::list<RsNxsItem*>& reqList, const RsPeerId& peerId, const uint32_t& transN); void locked_pushMsgTransactionFromList(std::list<RsNxsItem*>& reqList, const RsPeerId& peerId, const uint32_t& transN);
void locked_pushGrpTransactionFromList(std::list<RsNxsItem*>& reqList, const RsPeerId& peerId, const uint32_t& transN); void locked_pushGrpTransactionFromList(std::list<RsNxsItem*>& reqList, const RsPeerId& peerId, const uint32_t& transN);
void locked_pushGrpRespFromList(std::list<RsNxsItem*>& respList, const RsPeerId& peer, const uint32_t& transN); void locked_pushGrpRespFromList(std::list<RsNxsItem*>& respList, const RsPeerId& peer, const uint32_t& transN);
void locked_pushMsgRespFromList(std::list<RsNxsItem*>& itemL, const RsPeerId& sslId, const uint32_t& transN); void locked_pushMsgRespFromList(std::list<RsNxsItem*>& itemL, const RsPeerId& sslId, const RsGxsGroupId &grp_id, const uint32_t& transN);
void syncWithPeers(); void syncWithPeers();
void syncGrpStatistics(); void syncGrpStatistics();
void addGroupItemToList(NxsTransaction*& tr, void addGroupItemToList(NxsTransaction*& tr,

View File

@ -1465,6 +1465,8 @@ bool p3GxsTunnelService::closeExistingTunnel(const RsGxsTunnelId& tunnel_id, uin
if(it2 != _gxs_tunnel_virtual_peer_ids.end()) if(it2 != _gxs_tunnel_virtual_peer_ids.end())
hash = it2->second.hash ; hash = it2->second.hash ;
else
hash = it->second.hash ;
// check how many clients are used. If empty, close the tunnel // check how many clients are used. If empty, close the tunnel

View File

@ -6,8 +6,8 @@
<rect> <rect>
<x>0</x> <x>0</x>
<y>0</y> <y>0</y>
<width>1484</width> <width>745</width>
<height>791</height> <height>500</height>
</rect> </rect>
</property> </property>
<property name="sizePolicy"> <property name="sizePolicy">
@ -19,8 +19,23 @@
<property name="windowTitle"> <property name="windowTitle">
<string/> <string/>
</property> </property>
<layout class="QVBoxLayout" name="verticalLayout_6"> <layout class="QGridLayout" name="gridLayout_5">
<item> <property name="leftMargin">
<number>0</number>
</property>
<property name="topMargin">
<number>0</number>
</property>
<property name="rightMargin">
<number>0</number>
</property>
<property name="bottomMargin">
<number>0</number>
</property>
<property name="horizontalSpacing">
<number>0</number>
</property>
<item row="0" column="0">
<widget class="QFrame" name="titleBarFrame"> <widget class="QFrame" name="titleBarFrame">
<property name="sizePolicy"> <property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Maximum"> <sizepolicy hsizetype="Preferred" vsizetype="Maximum">
@ -35,6 +50,18 @@
<enum>QFrame::Sunken</enum> <enum>QFrame::Sunken</enum>
</property> </property>
<layout class="QHBoxLayout" name="horizontalLayout"> <layout class="QHBoxLayout" name="horizontalLayout">
<property name="leftMargin">
<number>2</number>
</property>
<property name="topMargin">
<number>2</number>
</property>
<property name="rightMargin">
<number>2</number>
</property>
<property name="bottomMargin">
<number>2</number>
</property>
<item> <item>
<widget class="QLabel" name="titleBarPixmap"> <widget class="QLabel" name="titleBarPixmap">
<property name="minimumSize"> <property name="minimumSize">
@ -107,7 +134,7 @@
</layout> </layout>
</widget> </widget>
</item> </item>
<item> <item row="1" column="0">
<widget class="QSplitter" name="splitter"> <widget class="QSplitter" name="splitter">
<property name="orientation"> <property name="orientation">
<enum>Qt::Horizontal</enum> <enum>Qt::Horizontal</enum>
@ -123,7 +150,16 @@
<enum>QFrame::Sunken</enum> <enum>QFrame::Sunken</enum>
</property> </property>
<layout class="QHBoxLayout" name="horizontalLayout_2"> <layout class="QHBoxLayout" name="horizontalLayout_2">
<property name="margin"> <property name="leftMargin">
<number>2</number>
</property>
<property name="topMargin">
<number>2</number>
</property>
<property name="rightMargin">
<number>2</number>
</property>
<property name="bottomMargin">
<number>2</number> <number>2</number>
</property> </property>
<item> <item>
@ -219,23 +255,14 @@
<string>Reputation</string> <string>Reputation</string>
</property> </property>
<property name="textAlignment"> <property name="textAlignment">
<set>AlignLeft|AlignVCenter</set> <set>AlignLeading|AlignVCenter</set>
</property> </property>
</column> </column>
</widget> </widget>
</item> </item>
</layout> </layout>
</widget> </widget>
<widget class="QTabWidget" name="tabWidget1"> <widget class="QWidget" name="layoutWidget">
<property name="currentIndex">
<number>0</number>
</property>
<widget class="QWidget" name="tab_2">
<attribute name="title">
<string>Person</string>
</attribute>
<layout class="QVBoxLayout" name="verticalLayout">
<item>
<layout class="QVBoxLayout" name="verticalLayout_4"> <layout class="QVBoxLayout" name="verticalLayout_4">
<item> <item>
<widget class="QFrame" name="headerFrame"> <widget class="QFrame" name="headerFrame">
@ -292,7 +319,16 @@
<layout class="QGridLayout" name="gridLayout_3"> <layout class="QGridLayout" name="gridLayout_3">
<item row="0" column="0"> <item row="0" column="0">
<layout class="QGridLayout" name="gridLayout"> <layout class="QGridLayout" name="gridLayout">
<property name="margin"> <property name="leftMargin">
<number>6</number>
</property>
<property name="topMargin">
<number>6</number>
</property>
<property name="rightMargin">
<number>6</number>
</property>
<property name="bottomMargin">
<number>6</number> <number>6</number>
</property> </property>
<property name="spacing"> <property name="spacing">
@ -466,7 +502,16 @@
<layout class="QVBoxLayout" name="verticalLayout_2"> <layout class="QVBoxLayout" name="verticalLayout_2">
<item> <item>
<layout class="QGridLayout" name="gridLayout_2"> <layout class="QGridLayout" name="gridLayout_2">
<property name="margin"> <property name="leftMargin">
<number>6</number>
</property>
<property name="topMargin">
<number>6</number>
</property>
<property name="rightMargin">
<number>6</number>
</property>
<property name="bottomMargin">
<number>6</number> <number>6</number>
</property> </property>
<item row="2" column="1"> <item row="2" column="1">
@ -587,77 +632,6 @@ p, li { white-space: pre-wrap; }
</spacer> </spacer>
</item> </item>
</layout> </layout>
</item>
</layout>
</widget>
<widget class="QWidget" name="tab">
<attribute name="title">
<string>Circles</string>
</attribute>
<layout class="QGridLayout" name="gridLayout_5">
<item row="0" column="0">
<layout class="QHBoxLayout" name="horizontalLayout_7">
<item>
<widget class="QPushButton" name="pushButton_extCircle">
<property name="text">
<string>Create Circle</string>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="pushButton_editCircle">
<property name="text">
<string>Edit Circle</string>
</property>
</widget>
</item>
<item>
<spacer name="horizontalSpacer">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
</layout>
</item>
<item row="1" column="0">
<widget class="QTreeWidget" name="treeWidget_membership">
<property name="contextMenuPolicy">
<enum>Qt::CustomContextMenu</enum>
</property>
<property name="sortingEnabled">
<bool>true</bool>
</property>
<column>
<property name="text">
<string>Name</string>
</property>
</column>
<column>
<property name="text">
<string>IDs</string>
</property>
</column>
<item>
<property name="text">
<string>Public Circles</string>
</property>
</item>
<item>
<property name="text">
<string>Personal Circles</string>
</property>
</item>
</widget>
</item>
</layout>
</widget>
</widget> </widget>
</widget> </widget>
</item> </item>

View File

@ -292,7 +292,7 @@
</font> </font>
</property> </property>
<property name="toolTip"> <property name="toolTip">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;This box expects your friend's Retroshare certificate. WARNING: this is different from your PGP key. Do not paste your PGP key here (or even a part of it). It's not going to work.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string> <string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;This box expects your friend's Retroshare certificate. WARNING: this is different from your friend's PGP key. Do not paste your friend's PGP key here (not even a part of it). It's not going to work.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property> </property>
<property name="lineWrapMode"> <property name="lineWrapMode">
<enum>QPlainTextEdit::NoWrap</enum> <enum>QPlainTextEdit::NoWrap</enum>

View File

@ -390,6 +390,7 @@
<file>emojione/1F597.png</file> <file>emojione/1F597.png</file>
<file>emojione/1F598.png</file> <file>emojione/1F598.png</file>
<file>emojione/1F599.png</file> <file>emojione/1F599.png</file>
<file>emojione/1F59E.png</file>
<file>emojione/1F600.png</file> <file>emojione/1F600.png</file>
<file>emojione/1F601.png</file> <file>emojione/1F601.png</file>
<file>emojione/1F602.png</file> <file>emojione/1F602.png</file>

View File

@ -130,6 +130,10 @@
":thumbsdown:|:-1:|(N)|(n)":"emojione/1F44E.png"; ":thumbsdown:|:-1:|(N)|(n)":"emojione/1F44E.png";
":muscle:":"emojione/1F4AA.png"; ":muscle:":"emojione/1F4AA.png";
":middle_finger:|":"emojione/1F595.png"; ":middle_finger:|":"emojione/1F595.png";
":finger_pointing_down:":"emojione/1F597.png";
":finger_pointing_left:":"emojione/1F598.png";
":finger_pointing_right:":"emojione/1F599.png";
":finger_pointing_up:":"emojione/1F59E.png";
":coffee:|(C)|(c)":"emojione/2615.png"; ":coffee:|(C)|(c)":"emojione/2615.png";
":sake:":"emojione/1F376.png"; ":sake:":"emojione/1F376.png";
":tea:":"emojione/1F375.png"; ":tea:":"emojione/1F375.png";