mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-09-15 02:11:53 -04:00
fixed no gxs compilation
git-svn-id: http://svn.code.sf.net/p/retroshare/code/branches/v0.6-IdCleaning@7130 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
parent
2aed4ac047
commit
b90cc5ffea
32 changed files with 221 additions and 183 deletions
|
@ -6,7 +6,7 @@ TARGET = retroshare
|
|||
|
||||
#GXS Stuff.
|
||||
# This should be disabled for releases until further notice.
|
||||
CONFIG += gxs debug
|
||||
#CONFIG += gxs debug
|
||||
#CONFIG += grouter
|
||||
#CONFIG += dsdv
|
||||
|
||||
|
@ -418,8 +418,6 @@ HEADERS += serialiser/rsbaseserial.h \
|
|||
serialiser/rsdiscovery2items.h \
|
||||
serialiser/rsheartbeatitems.h \
|
||||
serialiser/rsrttitems.h \
|
||||
serialiser/rsgxsrecognitems.h \
|
||||
serialiser/rsgxsupdateitems.h
|
||||
|
||||
HEADERS += services/p3chatservice.h \
|
||||
services/p3msgservice.h \
|
||||
|
@ -551,8 +549,6 @@ SOURCES += serialiser/rsbaseserial.cc \
|
|||
serialiser/rsdiscovery2items.cc \
|
||||
serialiser/rsheartbeatitems.cc \
|
||||
serialiser/rsrttitems.cc \
|
||||
serialiser/rsgxsrecognitems.cc \
|
||||
serialiser/rsgxsupdateitems.cc
|
||||
|
||||
SOURCES += services/p3chatservice.cc \
|
||||
services/p3msgservice.cc \
|
||||
|
@ -661,6 +657,8 @@ gxs {
|
|||
gxs/rsgxsifacehelper.h \
|
||||
gxs/gxstokenqueue.h \
|
||||
gxs/rsgxsnetutils.h \
|
||||
serialiser/rsgxsrecognitems.h \
|
||||
serialiser/rsgxsupdateitems.h \
|
||||
gxs/rsgxsiface.h
|
||||
|
||||
|
||||
|
@ -677,6 +675,8 @@ gxs {
|
|||
gxs/gxssecurity.cc \
|
||||
gxs/gxstokenqueue.cc \
|
||||
gxs/rsgxsnetutils.cc \
|
||||
serialiser/rsgxsrecognitems.cc \
|
||||
serialiser/rsgxsupdateitems.cc \
|
||||
gxs/rsgxsutil.cc
|
||||
|
||||
|
||||
|
|
|
@ -412,10 +412,10 @@ const PGPCertificateInfo *AuthGPG::getCertInfoFromStdString(const std::string& p
|
|||
return NULL ;
|
||||
}
|
||||
}
|
||||
//bool AuthGPG::haveSecretKey(const PGPIdType& id) const
|
||||
//{
|
||||
// return PGPHandler::haveSecretKey(PGPIdType(id)) ;
|
||||
//}
|
||||
bool AuthGPG::haveSecretKey(const PGPIdType& id) const
|
||||
{
|
||||
return PGPHandler::haveSecretKey(id) ;
|
||||
}
|
||||
bool AuthGPG::isKeySupported(const PGPIdType& id) const
|
||||
{
|
||||
const PGPCertificateInfo *pc = getCertificateInfo(id) ;
|
||||
|
@ -457,18 +457,12 @@ bool AuthGPG::getGPGDetails(const PGPIdType& pgp_id, RsPeerDetails &d)
|
|||
return true;
|
||||
}
|
||||
|
||||
//bool AuthGPG::getGPGFilteredList(std::list<PGPIdType>& list,bool (*filter)(const PGPCertificateInfo&))
|
||||
//{
|
||||
// RsStackMutex stack(gpgMtxData); /******* LOCKED ******/
|
||||
// std::list<PGPIdType> ids ;
|
||||
//
|
||||
// PGPHandler::getGPGFilteredList(ids,filter) ;
|
||||
//
|
||||
// for(std::list<PGPIdType>::const_iterator it(ids.begin());it!=ids.end();++it)
|
||||
// list.push_back( (*it).toStdString() ) ;
|
||||
//
|
||||
// return true ;
|
||||
//}
|
||||
bool AuthGPG::getGPGFilteredList(std::list<PGPIdType>& list,bool (*filter)(const PGPCertificateInfo&))
|
||||
{
|
||||
RsStackMutex stack(gpgMtxData); /******* LOCKED ******/
|
||||
|
||||
return PGPHandler::getGPGFilteredList(list,filter) ;
|
||||
}
|
||||
|
||||
static bool filter_Validity(const PGPCertificateInfo& /*info*/) { return true ; } //{ return info._validLvl >= PGPCertificateInfo::GPGME_VALIDITY_MARGINAL ; }
|
||||
static bool filter_Accepted(const PGPCertificateInfo& info) { return info._flags & PGPCertificateInfo::PGP_CERTIFICATE_FLAG_ACCEPT_CONNEXION ; }
|
||||
|
@ -517,28 +511,12 @@ bool AuthGPG::getCachedGPGCertificate(const PGPIdType &id, std::string &certific
|
|||
|
||||
|
||||
/* SKTAN : do not know how to use std::string id */
|
||||
// std::string AuthGPG::SaveCertificateToString(const PGPIdType &id,bool include_signatures)
|
||||
// {
|
||||
//
|
||||
// if (!isGPGId(id)) {
|
||||
// std::cerr << "AuthGPG::SaveCertificateToString() unknown ID" << std::endl;
|
||||
// return "";
|
||||
// }
|
||||
//
|
||||
// RsStackMutex stack(gpgMtxEngine); /******* LOCKED ******/
|
||||
//
|
||||
// std::string tmp = PGPHandler::SaveCertificateToString(PGPIdType(id),include_signatures) ;
|
||||
//
|
||||
// // // Try to remove signatures manually.
|
||||
// // //
|
||||
// // std::string cleaned_key ;
|
||||
// //
|
||||
// // if( (!include_signatures) && PGPKeyManagement::createMinimalKey(tmp,cleaned_key))
|
||||
// // return cleaned_key ;
|
||||
// // else
|
||||
//
|
||||
// return tmp;
|
||||
// }
|
||||
std::string AuthGPG::SaveCertificateToString(const PGPIdType &id,bool include_signatures)
|
||||
{
|
||||
RsStackMutex stack(gpgMtxEngine); /******* LOCKED ******/
|
||||
|
||||
return PGPHandler::SaveCertificateToString(id,include_signatures) ;
|
||||
}
|
||||
|
||||
/* import to GnuPG and other Certificates */
|
||||
bool AuthGPG::LoadCertificateFromString(const std::string &str, PGPIdType& gpg_id,std::string& error_string)
|
||||
|
@ -617,10 +595,10 @@ bool AuthGPG::TrustCertificate(const PGPIdType& id, int trustlvl)
|
|||
return privateTrustCertificate(id, trustlvl) ;
|
||||
}
|
||||
|
||||
//bool AuthGPG::encryptDataBin(const PGPIdType& pgp_id,const void *data, unsigned int datalen, unsigned char *sign, unsigned int *signlen)
|
||||
//{
|
||||
// return PGPHandler::encryptDataBin(PGPIdType(pgp_id),data,datalen,sign,signlen) ;
|
||||
//}
|
||||
bool AuthGPG::encryptDataBin(const PGPIdType& pgp_id,const void *data, unsigned int datalen, unsigned char *sign, unsigned int *signlen)
|
||||
{
|
||||
return PGPHandler::encryptDataBin(PGPIdType(pgp_id),data,datalen,sign,signlen) ;
|
||||
}
|
||||
|
||||
bool AuthGPG::decryptDataBin(const void *data, unsigned int datalen, unsigned char *sign, unsigned int *signlen)
|
||||
{
|
||||
|
|
|
@ -747,7 +747,78 @@ bool p3PeerMgrIMPL::addFriend(const RsPeerId& input_id, const PGPIdType& input_g
|
|||
return true;
|
||||
}
|
||||
|
||||
bool p3PeerMgrIMPL::removeFriend(const RsPgpId &id)
|
||||
{
|
||||
#ifdef PEER_DEBUG
|
||||
std::cerr << "p3PeerMgrIMPL::removeFriend() for id : " << id << std::endl;
|
||||
std::cerr << "p3PeerMgrIMPL::removeFriend() mFriendList.size() : " << mFriendList.size() << std::endl;
|
||||
#endif
|
||||
|
||||
rslog(RSL_WARNING, p3peermgrzone, "p3PeerMgr::removeFriend() id: " + id.toStdString());
|
||||
|
||||
std::list<RsPeerId> sslid_toRemove; // This is a list of SSLIds.
|
||||
rsPeers->getAssociatedSSLIds(id,sslid_toRemove) ;
|
||||
|
||||
{
|
||||
RsStackMutex stack(mPeerMtx); /****** STACK LOCK MUTEX *******/
|
||||
|
||||
/* move to othersList */
|
||||
bool success = false;
|
||||
std::map<RsPeerId, peerState>::iterator it;
|
||||
//remove ssl and gpg_ids
|
||||
for(it = mFriendList.begin(); it != mFriendList.end(); it++)
|
||||
{
|
||||
if (find(sslid_toRemove.begin(),sslid_toRemove.end(),it->second.id) != sslid_toRemove.end())
|
||||
{
|
||||
#ifdef PEER_DEBUG
|
||||
std::cerr << "p3PeerMgrIMPL::removeFriend() friend found in the list." << id << std::endl;
|
||||
#endif
|
||||
peerState peer = it->second;
|
||||
|
||||
sslid_toRemove.push_back(it->second.id);
|
||||
|
||||
mOthersList[it->second.id] = peer;
|
||||
mStatusChanged = true;
|
||||
|
||||
success = true;
|
||||
}
|
||||
}
|
||||
|
||||
for(std::list<RsPeerId>::iterator rit = sslid_toRemove.begin(); rit != sslid_toRemove.end(); rit++)
|
||||
if (mFriendList.end() != (it = mFriendList.find(*rit)))
|
||||
mFriendList.erase(it);
|
||||
|
||||
std::map<PGPIdType,ServicePermissionFlags>::iterator it2 = mFriendsPermissionFlags.find(id) ;
|
||||
|
||||
if(it2 != mFriendsPermissionFlags.end())
|
||||
mFriendsPermissionFlags.erase(it2);
|
||||
|
||||
#ifdef PEER_DEBUG
|
||||
std::cerr << "p3PeerMgrIMPL::removeFriend() new mFriendList.size() : " << mFriendList.size() << std::endl;
|
||||
#endif
|
||||
}
|
||||
|
||||
std::list<RsPeerId>::iterator rit;
|
||||
for(rit = sslid_toRemove.begin(); rit != sslid_toRemove.end(); rit++)
|
||||
{
|
||||
mLinkMgr->removeFriend(*rit);
|
||||
}
|
||||
|
||||
/* remove id from all groups */
|
||||
|
||||
std::list<RsPgpId> ids ;
|
||||
ids.push_back(id) ;
|
||||
assignPeersToGroup("", ids, false);
|
||||
|
||||
IndicateConfigChanged(); /**** INDICATE MSG CONFIG CHANGED! *****/
|
||||
|
||||
#ifdef PEER_DEBUG
|
||||
printPeerLists(std::cerr);
|
||||
mLinkMgr->printPeerLists(std::cerr);
|
||||
#endif
|
||||
|
||||
return !sslid_toRemove.empty();
|
||||
}
|
||||
bool p3PeerMgrIMPL::removeFriend(const RsPeerId &id, bool removePgpId)
|
||||
{
|
||||
|
||||
|
|
|
@ -218,6 +218,7 @@ virtual bool addFriend(const RsPeerId&ssl_id, const PGPIdType&gpg_id, uint32_t
|
|||
uint16_t vsDisc = RS_VS_DISC_FULL, uint16_t vsDht = RS_VS_DHT_FULL,
|
||||
time_t lastContact = 0,ServicePermissionFlags = ServicePermissionFlags(RS_SERVICE_PERM_ALL));
|
||||
virtual bool removeFriend(const RsPeerId &ssl_id, bool removePgpId);
|
||||
virtual bool removeFriend(const RsPgpId &pgp_id);
|
||||
|
||||
virtual bool isFriend(const RsPeerId &ssl_id);
|
||||
|
||||
|
|
|
@ -321,8 +321,6 @@ class RsPeers
|
|||
/* Add/Remove Friends */
|
||||
virtual bool addFriend(const SSLIdType &ssl_id, const PGPIdType &gpg_id,ServicePermissionFlags flags = RS_SERVICE_PERM_ALL) = 0;
|
||||
virtual bool removeFriend(const PGPIdType& pgp_id) = 0;
|
||||
virtual bool removeFriend(const SSLIdType& ssl_id) = 0;
|
||||
|
||||
virtual bool removeFriendLocation(const SSLIdType& sslId) = 0;
|
||||
|
||||
/* keyring management */
|
||||
|
|
|
@ -76,7 +76,6 @@ virtual bool gpgSignData(const void *data, const uint32_t len, unsigned char
|
|||
/* Add/Remove Friends */
|
||||
virtual bool addFriend(const RsPeerId &ssl_id, const PGPIdType &gpg_id,ServicePermissionFlags flags = RS_SERVICE_PERM_ALL);
|
||||
virtual bool removeFriend(const PGPIdType& gpgid);
|
||||
virtual bool removeFriend(const RsPeerId& sslid);
|
||||
virtual bool removeFriendLocation(const RsPeerId& sslId);
|
||||
|
||||
/* keyring management */
|
||||
|
|
|
@ -438,7 +438,7 @@ uint32_t RsGxsUpdateSerialiser::sizeGxsMsgUpdate(RsGxsMsgUpdateItem* item)
|
|||
uint32_t RsGxsUpdateSerialiser::sizeGxsServerMsgUpdate(RsGxsServerMsgUpdateItem* item)
|
||||
{
|
||||
uint32_t s = 8; // header size
|
||||
s += GetTlvStringSize(item->grpId);
|
||||
s += item->grpId.serial_size();
|
||||
s += 4; // grp TS
|
||||
|
||||
return s;
|
||||
|
@ -533,7 +533,7 @@ bool RsGxsUpdateSerialiser::serialiseGxsServerMsgUpdate(RsGxsServerMsgUpdateItem
|
|||
/* RsNxsSyncm */
|
||||
|
||||
|
||||
ok &= SetTlvString(data, *size, &offset, TLV_TYPE_STR_GROUPID, item->grpId);
|
||||
ok &= item->grpId.serialise(data, *size, offset) ;
|
||||
ok &= setRawUInt32(data, *size, &offset, item->msgUpdateTS);
|
||||
|
||||
if(offset != tlvsize){
|
||||
|
@ -678,7 +678,7 @@ RsGxsServerMsgUpdateItem* RsGxsUpdateSerialiser::deserialGxsServerMsgUpdate(void
|
|||
/* skip the header */
|
||||
offset += 8;
|
||||
|
||||
ok &= GetTlvString(data, *size, &offset, TLV_TYPE_STR_GROUPID, item->grpId);
|
||||
ok &= item->grpId.deserialise(data, *size, offset) ;
|
||||
ok &= getRawUInt32(data, *size, &offset, &(item->msgUpdateTS));
|
||||
|
||||
if (offset != rssize)
|
||||
|
|
|
@ -152,9 +152,9 @@ int checkOutgoingMessages();
|
|||
virtual void receiveGRouterData(RsGRouterGenericDataItem *item, const GRouterKeyId& key) ;
|
||||
#endif
|
||||
virtual bool handleTunnelRequest(const Sha1CheckSum& hash,const RsPeerId& peer_id) ;
|
||||
virtual void receiveTurtleData(RsTurtleGenericTunnelItem *item,const Sha1CheckSum& hash,const RsPeerId& virtual_peer_id,RsTurtleGenericTunnelItem::Direction direction) ;
|
||||
void addVirtualPeer(const TurtleFileHash&, const TurtleVirtualPeerId&,RsTurtleGenericTunnelItem::Direction dir) ;
|
||||
void removeVirtualPeer(const TurtleFileHash&, const TurtleVirtualPeerId&) ;
|
||||
// virtual void receiveTurtleData(RsTurtleGenericTunnelItem *item,const Sha1CheckSum& hash,const RsPeerId& virtual_peer_id,RsTurtleGenericTunnelItem::Direction direction) ;
|
||||
void addVirtualPeer(const TurtleFileHash&, const TurtleVirtualPeerId&,RsTurtleGenericTunnelItem::Direction dir) {}
|
||||
void removeVirtualPeer(const TurtleFileHash&, const TurtleVirtualPeerId&) {}
|
||||
|
||||
// Utility functions
|
||||
|
||||
|
|
|
@ -494,7 +494,7 @@ void NewsFeed::addFeedItem(QWidget *item)
|
|||
lockLayout(item, false);
|
||||
}
|
||||
|
||||
void NewsFeed::addFeedItemIfUnique(QWidget *item, int itemType, const std::string &sslId, bool replace)
|
||||
void NewsFeed::addFeedItemIfUnique(QWidget *item, int itemType, const RsPeerId &sslId, bool replace)
|
||||
{
|
||||
foreach (QObject *itemObject, widgets) {
|
||||
SecurityItem *secitem = dynamic_cast<SecurityItem*>(itemObject);
|
||||
|
@ -519,7 +519,7 @@ void NewsFeed::addFeedItemIfUnique(QWidget *item, int itemType, const std::strin
|
|||
void NewsFeed::addFeedItemPeerConnect(RsFeedItem &fi)
|
||||
{
|
||||
/* make new widget */
|
||||
PeerItem *pi = new PeerItem(this, NEWSFEED_PEERLIST, fi.mId1, PEER_TYPE_CONNECT, false);
|
||||
PeerItem *pi = new PeerItem(this, NEWSFEED_PEERLIST, RsPeerId(fi.mId1), PEER_TYPE_CONNECT, false);
|
||||
|
||||
/* store */
|
||||
|
||||
|
@ -536,7 +536,7 @@ void NewsFeed::addFeedItemPeerConnect(RsFeedItem &fi)
|
|||
void NewsFeed::addFeedItemPeerDisconnect(RsFeedItem &fi)
|
||||
{
|
||||
/* make new widget */
|
||||
PeerItem *pi = new PeerItem(this, NEWSFEED_PEERLIST, fi.mId1, PEER_TYPE_STD, false);
|
||||
PeerItem *pi = new PeerItem(this, NEWSFEED_PEERLIST, RsPeerId(fi.mId1), PEER_TYPE_STD, false);
|
||||
|
||||
/* store */
|
||||
|
||||
|
@ -552,7 +552,7 @@ void NewsFeed::addFeedItemPeerDisconnect(RsFeedItem &fi)
|
|||
void NewsFeed::addFeedItemPeerHello(RsFeedItem &fi)
|
||||
{
|
||||
/* make new widget */
|
||||
PeerItem *pi = new PeerItem(this, NEWSFEED_PEERLIST, fi.mId1, PEER_TYPE_HELLO, false);
|
||||
PeerItem *pi = new PeerItem(this, NEWSFEED_PEERLIST, RsPeerId(fi.mId1), PEER_TYPE_HELLO, false);
|
||||
|
||||
/* store */
|
||||
|
||||
|
@ -568,7 +568,7 @@ void NewsFeed::addFeedItemPeerHello(RsFeedItem &fi)
|
|||
void NewsFeed::addFeedItemPeerNew(RsFeedItem &fi)
|
||||
{
|
||||
/* make new widget */
|
||||
PeerItem *pi = new PeerItem(this, NEWSFEED_PEERLIST, fi.mId1, PEER_TYPE_NEW_FOF, false);
|
||||
PeerItem *pi = new PeerItem(this, NEWSFEED_PEERLIST, RsPeerId(fi.mId1), PEER_TYPE_NEW_FOF, false);
|
||||
|
||||
/* store */
|
||||
|
||||
|
@ -584,12 +584,12 @@ void NewsFeed::addFeedItemPeerNew(RsFeedItem &fi)
|
|||
void NewsFeed::addFeedItemSecurityConnectAttempt(RsFeedItem &fi)
|
||||
{
|
||||
/* make new widget */
|
||||
SecurityItem *pi = new SecurityItem(this, NEWSFEED_SECLIST, fi.mId1, fi.mId2, fi.mId3, fi.mId4, fi.mType, false);
|
||||
SecurityItem *pi = new SecurityItem(this, NEWSFEED_SECLIST, RsPgpId(fi.mId1), RsPeerId(fi.mId2), fi.mId3, fi.mId4, fi.mType, false);
|
||||
|
||||
/* store */
|
||||
|
||||
/* add to layout */
|
||||
addFeedItemIfUnique(pi, fi.mType, fi.mId2, false);
|
||||
addFeedItemIfUnique(pi, fi.mType, RsPeerId(fi.mId2), false);
|
||||
|
||||
#ifdef NEWS_DEBUG
|
||||
std::cerr << "NewsFeed::addFeedItemSecurityConnectAttempt()";
|
||||
|
@ -600,12 +600,12 @@ void NewsFeed::addFeedItemSecurityConnectAttempt(RsFeedItem &fi)
|
|||
void NewsFeed::addFeedItemSecurityAuthDenied(RsFeedItem &fi)
|
||||
{
|
||||
/* make new widget */
|
||||
SecurityItem *pi = new SecurityItem(this, NEWSFEED_SECLIST, fi.mId1, fi.mId2, fi.mId3, fi.mId4, fi.mType, false);
|
||||
SecurityItem *pi = new SecurityItem(this, NEWSFEED_SECLIST, RsPgpId(fi.mId1), RsPeerId(fi.mId2), fi.mId3, fi.mId4, fi.mType, false);
|
||||
|
||||
/* store */
|
||||
|
||||
/* add to layout */
|
||||
addFeedItemIfUnique(pi, RS_FEED_ITEM_SEC_AUTH_DENIED, fi.mId2, false);
|
||||
addFeedItemIfUnique(pi, RS_FEED_ITEM_SEC_AUTH_DENIED, RsPeerId(fi.mId2), false);
|
||||
|
||||
#ifdef NEWS_DEBUG
|
||||
std::cerr << "NewsFeed::addFeedItemSecurityAuthDenied()";
|
||||
|
@ -616,12 +616,12 @@ void NewsFeed::addFeedItemSecurityAuthDenied(RsFeedItem &fi)
|
|||
void NewsFeed::addFeedItemSecurityUnknownIn(RsFeedItem &fi)
|
||||
{
|
||||
/* make new widget */
|
||||
SecurityItem *pi = new SecurityItem(this, NEWSFEED_SECLIST, fi.mId1, fi.mId2, fi.mId3, fi.mId4, RS_FEED_ITEM_SEC_UNKNOWN_IN, false);
|
||||
SecurityItem *pi = new SecurityItem(this, NEWSFEED_SECLIST, RsPgpId(fi.mId1), RsPeerId(fi.mId2), fi.mId3, fi.mId4, RS_FEED_ITEM_SEC_UNKNOWN_IN, false);
|
||||
|
||||
/* store */
|
||||
|
||||
/* add to layout */
|
||||
addFeedItemIfUnique(pi, RS_FEED_ITEM_SEC_UNKNOWN_IN, fi.mId2, false);
|
||||
addFeedItemIfUnique(pi, RS_FEED_ITEM_SEC_UNKNOWN_IN, RsPeerId(fi.mId2), false);
|
||||
|
||||
#ifdef NEWS_DEBUG
|
||||
std::cerr << "NewsFeed::addFeedItemSecurityUnknownIn()";
|
||||
|
@ -632,12 +632,12 @@ void NewsFeed::addFeedItemSecurityUnknownIn(RsFeedItem &fi)
|
|||
void NewsFeed::addFeedItemSecurityUnknownOut(RsFeedItem &fi)
|
||||
{
|
||||
/* make new widget */
|
||||
SecurityItem *pi = new SecurityItem(this, NEWSFEED_SECLIST, fi.mId1, fi.mId2, fi.mId3, fi.mId4, RS_FEED_ITEM_SEC_UNKNOWN_OUT, false);
|
||||
SecurityItem *pi = new SecurityItem(this, NEWSFEED_SECLIST, RsPgpId(fi.mId1), RsPeerId(fi.mId2), fi.mId3, fi.mId4, RS_FEED_ITEM_SEC_UNKNOWN_OUT, false);
|
||||
|
||||
/* store */
|
||||
|
||||
/* add to layout */
|
||||
addFeedItemIfUnique(pi, RS_FEED_ITEM_SEC_UNKNOWN_OUT, fi.mId2, false);
|
||||
addFeedItemIfUnique(pi, RS_FEED_ITEM_SEC_UNKNOWN_OUT, RsPeerId(fi.mId2), false);
|
||||
|
||||
#ifdef NEWS_DEBUG
|
||||
std::cerr << "NewsFeed::addFeedItemSecurityUnknownOut()";
|
||||
|
@ -800,7 +800,7 @@ void NewsFeed::addFeedItemChatNew(RsFeedItem &fi, bool addWithoutCheck)
|
|||
}
|
||||
|
||||
/* make new widget */
|
||||
ChatMsgItem *cm = new ChatMsgItem(this, NEWSFEED_CHATMSGLIST, fi.mId1, fi.mId2);
|
||||
ChatMsgItem *cm = new ChatMsgItem(this, NEWSFEED_CHATMSGLIST, RsPeerId(fi.mId1), fi.mId2);
|
||||
|
||||
/* store in forum list */
|
||||
|
||||
|
@ -850,14 +850,14 @@ void NewsFeed::deleteFeedItem(QWidget *item, uint32_t /*type*/)
|
|||
}
|
||||
}
|
||||
|
||||
void NewsFeed::openChat(std::string peerId)
|
||||
void NewsFeed::openChat(const RsPeerId &peerId)
|
||||
{
|
||||
#ifdef NEWS_DEBUG
|
||||
std::cerr << "NewsFeed::openChat()";
|
||||
std::cerr << std::endl;
|
||||
#endif
|
||||
|
||||
ChatDialog::chatFriend(RsPeerId(peerId));
|
||||
ChatDialog::chatFriend(peerId);
|
||||
}
|
||||
|
||||
void NewsFeed::openComments(uint32_t /*type*/, const RsGxsGroupId &/*groupId*/, const RsGxsMessageId &/*msgId*/, const QString &/*title*/)
|
||||
|
|
|
@ -49,7 +49,7 @@ public:
|
|||
/* FeedHolder Functions (for FeedItem functionality) */
|
||||
virtual QScrollArea *getScrollArea();
|
||||
virtual void deleteFeedItem(QWidget *item, uint32_t type);
|
||||
virtual void openChat(std::string peerId);
|
||||
virtual void openChat(const RsPeerId& peerId);
|
||||
virtual void openComments(uint32_t type, const RsGxsGroupId &groupId, const RsGxsMessageId &msgId, const QString &title);
|
||||
|
||||
static void testFeeds(uint notifyFlags);
|
||||
|
@ -68,7 +68,7 @@ private slots:
|
|||
|
||||
private:
|
||||
void addFeedItem(QWidget *item);
|
||||
void addFeedItemIfUnique(QWidget *item, int itemType, const std::string &sslId, bool replace);
|
||||
void addFeedItemIfUnique(QWidget *item, int itemType, const RsPeerId &sslId, bool replace);
|
||||
|
||||
void addFeedItemPeerConnect(RsFeedItem &fi);
|
||||
void addFeedItemPeerDisconnect(RsFeedItem &fi);
|
||||
|
|
|
@ -287,7 +287,7 @@ void PostedListDialog::deleteFeedItem(QWidget */*item*/, uint32_t /*type*/)
|
|||
return;
|
||||
}
|
||||
|
||||
void PostedListDialog::openChat(std::string /*peerId*/)
|
||||
void PostedListDialog::openChat(const RsPeerId & /*peerId*/)
|
||||
{
|
||||
std::cerr << "PostedListDialog::openChat() Nah";
|
||||
std::cerr << std::endl;
|
||||
|
|
|
@ -58,7 +58,7 @@ public:
|
|||
// Overloaded from FeedHolder.
|
||||
virtual QScrollArea *getScrollArea();
|
||||
virtual void deleteFeedItem(QWidget *item, uint32_t type);
|
||||
virtual void openChat(std::string peerId);
|
||||
virtual void openChat(const RsPeerId& peerId);
|
||||
virtual void openComments(uint32_t type, const RsGxsGroupId &groupId, const RsGxsMessageId &msgId, const QString &title);
|
||||
|
||||
private slots:
|
||||
|
|
|
@ -9,52 +9,42 @@ std::list<RsPgpId> FriendSelectionDialog::selectFriends_PGP(QWidget *parent,cons
|
|||
FriendSelectionWidget::ShowTypes show_type,
|
||||
const std::list<RsPgpId>& pre_selected_ids)
|
||||
{
|
||||
FriendSelectionDialog dialog(parent,header_text,modus,show_type,FriendSelectionWidget::IDTYPE_GPG,pre_selected_ids) ;
|
||||
std::list<std::string> psids ;
|
||||
for(std::list<RsPgpId>::const_iterator it(pre_selected_ids.begin());it!=pre_selected_ids.end();++it)
|
||||
psids.push_back( (*it).toStdString() ) ;
|
||||
|
||||
dialog.setWindowTitle(caption) ;
|
||||
FriendSelectionDialog dialog(parent,header_text,modus,show_type,FriendSelectionWidget::IDTYPE_GPG,psids) ;
|
||||
|
||||
if(QDialog::Rejected == dialog.exec())
|
||||
return std::list<std::string>() ;
|
||||
dialog.setWindowTitle(caption) ;
|
||||
|
||||
std::list<std::string> sids ;
|
||||
dialog.friends_widget->selectedIds(pre_selected_ids,false) ;
|
||||
if(QDialog::Rejected == dialog.exec())
|
||||
return std::list<RsPgpId>() ;
|
||||
|
||||
std::list<RsPgpId> ids ;
|
||||
for(std::list<std::string>::const_iterator it(sids.begin());it!=sids.end();++it)
|
||||
{
|
||||
RsPgpId id(*it) ;
|
||||
if(!id.isNull())
|
||||
ids.push_back(id) ;
|
||||
else
|
||||
std::cerr << "ERROR in " << __PRETTY_FUNCTION__ << ": string " << *it << " is not a PGP id" << std::endl;
|
||||
}
|
||||
return ids ;
|
||||
std::list<RsPgpId> sids ;
|
||||
dialog.friends_widget->selectedIds<RsPgpId,FriendSelectionWidget::IDTYPE_GPG>(sids,false) ;
|
||||
|
||||
return sids ;
|
||||
}
|
||||
std::list<RsPeerId> FriendSelectionDialog::selectFriends_SSL(QWidget *parent,const QString& caption,const QString& header_text,
|
||||
FriendSelectionWidget::Modus modus,
|
||||
FriendSelectionWidget::ShowTypes show_type,
|
||||
const std::list<RsPeerId>& pre_selected_ids)
|
||||
{
|
||||
FriendSelectionDialog dialog(parent,header_text,modus,show_type,FriendSelectionWidget::IDTYPE_SSL,pre_selected_ids) ;
|
||||
std::list<std::string> psids ;
|
||||
for(std::list<RsPeerId>::const_iterator it(pre_selected_ids.begin());it!=pre_selected_ids.end();++it)
|
||||
psids.push_back( (*it).toStdString() ) ;
|
||||
|
||||
FriendSelectionDialog dialog(parent,header_text,modus,show_type,FriendSelectionWidget::IDTYPE_SSL,psids) ;
|
||||
|
||||
dialog.setWindowTitle(caption) ;
|
||||
|
||||
if(QDialog::Rejected == dialog.exec())
|
||||
return std::list<std::string>() ;
|
||||
return std::list<RsPeerId>() ;
|
||||
|
||||
std::list<std::string> sids ;
|
||||
dialog.friends_widget->selectedIds(pre_selected_ids,false) ;
|
||||
std::list<RsPeerId> sids ;
|
||||
dialog.friends_widget->selectedIds<RsPeerId,FriendSelectionWidget::IDTYPE_SSL>(sids,false) ;
|
||||
|
||||
std::list<RsPeerId> ids ;
|
||||
for(std::list<std::string>::const_iterator it(sids.begin());it!=sids.end();++it)
|
||||
{
|
||||
RsPeerId id(*it) ;
|
||||
if(!id.isNull())
|
||||
ids.push_back(id) ;
|
||||
else
|
||||
std::cerr << "ERROR in " << __PRETTY_FUNCTION__ << ": string " << *it << " is not a SSL id" << std::endl;
|
||||
}
|
||||
return ids ;
|
||||
return sids ;
|
||||
}
|
||||
FriendSelectionDialog::FriendSelectionDialog(QWidget *parent,const QString& header_text,
|
||||
FriendSelectionWidget::Modus modus,
|
||||
|
|
|
@ -333,16 +333,16 @@ void FriendSelectionWidget::secured_fillList()
|
|||
}
|
||||
} else {
|
||||
// we fill the not assigned gpg ids
|
||||
if (std::find(filledIds.begin(), filledIds.end(), *gpgIt) != filledIds.end()) {
|
||||
if (std::find(filledIds.begin(), filledIds.end(), (*gpgIt).toStdString()) != filledIds.end()) {
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
// add equal too, its no problem
|
||||
filledIds.push_back(*gpgIt);
|
||||
filledIds.push_back((*gpgIt).toStdString());
|
||||
|
||||
RsPeerDetails detail;
|
||||
if (!rsPeers->getPeerDetails(*gpgIt, detail)) {
|
||||
if (!rsPeers->getGPGDetails(*gpgIt, detail)) {
|
||||
continue; /* BAD */
|
||||
}
|
||||
|
||||
|
@ -350,7 +350,7 @@ void FriendSelectionWidget::secured_fillList()
|
|||
gpgItem = new RSTreeWidgetItem(mCompareRole, IDTYPE_GPG);
|
||||
|
||||
QString name = QString::fromUtf8(detail.name.c_str());
|
||||
gpgItem->setText(COLUMN_NAME, name + " ("+QString::fromStdString(*gpgIt)+")");
|
||||
gpgItem->setText(COLUMN_NAME, name + " ("+QString::fromStdString( (*gpgIt).toStdString() )+")");
|
||||
|
||||
sslIds.clear();
|
||||
rsPeers->getAssociatedSSLIds(*gpgIt, sslIds);
|
||||
|
@ -371,7 +371,7 @@ void FriendSelectionWidget::secured_fillList()
|
|||
|
||||
gpgItem->setFlags(Qt::ItemIsUserCheckable | gpgItem->flags());
|
||||
gpgItem->setIcon(COLUMN_NAME, QIcon(StatusDefs::imageUser(state)));
|
||||
gpgItem->setData(COLUMN_DATA, ROLE_ID, QString::fromStdString(detail.gpg_id));
|
||||
gpgItem->setData(COLUMN_DATA, ROLE_ID, QString::fromStdString(detail.gpg_id.toStdString()));
|
||||
gpgItem->setData(COLUMN_DATA, ROLE_SORT, "2 " + name);
|
||||
|
||||
if (mListModus == MODUS_CHECK) {
|
||||
|
@ -387,7 +387,7 @@ void FriendSelectionWidget::secured_fillList()
|
|||
|
||||
gpgItem->setExpanded(true);
|
||||
|
||||
emit itemAdded(IDTYPE_GPG, QString::fromStdString(detail.gpg_id), gpgItem);
|
||||
emit itemAdded(IDTYPE_GPG, QString::fromStdString(detail.gpg_id.toStdString()), gpgItem);
|
||||
|
||||
if (mShowTypes & SHOW_SSL) {
|
||||
// iterate through associated ssl ids
|
||||
|
@ -410,7 +410,7 @@ void FriendSelectionWidget::secured_fillList()
|
|||
// add to the list
|
||||
gpgItem->addChild(item);
|
||||
|
||||
emit itemAdded(IDTYPE_SSL, QString::fromStdString(detail.id), item);
|
||||
emit itemAdded(IDTYPE_SSL, QString::fromStdString(detail.id.toStdString()), item);
|
||||
|
||||
if (std::find(sslIdsSelected.begin(), sslIdsSelected.end(), detail.id) != sslIdsSelected.end()) {
|
||||
setSelected(mListModus, item, true);
|
||||
|
@ -437,13 +437,13 @@ void FriendSelectionWidget::secured_fillList()
|
|||
}
|
||||
} else {
|
||||
// we fill the not assigned ssl ids
|
||||
if (std::find(filledIds.begin(), filledIds.end(), *sslIt) != filledIds.end()) {
|
||||
if (std::find(filledIds.begin(), filledIds.end(), (*sslIt).toStdString()) != filledIds.end()) {
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
// add equal too, its no problem
|
||||
filledIds.push_back(detail.id);
|
||||
filledIds.push_back(detail.id.toStdString());
|
||||
|
||||
// make a widget per friend
|
||||
QTreeWidgetItem *item = new RSTreeWidgetItem(mCompareRole, IDTYPE_SSL);
|
||||
|
@ -462,7 +462,7 @@ void FriendSelectionWidget::secured_fillList()
|
|||
ui->friendList->addTopLevelItem(item);
|
||||
}
|
||||
|
||||
emit itemAdded(IDTYPE_SSL, QString::fromStdString(detail.id), item);
|
||||
emit itemAdded(IDTYPE_SSL, QString::fromStdString(detail.id.toStdString()), item);
|
||||
|
||||
if (std::find(sslIdsSelected.begin(), sslIdsSelected.end(), detail.id) != sslIdsSelected.end()) {
|
||||
setSelected(mListModus, item, true);
|
||||
|
@ -503,18 +503,20 @@ void FriendSelectionWidget::peerStatusChanged(const QString& peerId, int status)
|
|||
if(RsAutoUpdatePage::eventsLocked())
|
||||
return ;
|
||||
|
||||
RsPeerId peerid(peerId.toStdString()) ;
|
||||
QString gpgId;
|
||||
int gpgStatus = RS_STATUS_OFFLINE;
|
||||
|
||||
if (mShowTypes & (SHOW_GPG | SHOW_NON_FRIEND_GPG)) {
|
||||
/* need gpg id and online state */
|
||||
RsPeerDetails detail;
|
||||
if (rsPeers->getPeerDetails(peerId.toStdString(), detail)) {
|
||||
gpgId = QString::fromStdString(detail.gpg_id);
|
||||
if (rsPeers->getPeerDetails(peerid, detail))
|
||||
{
|
||||
gpgId = QString::fromStdString(detail.gpg_id.toStdString());
|
||||
|
||||
if (status == (int) RS_STATUS_OFFLINE) {
|
||||
/* try other locations */
|
||||
std::list<std::string> sslIds;
|
||||
std::list<RsPeerId> sslIds;
|
||||
rsPeers->getAssociatedSSLIds(detail.gpg_id, sslIds);
|
||||
|
||||
std::list<StatusInfo> statusInfo;
|
||||
|
|
|
@ -182,7 +182,7 @@ void ConnectProgressDialog::initDialog()
|
|||
std::string name = rsPeers->getPeerName(mId);
|
||||
QString connectName = QString::fromUtf8(name.c_str());
|
||||
connectName += " (";
|
||||
connectName += QString::fromStdString(mId).left(10);
|
||||
connectName += QString::fromStdString(mId.toStdString()).left(10);
|
||||
connectName += "...)";
|
||||
ui->connectId->setText(connectName);
|
||||
}
|
||||
|
|
|
@ -29,6 +29,7 @@
|
|||
#include "ui_ConnectProgressDialog.h"
|
||||
|
||||
#include <stdint.h>
|
||||
#include <retroshare/rstypes.h>
|
||||
|
||||
class ConnectProgressDialog : public QDialog
|
||||
{
|
||||
|
|
|
@ -41,7 +41,7 @@
|
|||
****/
|
||||
|
||||
/** Constructor */
|
||||
ChatMsgItem::ChatMsgItem(FeedHolder *parent, uint32_t feedId, const std::string &peerId, const std::string &message)
|
||||
ChatMsgItem::ChatMsgItem(FeedHolder *parent, uint32_t feedId, const RsPeerId &peerId, const std::string &message)
|
||||
:QWidget(NULL), mParent(parent), mFeedId(feedId), mPeerId(peerId)
|
||||
{
|
||||
/* Invoke the Qt Designer generated object setup routine */
|
||||
|
@ -64,7 +64,7 @@ ChatMsgItem::ChatMsgItem(FeedHolder *parent, uint32_t feedId, const std::string
|
|||
|
||||
connect(NotifyQt::getInstance(), SIGNAL(peerHasNewAvatar(const QString&)), this, SLOT(updateAvatar(const QString&)));
|
||||
|
||||
avatar->setId(mPeerId, false);
|
||||
avatar->setId(mPeerId);
|
||||
|
||||
updateItemStatic();
|
||||
updateItem();
|
||||
|
|
|
@ -33,7 +33,7 @@ class ChatMsgItem : public QWidget, private Ui::ChatMsgItem
|
|||
|
||||
public:
|
||||
/** Default Constructor */
|
||||
ChatMsgItem(FeedHolder *parent, uint32_t feedId, const std::string &peerId, const std::string &message);
|
||||
ChatMsgItem(FeedHolder *parent, uint32_t feedId, const RsPeerId &peerId, const std::string &message);
|
||||
|
||||
void updateItemStatic();
|
||||
|
||||
|
@ -58,7 +58,7 @@ private:
|
|||
FeedHolder *mParent;
|
||||
uint32_t mFeedId;
|
||||
|
||||
std::string mPeerId;
|
||||
RsPeerId mPeerId;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
|
|
@ -36,7 +36,7 @@ public:
|
|||
|
||||
virtual QScrollArea *getScrollArea() = 0;
|
||||
virtual void deleteFeedItem(QWidget *item, uint32_t type) = 0;
|
||||
virtual void openChat(std::string peerId) = 0;
|
||||
virtual void openChat(const RsPeerId& peerId) = 0;
|
||||
virtual void openComments(uint32_t type, const RsGxsGroupId &groupId, const RsGxsMessageId &msgId, const QString &title) = 0;
|
||||
|
||||
// Workaround for QTBUG-3372
|
||||
|
|
|
@ -83,7 +83,7 @@ void MsgItem::updateItemStatic()
|
|||
/* get peer Id */
|
||||
mPeerId = mi.srcId;
|
||||
|
||||
avatar->setId(mPeerId, false);
|
||||
avatar->setId(mPeerId);
|
||||
|
||||
QString title;
|
||||
QString srcName;
|
||||
|
|
|
@ -54,7 +54,7 @@ private:
|
|||
FeedHolder *mParent;
|
||||
uint32_t mFeedId;
|
||||
|
||||
std::string mPeerId;
|
||||
RsPeerId mPeerId;
|
||||
std::string mMsgId;
|
||||
|
||||
bool mIsHome;
|
||||
|
|
|
@ -40,7 +40,7 @@
|
|||
****/
|
||||
|
||||
/** Constructor */
|
||||
PeerItem::PeerItem(FeedHolder *parent, uint32_t feedId, const std::string &peerId, uint32_t type, bool isHome)
|
||||
PeerItem::PeerItem(FeedHolder *parent, uint32_t feedId, const RsPeerId &peerId, uint32_t type, bool isHome)
|
||||
:QWidget(NULL), mParent(parent), mFeedId(feedId),
|
||||
mPeerId(peerId), mType(type), mIsHome(isHome)
|
||||
{
|
||||
|
@ -70,7 +70,7 @@ PeerItem::PeerItem(FeedHolder *parent, uint32_t feedId, const std::string &peerI
|
|||
|
||||
quickmsgButton->setMenu(msgmenu);
|
||||
|
||||
avatar->setId(mPeerId, false);
|
||||
avatar->setId(RsPeerId(mPeerId));
|
||||
|
||||
expandFrame->hide();
|
||||
|
||||
|
@ -114,7 +114,7 @@ void PeerItem::updateItemStatic()
|
|||
titleLabel->setText(title);
|
||||
|
||||
RsPeerDetails details;
|
||||
if (rsPeers->getPeerDetails(mPeerId, details))
|
||||
if (rsPeers->getPeerDetails(RsPeerId(mPeerId), details))
|
||||
{
|
||||
/* set peer name */
|
||||
peerNameLabel->setText(QString::fromUtf8(details.name.c_str()));
|
||||
|
@ -122,7 +122,7 @@ void PeerItem::updateItemStatic()
|
|||
|
||||
/* expanded Info */
|
||||
nameLabel->setText(QString::fromUtf8(details.name.c_str()));
|
||||
idLabel->setText(QString::fromStdString(details.id));
|
||||
idLabel->setText(QString::fromStdString(details.id.toStdString()));
|
||||
locLabel->setText(QString::fromUtf8(details.location.c_str()));
|
||||
}
|
||||
else
|
||||
|
|
|
@ -38,7 +38,7 @@ class PeerItem : public QWidget, private Ui::PeerItem
|
|||
|
||||
public:
|
||||
/** Default Constructor */
|
||||
PeerItem(FeedHolder *parent, uint32_t feedId, const std::string &peerId, uint32_t type, bool isHome);
|
||||
PeerItem(FeedHolder *parent, uint32_t feedId, const RsPeerId &peerId, uint32_t type, bool isHome);
|
||||
|
||||
void updateItemStatic();
|
||||
|
||||
|
@ -63,7 +63,7 @@ private:
|
|||
FeedHolder *mParent;
|
||||
uint32_t mFeedId;
|
||||
|
||||
std::string mPeerId;
|
||||
RsPeerId mPeerId;
|
||||
uint32_t mType;
|
||||
bool mIsHome;
|
||||
};
|
||||
|
|
|
@ -43,7 +43,7 @@
|
|||
****/
|
||||
|
||||
/** Constructor */
|
||||
SecurityItem::SecurityItem(FeedHolder *parent, uint32_t feedId, const std::string &gpgId, const std::string &sslId, const std::string &sslCn, const std::string& ip_address,uint32_t type, bool isHome)
|
||||
SecurityItem::SecurityItem(FeedHolder *parent, uint32_t feedId, const RsPgpId &gpgId, const RsPeerId &sslId, const std::string &sslCn, const std::string& ip_address,uint32_t type, bool isHome)
|
||||
:QWidget(NULL), mParent(parent), mFeedId(feedId),
|
||||
mGpgId(gpgId), mSslId(sslId), mSslCn(sslCn), mIP(ip_address), mType(type), mIsHome(isHome)
|
||||
{
|
||||
|
@ -74,7 +74,7 @@ SecurityItem::SecurityItem(FeedHolder *parent, uint32_t feedId, const std::strin
|
|||
connect(NotifyQt::getInstance(), SIGNAL(friendsChanged()), this, SLOT(updateItem()));
|
||||
|
||||
|
||||
avatar->setId(mSslId, false);
|
||||
avatar->setId(mSslId);
|
||||
|
||||
expandFrame->hide();
|
||||
|
||||
|
@ -83,7 +83,7 @@ SecurityItem::SecurityItem(FeedHolder *parent, uint32_t feedId, const std::strin
|
|||
}
|
||||
|
||||
|
||||
bool SecurityItem::isSame(const std::string &sslId, uint32_t type)
|
||||
bool SecurityItem::isSame(const RsPeerId &sslId, uint32_t type)
|
||||
{
|
||||
if ((mSslId == sslId) && (mType == type))
|
||||
{
|
||||
|
@ -131,15 +131,15 @@ void SecurityItem::updateItemStatic()
|
|||
requestLabel->hide();
|
||||
break;
|
||||
case RS_FEED_ITEM_SEC_MISSING_CERTIFICATE:
|
||||
title = tr("Peer/location not in friendlist (PGP id=")+QString::fromStdString(mGpgId)+")";
|
||||
title = tr("Peer/location not in friendlist (PGP id=")+QString::fromStdString(mGpgId.toStdString())+")";
|
||||
avatar->setDefaultAvatar(":images/avatar_request_unknown.png");
|
||||
requestLabel->show();
|
||||
break;
|
||||
case RS_FEED_ITEM_SEC_BAD_CERTIFICATE:
|
||||
{
|
||||
RsPeerDetails details ;
|
||||
if(rsPeers->getPeerDetails(mGpgId, details))
|
||||
title = tr("Missing/Damaged SSL certificate for key ") + QString::fromStdString(mGpgId) ;
|
||||
if(rsPeers->getGPGDetails(mGpgId, details))
|
||||
title = tr("Missing/Damaged SSL certificate for key ") + QString::fromStdString(mGpgId.toStdString()) ;
|
||||
else
|
||||
title = tr("Missing/Damaged certificate. Not a real Retroshare user.");
|
||||
requestLabel->hide();
|
||||
|
@ -187,7 +187,7 @@ void SecurityItem::updateItem()
|
|||
if (!rsPeers->getPeerDetails(mSslId, details))
|
||||
{
|
||||
/* then gpgid */
|
||||
if(!rsPeers->getPeerDetails(mGpgId, details))
|
||||
if(!rsPeers->getGPGDetails(mGpgId, details))
|
||||
{
|
||||
/* it is very likely that we will end up here for some of the
|
||||
* Unknown peer cases.... so allow them here
|
||||
|
@ -196,8 +196,8 @@ void SecurityItem::updateItem()
|
|||
/* set peer name */
|
||||
peerNameLabel->setText(QString("%1 (%2)").arg(tr("Unknown Peer"), QString::fromUtf8(mSslCn.c_str())));
|
||||
|
||||
nameLabel->setText(QString::fromUtf8(mSslCn.c_str()) + " (" + QString::fromStdString(mGpgId) + ")");
|
||||
idLabel->setText(QString::fromStdString(mSslId));
|
||||
nameLabel->setText(QString::fromUtf8(mSslCn.c_str()) + " (" + QString::fromStdString(mGpgId.toStdString()) + ")");
|
||||
idLabel->setText(QString::fromStdString(mSslId.toStdString()));
|
||||
|
||||
statusLabel->setText(tr("Unknown Peer"));
|
||||
trustLabel->setText(tr("Unknown Peer"));
|
||||
|
@ -221,9 +221,9 @@ void SecurityItem::updateItem()
|
|||
peerNameLabel->setText(QString::fromUtf8(details.name.c_str()));
|
||||
|
||||
/* expanded Info */
|
||||
nameLabel->setText(QString::fromUtf8(details.name.c_str()) + " (" + QString::fromStdString(mGpgId) + ")");
|
||||
nameLabel->setText(QString::fromUtf8(details.name.c_str()) + " (" + QString::fromStdString(mGpgId.toStdString()) + ")");
|
||||
//idLabel->setText(QString::fromStdString(details.id));
|
||||
idLabel->setText(QString::fromStdString(mSslId));
|
||||
idLabel->setText(QString::fromStdString(mSslId.toStdString()));
|
||||
locLabel->setText(QString::fromUtf8(details.location.c_str()));
|
||||
|
||||
/* top Level info */
|
||||
|
@ -362,7 +362,7 @@ void SecurityItem::peerDetails()
|
|||
}
|
||||
|
||||
/* then gpgid */
|
||||
if (rsPeers->getPeerDetails(mGpgId, details))
|
||||
if (rsPeers->getGPGDetails(mGpgId, details))
|
||||
{
|
||||
ConfCertDialog::showIt(mGpgId, ConfCertDialog::PageDetails);
|
||||
}
|
||||
|
@ -380,11 +380,11 @@ void SecurityItem::sendMsg()
|
|||
return;
|
||||
}
|
||||
|
||||
std::string hash ;
|
||||
RsPeerId peerId ;
|
||||
|
||||
if(rsMsgs->getDistantMessageHash(mGpgId,hash))
|
||||
if(rsMsgs->getDistantMessagePeerId(mGpgId,peerId))
|
||||
{
|
||||
nMsgDialog->addRecipient(MessageComposer::TO, hash, mGpgId);
|
||||
nMsgDialog->addRecipient(MessageComposer::TO, peerId, mGpgId);
|
||||
nMsgDialog->show();
|
||||
nMsgDialog->activateWindow();
|
||||
}
|
||||
|
@ -400,6 +400,6 @@ void SecurityItem::openChat()
|
|||
#endif
|
||||
if (mParent)
|
||||
{
|
||||
mParent->openChat(mGpgId);
|
||||
mParent->openChat(mSslId);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -38,11 +38,11 @@ class SecurityItem : public QWidget, private Ui::SecurityItem
|
|||
|
||||
public:
|
||||
/** Default Constructor */
|
||||
SecurityItem(FeedHolder *parent, uint32_t feedId, const std::string &gpgId, const std::string &sslId, const std::string &sslCn, const std::string& ip_addr,uint32_t type, bool isHome);
|
||||
SecurityItem(FeedHolder *parent, uint32_t feedId, const RsPgpId &gpgId, const RsPeerId &sslId, const std::string &sslCn, const std::string& ip_addr,uint32_t type, bool isHome);
|
||||
|
||||
void updateItemStatic();
|
||||
|
||||
bool isSame(const std::string &sslId, uint32_t type);
|
||||
bool isSame(const RsPeerId &sslId, uint32_t type);
|
||||
|
||||
private slots:
|
||||
/* default stuff */
|
||||
|
@ -63,8 +63,8 @@ private:
|
|||
FeedHolder *mParent;
|
||||
uint32_t mFeedId;
|
||||
|
||||
std::string mGpgId;
|
||||
std::string mSslId;
|
||||
RsPgpId mGpgId;
|
||||
RsPeerId mSslId;
|
||||
std::string mSslCn;
|
||||
std::string mIP;
|
||||
uint32_t mType;
|
||||
|
|
|
@ -69,7 +69,7 @@ CreateGroup::CreateGroup(const std::string &groupId, QWidget *parent)
|
|||
|
||||
ui.groupName->setDisabled(mIsStandard);
|
||||
|
||||
ui.friendList->setSelectedGpgIds(groupInfo.peerIds, false);
|
||||
ui.friendList->setSelectedIds<RsPgpId,FriendSelectionWidget::IDTYPE_GPG>(groupInfo.peerIds, false);
|
||||
} else {
|
||||
/* Group not found, create new */
|
||||
mGroupId.clear();
|
||||
|
@ -131,12 +131,12 @@ void CreateGroup::changeGroup()
|
|||
}
|
||||
}
|
||||
|
||||
std::list<std::string> gpgIds;
|
||||
ui.friendList->selectedGpgIds(gpgIds, true);
|
||||
std::list<RsPgpId> gpgIds;
|
||||
ui.friendList->selectedIds<RsPgpId,FriendSelectionWidget::IDTYPE_GPG>(gpgIds, true);
|
||||
|
||||
std::list<std::string>::iterator it;
|
||||
std::list<RsPgpId>::iterator it;
|
||||
for (it = groupInfo.peerIds.begin(); it != groupInfo.peerIds.end(); ++it) {
|
||||
std::list<std::string>::iterator gpgIt = std::find(gpgIds.begin(), gpgIds.end(), *it);
|
||||
std::list<RsPgpId>::iterator gpgIt = std::find(gpgIds.begin(), gpgIds.end(), *it);
|
||||
if (gpgIt == gpgIds.end()) {
|
||||
rsPeers->assignPeerToGroup(groupInfo.id, *it, false);
|
||||
continue;
|
||||
|
|
|
@ -366,7 +366,7 @@ void GxsChannelDialog::deleteFeedItem(QWidget * /*item*/, uint32_t /*type*/)
|
|||
{
|
||||
}
|
||||
|
||||
void GxsChannelDialog::openChat(std::string /*peerId*/)
|
||||
void GxsChannelDialog::openChat(const RsPeerId & /*peerId*/)
|
||||
{
|
||||
}
|
||||
|
||||
|
|
|
@ -53,7 +53,7 @@ public:
|
|||
/* FeedHolder */
|
||||
virtual QScrollArea *getScrollArea();
|
||||
virtual void deleteFeedItem(QWidget *item, uint32_t type);
|
||||
virtual void openChat(std::string peerId);
|
||||
virtual void openChat(const RsPeerId& peerId);
|
||||
virtual void openComments(uint32_t type, const RsGxsGroupId &groupId, const RsGxsMessageId &msgId, const QString &title);
|
||||
|
||||
bool navigate(const std::string& channelId, const std::string& msgId);
|
||||
|
|
|
@ -852,7 +852,6 @@ static void calculateGroupsOfSslIds(const std::list<RsGroupInfo> &existingGroupI
|
|||
}
|
||||
}
|
||||
|
||||
#ifdef SUSPENDED
|
||||
MessageComposer *MessageComposer::newMsg(const std::string &msgId /* = ""*/)
|
||||
{
|
||||
MessageComposer *msgComposer = new MessageComposer();
|
||||
|
@ -895,26 +894,26 @@ MessageComposer *MessageComposer::newMsg(const std::string &msgId /* = ""*/)
|
|||
std::list<std::string>::iterator groupIt;
|
||||
std::list<RsPeerId>::iterator it;
|
||||
|
||||
calculateGroupsOfSslIds(groupInfoList, msgInfo.msgto, groupIds);
|
||||
for (groupIt = groupIds.begin(); groupIt != groupIds.end(); groupIt++ ) {
|
||||
msgComposer->addRecipient(MessageComposer::TO, *groupIt, true) ;
|
||||
}
|
||||
// calculateGroupsOfSslIds(groupInfoList, msgInfo.msgto, groupIds);
|
||||
// for (groupIt = groupIds.begin(); groupIt != groupIds.end(); groupIt++ ) {
|
||||
// msgComposer->addRecipient(MessageComposer::TO, *groupIt, true) ;
|
||||
// }
|
||||
for (it = msgInfo.msgto.begin(); it != msgInfo.msgto.end(); it++ ) {
|
||||
msgComposer->addRecipient(MessageComposer::TO, *it, false) ;
|
||||
}
|
||||
|
||||
calculateGroupsOfSslIds(groupInfoList, msgInfo.msgcc, groupIds);
|
||||
for (groupIt = groupIds.begin(); groupIt != groupIds.end(); groupIt++ ) {
|
||||
msgComposer->addRecipient(MessageComposer::CC, *groupIt, true) ;
|
||||
}
|
||||
// calculateGroupsOfSslIds(groupInfoList, msgInfo.msgcc, groupIds);
|
||||
// for (groupIt = groupIds.begin(); groupIt != groupIds.end(); groupIt++ ) {
|
||||
// msgComposer->addRecipient(MessageComposer::CC, *groupIt, true) ;
|
||||
// }
|
||||
for (it = msgInfo.msgcc.begin(); it != msgInfo.msgcc.end(); it++ ) {
|
||||
msgComposer->addRecipient(MessageComposer::CC, *it, false) ;
|
||||
}
|
||||
|
||||
calculateGroupsOfSslIds(groupInfoList, msgInfo.msgbcc, groupIds);
|
||||
for (groupIt = groupIds.begin(); groupIt != groupIds.end(); groupIt++ ) {
|
||||
msgComposer->addRecipient(MessageComposer::BCC, *groupIt, true) ;
|
||||
}
|
||||
// calculateGroupsOfSslIds(groupInfoList, msgInfo.msgbcc, groupIds);
|
||||
// for (groupIt = groupIds.begin(); groupIt != groupIds.end(); groupIt++ ) {
|
||||
// msgComposer->addRecipient(MessageComposer::BCC, *groupIt, true) ;
|
||||
// }
|
||||
for (it = msgInfo.msgbcc.begin(); it != msgInfo.msgbcc.end(); it++ ) {
|
||||
msgComposer->addRecipient(MessageComposer::BCC, *it, false) ;
|
||||
}
|
||||
|
@ -932,7 +931,6 @@ MessageComposer *MessageComposer::newMsg(const std::string &msgId /* = ""*/)
|
|||
|
||||
return msgComposer;
|
||||
}
|
||||
#endif
|
||||
|
||||
QString MessageComposer::buildReplyHeader(const MessageInfo &msgInfo)
|
||||
{
|
||||
|
|
|
@ -78,10 +78,10 @@ void RsharePeerSettings::cleanDeadIds()
|
|||
}
|
||||
|
||||
ChatLobbyId lid;
|
||||
if (rsMsgs->isLobbyId((*group).toStdString(), lid)) {
|
||||
if (rsMsgs->isLobbyId(RsPeerId((*group).toStdString()), lid)) {
|
||||
continue;
|
||||
}
|
||||
if (rsPeers->isGPGAccepted((*group).toStdString()) == false) {
|
||||
if (rsPeers->isGPGAccepted(RsPgpId((*group).toStdString())) == false) {
|
||||
remove(*group);
|
||||
}
|
||||
}
|
||||
|
@ -96,11 +96,11 @@ bool RsharePeerSettings::getSettingsIdOfPeerId(const RsPeerId &peerId, std::stri
|
|||
{
|
||||
ChatLobbyId lid;
|
||||
if (rsMsgs->isLobbyId(peerId, lid)) {
|
||||
settingsId = peerId;
|
||||
settingsId = peerId.toStdString();
|
||||
return true;
|
||||
}
|
||||
|
||||
std::map<std::string, std::string>::iterator it = m_SslToGpg.find(peerId);
|
||||
std::map<RsPeerId, std::string>::iterator it = m_SslToGpg.find(peerId);
|
||||
if (it != m_SslToGpg.end()) {
|
||||
settingsId = it->second;
|
||||
return true;
|
||||
|
@ -112,7 +112,7 @@ bool RsharePeerSettings::getSettingsIdOfPeerId(const RsPeerId &peerId, std::stri
|
|||
}
|
||||
|
||||
settingsId = details.gpg_id.toStdString();
|
||||
m_SslToGpg[peerId] = settingsId;
|
||||
m_SslToGpg[peerId] = settingsId ;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
@ -136,7 +136,7 @@ QVariant RsharePeerSettings::get(const RsPeerId &peerId, const QString &key, con
|
|||
}
|
||||
|
||||
/* set value of peer */
|
||||
void RsharePeerSettings::set(const std::string &peerId, const QString &key, const QVariant &value)
|
||||
void RsharePeerSettings::set(const RsPeerId &peerId, const QString &key, const QVariant &value)
|
||||
{
|
||||
std::string settingsId;
|
||||
if (getSettingsIdOfPeerId(peerId, settingsId) == false) {
|
||||
|
|
|
@ -352,7 +352,7 @@ void ServerPage::saveAddresses()
|
|||
}
|
||||
|
||||
RsPeerDetails detail;
|
||||
std::string ownId = rsPeers->getOwnId();
|
||||
RsPeerId ownId = rsPeers->getOwnId();
|
||||
|
||||
if (!rsPeers->getPeerDetails(ownId, detail))
|
||||
return;
|
||||
|
@ -615,7 +615,7 @@ void ServerPage::updateStatusHiddenNode()
|
|||
void ServerPage::saveAddressesHiddenNode()
|
||||
{
|
||||
RsPeerDetails detail;
|
||||
std::string ownId = rsPeers->getOwnId();
|
||||
RsPeerId ownId = rsPeers->getOwnId();
|
||||
|
||||
if (!rsPeers->getPeerDetails(ownId, detail))
|
||||
return;
|
||||
|
|
|
@ -11,7 +11,7 @@ greaterThan(QT_MAJOR_VERSION, 4) {
|
|||
|
||||
# Below is for GXS services.
|
||||
# Should be disabled for releases.
|
||||
CONFIG += gxs debug
|
||||
#CONFIG += gxs debug
|
||||
|
||||
gxs {
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue