mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-05-02 14:16:16 -04:00
handled validation/sign of message when key not available
(set for 5 attempts before message is dropped) moved rstokenservice.h to retroshare interface folder groups do not sync anymore unless user is subscribed to it git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@6194 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
parent
17f2d2e8a5
commit
23209c8c45
19 changed files with 481 additions and 270 deletions
59
libretroshare/src/gxs/rsgxsutil.h
Normal file
59
libretroshare/src/gxs/rsgxsutil.h
Normal file
|
@ -0,0 +1,59 @@
|
|||
/*
|
||||
* libretroshare/src/gxs: rsgxsutil.h
|
||||
*
|
||||
* RetroShare C++ Interface. Generic routines that are useful in GXS
|
||||
*
|
||||
* Copyright 2013-2013 by Christopher Evi-Parker
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Library General Public
|
||||
* License Version 2 as published by the Free Software Foundation.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Library General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Library General Public
|
||||
* License along with this library; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
|
||||
* USA.
|
||||
*
|
||||
* Please report all bugs and problems to "retroshare@lunamutt.com".
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef GXSUTIL_H_
|
||||
#define GXSUTIL_H_
|
||||
|
||||
#include <vector>
|
||||
|
||||
/*!
|
||||
* Handy function for cleaning out meta result containers
|
||||
* @param container
|
||||
*/
|
||||
template <class Container, class Item>
|
||||
void freeAndClearContainerResource(Container container)
|
||||
{
|
||||
typename Container::iterator meta_it = container.begin();
|
||||
|
||||
for(; meta_it != container.end(); meta_it++)
|
||||
{
|
||||
delete meta_it->second;
|
||||
|
||||
}
|
||||
container.clear();
|
||||
}
|
||||
|
||||
inline RsGxsGrpMsgIdPair getMsgIdPair(RsNxsMsg& msg)
|
||||
{
|
||||
return RsGxsGrpMsgIdPair(std::make_pair(msg.grpId, msg.msgId));
|
||||
}
|
||||
|
||||
inline RsGxsGrpMsgIdPair getMsgIdPair(RsGxsMsgItem& msg)
|
||||
{
|
||||
return RsGxsGrpMsgIdPair(std::make_pair(msg.meta.mGroupId, msg.meta.mMsgId));
|
||||
}
|
||||
|
||||
|
||||
#endif /* GXSUTIL_H_ */
|
Loading…
Add table
Add a link
Reference in a new issue