2012-02-13 13:22:35 -05:00
|
|
|
/*
|
|
|
|
* libretroshare/src/services p3idservice.cc
|
|
|
|
*
|
|
|
|
* Id interface for RetroShare.
|
|
|
|
*
|
|
|
|
* Copyright 2012-2012 by Robert Fernie.
|
|
|
|
*
|
|
|
|
* This library is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU Library General Public
|
2012-06-13 20:27:28 -04:00
|
|
|
* License Version 2.1 as published by the Free Software Foundation.
|
2012-02-13 13:22:35 -05:00
|
|
|
*
|
|
|
|
* 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".
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include "services/p3idservice.h"
|
|
|
|
|
|
|
|
#include "util/rsrandom.h"
|
|
|
|
#include <retroshare/rspeers.h>
|
|
|
|
#include <sstream>
|
|
|
|
|
|
|
|
/****
|
|
|
|
* #define ID_DEBUG 1
|
|
|
|
****/
|
|
|
|
|
2012-06-07 13:10:47 -04:00
|
|
|
#define ID_REQUEST_LIST 0x0001
|
|
|
|
#define ID_REQUEST_IDENTITY 0x0002
|
|
|
|
#define ID_REQUEST_REPUTATION 0x0003
|
|
|
|
#define ID_REQUEST_OPINION 0x0004
|
|
|
|
|
2012-02-13 13:22:35 -05:00
|
|
|
RsIdentity *rsIdentity = NULL;
|
|
|
|
|
|
|
|
|
2012-06-13 20:27:28 -04:00
|
|
|
/********************************************************************************/
|
|
|
|
/******************* Startup / Tick ******************************************/
|
|
|
|
/********************************************************************************/
|
|
|
|
|
2012-02-13 13:22:35 -05:00
|
|
|
p3IdService::p3IdService(uint16_t type)
|
2012-06-13 20:27:28 -04:00
|
|
|
:p3GxsDataService(type, new IdDataProxy()), mIdMtx("p3IdService"), mUpdated(true)
|
2012-02-13 13:22:35 -05:00
|
|
|
{
|
|
|
|
RsStackMutex stack(mIdMtx); /********** STACK LOCKED MTX ******/
|
2012-06-13 20:27:28 -04:00
|
|
|
|
|
|
|
mIdProxy = (IdDataProxy *) mProxy;
|
2012-02-13 13:22:35 -05:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
int p3IdService::tick()
|
|
|
|
{
|
|
|
|
std::cerr << "p3IdService::tick()";
|
|
|
|
std::cerr << std::endl;
|
2012-06-07 13:10:47 -04:00
|
|
|
|
2012-06-13 20:27:28 -04:00
|
|
|
fakeprocessrequests();
|
|
|
|
|
2012-02-13 13:22:35 -05:00
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
bool p3IdService::updated()
|
|
|
|
{
|
|
|
|
RsStackMutex stack(mIdMtx); /********** STACK LOCKED MTX ******/
|
|
|
|
|
|
|
|
if (mUpdated)
|
|
|
|
{
|
|
|
|
mUpdated = false;
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
2012-06-07 13:10:47 -04:00
|
|
|
|
2012-06-13 20:27:28 -04:00
|
|
|
|
|
|
|
/* Data Requests */
|
|
|
|
bool p3IdService::requestGroupInfo( uint32_t &token, uint32_t ansType, const RsTokReqOptions &opts, const std::list<std::string> &groupIds)
|
2012-06-07 13:10:47 -04:00
|
|
|
{
|
|
|
|
generateToken(token);
|
2012-06-13 20:27:28 -04:00
|
|
|
std::cerr << "p3IdService::requestGroupInfo() gets Token: " << token << std::endl;
|
|
|
|
storeRequest(token, ansType, opts, GXS_REQUEST_TYPE_GROUPS, groupIds);
|
2012-06-07 13:10:47 -04:00
|
|
|
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
2012-06-13 20:27:28 -04:00
|
|
|
bool p3IdService::requestMsgInfo( uint32_t &token, uint32_t ansType, const RsTokReqOptions &opts, const std::list<std::string> &groupIds)
|
2012-06-07 13:10:47 -04:00
|
|
|
{
|
|
|
|
generateToken(token);
|
2012-06-13 20:27:28 -04:00
|
|
|
std::cerr << "p3IdService::requestMsgInfo() gets Token: " << token << std::endl;
|
|
|
|
storeRequest(token, ansType, opts, GXS_REQUEST_TYPE_MSGS, groupIds);
|
2012-06-07 13:10:47 -04:00
|
|
|
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
2012-06-13 20:27:28 -04:00
|
|
|
bool p3IdService::requestMsgRelatedInfo(uint32_t &token, uint32_t ansType, const RsTokReqOptions &opts, const std::list<std::string> &msgIds)
|
2012-06-07 13:10:47 -04:00
|
|
|
{
|
|
|
|
generateToken(token);
|
2012-06-13 20:27:28 -04:00
|
|
|
std::cerr << "p3IdService::requestMsgRelatedInfo() gets Token: " << token << std::endl;
|
|
|
|
storeRequest(token, ansType, opts, GXS_REQUEST_TYPE_MSGRELATED, msgIds);
|
2012-06-07 13:10:47 -04:00
|
|
|
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
2012-06-13 20:27:28 -04:00
|
|
|
/* Generic Lists */
|
|
|
|
bool p3IdService::getGroupList( const uint32_t &token, std::list<std::string> &groupIds)
|
2012-06-07 13:10:47 -04:00
|
|
|
{
|
2012-06-13 20:27:28 -04:00
|
|
|
uint32_t status;
|
|
|
|
uint32_t reqtype;
|
|
|
|
uint32_t anstype;
|
|
|
|
time_t ts;
|
|
|
|
checkRequestStatus(token, status, reqtype, anstype, ts);
|
2012-06-07 13:10:47 -04:00
|
|
|
|
2012-06-13 20:27:28 -04:00
|
|
|
if (anstype != RS_TOKREQ_ANSTYPE_LIST)
|
|
|
|
{
|
|
|
|
std::cerr << "p3IdService::getGroupList() ERROR AnsType Wrong" << std::endl;
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (reqtype != GXS_REQUEST_TYPE_GROUPS)
|
|
|
|
{
|
|
|
|
std::cerr << "p3IdService::getGroupList() ERROR ReqType Wrong" << std::endl;
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (status != GXS_REQUEST_STATUS_COMPLETE)
|
|
|
|
{
|
|
|
|
std::cerr << "p3IdService::getGroupList() ERROR Status Incomplete" << std::endl;
|
|
|
|
return false;
|
|
|
|
}
|
2012-06-07 13:10:47 -04:00
|
|
|
|
2012-06-13 20:27:28 -04:00
|
|
|
bool ans = loadRequestOutList(token, groupIds);
|
|
|
|
updateRequestStatus(token, GXS_REQUEST_STATUS_DONE);
|
2012-06-07 13:10:47 -04:00
|
|
|
|
2012-06-13 20:27:28 -04:00
|
|
|
return ans;
|
2012-06-07 13:10:47 -04:00
|
|
|
}
|
|
|
|
|
2012-06-13 20:27:28 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
bool p3IdService::getMsgList( const uint32_t &token, std::list<std::string> &msgIds)
|
2012-06-07 13:10:47 -04:00
|
|
|
{
|
|
|
|
uint32_t status;
|
|
|
|
uint32_t reqtype;
|
2012-06-13 20:27:28 -04:00
|
|
|
uint32_t anstype;
|
2012-06-07 13:10:47 -04:00
|
|
|
time_t ts;
|
2012-06-13 20:27:28 -04:00
|
|
|
checkRequestStatus(token, status, reqtype, anstype, ts);
|
2012-06-07 13:10:47 -04:00
|
|
|
|
2012-06-13 20:27:28 -04:00
|
|
|
if (anstype != RS_TOKREQ_ANSTYPE_LIST)
|
2012-06-07 13:10:47 -04:00
|
|
|
{
|
2012-06-13 20:27:28 -04:00
|
|
|
std::cerr << "p3IdService::getMsgList() ERROR AnsType Wrong" << std::endl;
|
|
|
|
return false;
|
2012-06-07 13:10:47 -04:00
|
|
|
}
|
2012-06-13 20:27:28 -04:00
|
|
|
|
|
|
|
if ((reqtype != GXS_REQUEST_TYPE_MSGS) && (reqtype != GXS_REQUEST_TYPE_MSGRELATED))
|
2012-06-07 13:10:47 -04:00
|
|
|
{
|
2012-06-13 20:27:28 -04:00
|
|
|
std::cerr << "p3IdService::getMsgList() ERROR ReqType Wrong" << std::endl;
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (status != GXS_REQUEST_STATUS_COMPLETE)
|
|
|
|
{
|
|
|
|
std::cerr << "p3IdService::getMsgList() ERROR Status Incomplete" << std::endl;
|
|
|
|
return false;
|
2012-06-07 13:10:47 -04:00
|
|
|
}
|
|
|
|
|
2012-06-13 20:27:28 -04:00
|
|
|
bool ans = loadRequestOutList(token, msgIds);
|
|
|
|
updateRequestStatus(token, GXS_REQUEST_STATUS_DONE);
|
|
|
|
|
|
|
|
return ans;
|
2012-06-07 13:10:47 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2012-06-13 20:27:28 -04:00
|
|
|
/* Generic Summary */
|
|
|
|
bool p3IdService::getGroupSummary( const uint32_t &token, std::list<RsGroupMetaData> &groupInfo)
|
2012-06-07 13:10:47 -04:00
|
|
|
{
|
|
|
|
uint32_t status;
|
|
|
|
uint32_t reqtype;
|
2012-06-13 20:27:28 -04:00
|
|
|
uint32_t anstype;
|
2012-06-07 13:10:47 -04:00
|
|
|
time_t ts;
|
2012-06-13 20:27:28 -04:00
|
|
|
checkRequestStatus(token, status, reqtype, anstype, ts);
|
2012-06-07 13:10:47 -04:00
|
|
|
|
2012-06-13 20:27:28 -04:00
|
|
|
if (anstype != RS_TOKREQ_ANSTYPE_SUMMARY)
|
2012-06-07 13:10:47 -04:00
|
|
|
{
|
2012-06-13 20:27:28 -04:00
|
|
|
std::cerr << "p3IdService::getGroupSummary() ERROR AnsType Wrong" << std::endl;
|
2012-06-07 13:10:47 -04:00
|
|
|
return false;
|
|
|
|
}
|
2012-06-13 20:27:28 -04:00
|
|
|
|
|
|
|
if (reqtype != GXS_REQUEST_TYPE_GROUPS)
|
|
|
|
{
|
|
|
|
std::cerr << "p3IdService::getGroupSummary() ERROR ReqType Wrong" << std::endl;
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
2012-06-07 13:10:47 -04:00
|
|
|
if (status != GXS_REQUEST_STATUS_COMPLETE)
|
|
|
|
{
|
2012-06-13 20:27:28 -04:00
|
|
|
std::cerr << "p3IdService::getGroupSummary() ERROR Status Incomplete" << std::endl;
|
2012-06-07 13:10:47 -04:00
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
2012-06-13 20:27:28 -04:00
|
|
|
std::list<std::string> groupIds;
|
|
|
|
bool ans = loadRequestOutList(token, groupIds);
|
2012-06-07 13:10:47 -04:00
|
|
|
updateRequestStatus(token, GXS_REQUEST_STATUS_DONE);
|
|
|
|
|
2012-06-13 20:27:28 -04:00
|
|
|
/* convert to RsGroupMetaData */
|
|
|
|
mProxy->getGroupSummary(groupIds, groupInfo);
|
|
|
|
|
2012-06-07 13:10:47 -04:00
|
|
|
return ans;
|
|
|
|
}
|
|
|
|
|
2012-06-13 20:27:28 -04:00
|
|
|
bool p3IdService::getMsgSummary( const uint32_t &token, std::list<RsMsgMetaData> &msgInfo)
|
2012-06-07 13:10:47 -04:00
|
|
|
{
|
|
|
|
uint32_t status;
|
|
|
|
uint32_t reqtype;
|
2012-06-13 20:27:28 -04:00
|
|
|
uint32_t anstype;
|
2012-06-07 13:10:47 -04:00
|
|
|
time_t ts;
|
2012-06-13 20:27:28 -04:00
|
|
|
checkRequestStatus(token, status, reqtype, anstype, ts);
|
2012-06-07 13:10:47 -04:00
|
|
|
|
2012-06-13 20:27:28 -04:00
|
|
|
if (anstype != RS_TOKREQ_ANSTYPE_SUMMARY)
|
2012-06-07 13:10:47 -04:00
|
|
|
{
|
2012-06-13 20:27:28 -04:00
|
|
|
std::cerr << "p3IdService::getMsgSummary() ERROR AnsType Wrong" << std::endl;
|
2012-06-07 13:10:47 -04:00
|
|
|
return false;
|
|
|
|
}
|
2012-06-13 20:27:28 -04:00
|
|
|
|
|
|
|
if ((reqtype != GXS_REQUEST_TYPE_MSGS) && (reqtype != GXS_REQUEST_TYPE_MSGRELATED))
|
2012-06-07 13:10:47 -04:00
|
|
|
{
|
2012-06-13 20:27:28 -04:00
|
|
|
std::cerr << "p3IdService::getMsgSummary() ERROR ReqType Wrong" << std::endl;
|
2012-06-07 13:10:47 -04:00
|
|
|
return false;
|
|
|
|
}
|
2012-06-13 20:27:28 -04:00
|
|
|
|
|
|
|
if (status != GXS_REQUEST_STATUS_COMPLETE)
|
2012-06-07 13:10:47 -04:00
|
|
|
{
|
2012-06-13 20:27:28 -04:00
|
|
|
std::cerr << "p3IdService::getMsgSummary() ERROR Status Incomplete" << std::endl;
|
2012-06-07 13:10:47 -04:00
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
2012-06-13 20:27:28 -04:00
|
|
|
std::list<std::string> msgIds;
|
|
|
|
bool ans = loadRequestOutList(token, msgIds);
|
|
|
|
updateRequestStatus(token, GXS_REQUEST_STATUS_DONE);
|
|
|
|
|
|
|
|
/* convert to RsMsgMetaData */
|
|
|
|
mProxy->getMsgSummary(msgIds, msgInfo);
|
|
|
|
|
2012-06-07 13:10:47 -04:00
|
|
|
return ans;
|
|
|
|
}
|
|
|
|
|
2012-06-13 20:27:28 -04:00
|
|
|
|
|
|
|
/* Specific Service Data */
|
|
|
|
bool p3IdService::getGroupData(const uint32_t &token, RsIdGroup &group)
|
2012-06-07 13:10:47 -04:00
|
|
|
{
|
|
|
|
uint32_t status;
|
|
|
|
uint32_t reqtype;
|
2012-06-13 20:27:28 -04:00
|
|
|
uint32_t anstype;
|
2012-06-07 13:10:47 -04:00
|
|
|
time_t ts;
|
2012-06-13 20:27:28 -04:00
|
|
|
checkRequestStatus(token, status, reqtype, anstype, ts);
|
|
|
|
|
2012-06-07 13:10:47 -04:00
|
|
|
|
2012-06-13 20:27:28 -04:00
|
|
|
if (anstype != RS_TOKREQ_ANSTYPE_DATA)
|
2012-06-07 13:10:47 -04:00
|
|
|
{
|
2012-06-13 20:27:28 -04:00
|
|
|
std::cerr << "p3IdService::getGroupData() ERROR AnsType Wrong" << std::endl;
|
2012-06-07 13:10:47 -04:00
|
|
|
return false;
|
|
|
|
}
|
2012-06-13 20:27:28 -04:00
|
|
|
|
|
|
|
if (reqtype != GXS_REQUEST_TYPE_GROUPS)
|
|
|
|
{
|
|
|
|
std::cerr << "p3IdService::getGroupData() ERROR ReqType Wrong" << std::endl;
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
2012-06-07 13:10:47 -04:00
|
|
|
if (status != GXS_REQUEST_STATUS_COMPLETE)
|
|
|
|
{
|
2012-06-13 20:27:28 -04:00
|
|
|
std::cerr << "p3IdService::getGroupData() ERROR Status Incomplete" << std::endl;
|
2012-06-07 13:10:47 -04:00
|
|
|
return false;
|
|
|
|
}
|
2012-06-13 20:27:28 -04:00
|
|
|
|
2012-06-07 13:10:47 -04:00
|
|
|
std::string id;
|
2012-06-13 20:27:28 -04:00
|
|
|
if (!popRequestOutList(token, id))
|
2012-06-07 13:10:47 -04:00
|
|
|
{
|
|
|
|
/* finished */
|
|
|
|
updateRequestStatus(token, GXS_REQUEST_STATUS_DONE);
|
|
|
|
return false;
|
|
|
|
}
|
2012-06-13 20:27:28 -04:00
|
|
|
|
|
|
|
/* convert to RsIdGroup */
|
|
|
|
bool ans = mIdProxy->getGroup(id, group);
|
2012-06-07 13:10:47 -04:00
|
|
|
return ans;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2012-06-13 20:27:28 -04:00
|
|
|
bool p3IdService::getMsgData(const uint32_t &token, RsIdMsg &msg)
|
2012-06-07 13:10:47 -04:00
|
|
|
{
|
|
|
|
uint32_t status;
|
|
|
|
uint32_t reqtype;
|
2012-06-13 20:27:28 -04:00
|
|
|
uint32_t anstype;
|
2012-06-07 13:10:47 -04:00
|
|
|
time_t ts;
|
2012-06-13 20:27:28 -04:00
|
|
|
checkRequestStatus(token, status, reqtype, anstype, ts);
|
|
|
|
|
2012-06-07 13:10:47 -04:00
|
|
|
|
2012-06-13 20:27:28 -04:00
|
|
|
if (anstype != RS_TOKREQ_ANSTYPE_DATA)
|
2012-06-07 13:10:47 -04:00
|
|
|
{
|
2012-06-13 20:27:28 -04:00
|
|
|
std::cerr << "p3IdService::getMsgData() ERROR AnsType Wrong" << std::endl;
|
2012-06-07 13:10:47 -04:00
|
|
|
return false;
|
|
|
|
}
|
2012-06-13 20:27:28 -04:00
|
|
|
|
|
|
|
if ((reqtype != GXS_REQUEST_TYPE_MSGS) && (reqtype != GXS_REQUEST_TYPE_MSGRELATED))
|
|
|
|
{
|
|
|
|
std::cerr << "p3IdService::getMsgData() ERROR ReqType Wrong" << std::endl;
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
2012-06-07 13:10:47 -04:00
|
|
|
if (status != GXS_REQUEST_STATUS_COMPLETE)
|
|
|
|
{
|
2012-06-13 20:27:28 -04:00
|
|
|
std::cerr << "p3IdService::getMsgData() ERROR Status Incomplete" << std::endl;
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
|
|
|
std::string id;
|
|
|
|
if (!popRequestOutList(token, id))
|
|
|
|
{
|
|
|
|
/* finished */
|
|
|
|
updateRequestStatus(token, GXS_REQUEST_STATUS_DONE);
|
2012-06-07 13:10:47 -04:00
|
|
|
return false;
|
|
|
|
}
|
2012-06-13 20:27:28 -04:00
|
|
|
|
|
|
|
/* convert to RsIdMsg */
|
|
|
|
bool ans = mIdProxy->getMsg(id, msg);
|
|
|
|
return ans;
|
|
|
|
}
|
2012-06-07 13:10:47 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
2012-06-13 20:27:28 -04:00
|
|
|
/* Poll */
|
|
|
|
uint32_t p3IdService::requestStatus(const uint32_t token)
|
|
|
|
{
|
|
|
|
uint32_t status;
|
|
|
|
uint32_t reqtype;
|
|
|
|
uint32_t anstype;
|
|
|
|
time_t ts;
|
|
|
|
checkRequestStatus(token, status, reqtype, anstype, ts);
|
2012-06-07 13:10:47 -04:00
|
|
|
|
2012-06-13 20:27:28 -04:00
|
|
|
return status;
|
2012-06-07 13:10:47 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2012-06-13 20:27:28 -04:00
|
|
|
/* Cancel Request */
|
|
|
|
bool p3IdService::cancelRequest(const uint32_t &token)
|
2012-06-07 13:10:47 -04:00
|
|
|
{
|
2012-06-13 20:27:28 -04:00
|
|
|
return clearRequest(token);
|
|
|
|
}
|
2012-06-07 13:10:47 -04:00
|
|
|
|
2012-06-13 20:27:28 -04:00
|
|
|
//////////////////////////////////////////////////////////////////////////////
|
2012-07-06 19:14:18 -04:00
|
|
|
bool p3IdService::setMessageStatus(const std::string &msgId, const uint32_t status, const uint32_t statusMask)
|
2012-06-13 20:27:28 -04:00
|
|
|
{
|
2012-07-06 19:14:18 -04:00
|
|
|
return mIdProxy->setMessageStatus(msgId, status, statusMask);
|
2012-06-13 20:27:28 -04:00
|
|
|
}
|
2012-06-07 13:10:47 -04:00
|
|
|
|
2012-07-06 19:14:18 -04:00
|
|
|
bool p3IdService::setGroupStatus(const std::string &groupId, const uint32_t status, const uint32_t statusMask)
|
2012-06-13 20:27:28 -04:00
|
|
|
{
|
2012-07-06 19:14:18 -04:00
|
|
|
return mIdProxy->setGroupStatus(groupId, status, statusMask);
|
2012-06-07 13:10:47 -04:00
|
|
|
}
|
|
|
|
|
2012-07-06 19:14:18 -04:00
|
|
|
bool p3IdService::setGroupSubscribeFlags(const std::string &groupId, uint32_t subscribeFlags, uint32_t subscribeMask)
|
|
|
|
{
|
|
|
|
return mIdProxy->setGroupSubscribeFlags(groupId, subscribeFlags, subscribeMask);
|
|
|
|
}
|
2012-06-07 13:10:47 -04:00
|
|
|
|
2012-07-06 19:14:18 -04:00
|
|
|
bool p3IdService::setMessageServiceString(const std::string &msgId, const std::string &str)
|
2012-06-13 20:27:28 -04:00
|
|
|
{
|
2012-07-06 19:14:18 -04:00
|
|
|
return mIdProxy->setMessageServiceString(msgId, str);
|
|
|
|
}
|
|
|
|
|
|
|
|
bool p3IdService::setGroupServiceString(const std::string &grpId, const std::string &str)
|
|
|
|
{
|
|
|
|
return mIdProxy->setGroupServiceString(grpId, str);
|
2012-06-13 20:27:28 -04:00
|
|
|
}
|
2012-06-07 13:10:47 -04:00
|
|
|
|
|
|
|
|
2012-06-13 20:27:28 -04:00
|
|
|
bool p3IdService::groupRestoreKeys(const std::string &groupId)
|
2012-02-13 13:22:35 -05:00
|
|
|
{
|
2012-06-13 20:27:28 -04:00
|
|
|
return false;
|
|
|
|
}
|
2012-02-13 13:22:35 -05:00
|
|
|
|
2012-06-13 20:27:28 -04:00
|
|
|
bool p3IdService::groupShareKeys(const std::string &groupId, std::list<std::string>& peers)
|
|
|
|
{
|
|
|
|
return false;
|
2012-02-13 13:22:35 -05:00
|
|
|
}
|
|
|
|
|
2012-06-07 13:10:47 -04:00
|
|
|
|
2012-06-13 20:27:28 -04:00
|
|
|
/********************************************************************************************/
|
2012-02-13 13:22:35 -05:00
|
|
|
|
2012-06-13 20:27:28 -04:00
|
|
|
|
|
|
|
std::string p3IdService::genRandomId()
|
|
|
|
{
|
|
|
|
std::string randomId;
|
|
|
|
for(int i = 0; i < 20; i++)
|
2012-02-13 13:22:35 -05:00
|
|
|
{
|
2012-06-13 20:27:28 -04:00
|
|
|
randomId += (char) ('a' + (RSRandom::random_u32() % 26));
|
2012-02-13 13:22:35 -05:00
|
|
|
}
|
|
|
|
|
2012-06-13 20:27:28 -04:00
|
|
|
return randomId;
|
2012-02-13 13:22:35 -05:00
|
|
|
}
|
|
|
|
|
2012-07-06 19:14:18 -04:00
|
|
|
bool p3IdService::createGroup(uint32_t &token, RsIdGroup &group, bool isNew)
|
2012-06-13 20:27:28 -04:00
|
|
|
{
|
|
|
|
if (group.mMeta.mGroupId.empty())
|
|
|
|
{
|
|
|
|
/* new photo */
|
|
|
|
|
|
|
|
/* generate a temp id */
|
|
|
|
group.mMeta.mGroupId = genRandomId();
|
|
|
|
}
|
|
|
|
else
|
2012-02-13 13:22:35 -05:00
|
|
|
{
|
2012-06-13 20:27:28 -04:00
|
|
|
std::cerr << "p3IdService::createGroup() Group with existing Id... dropping";
|
|
|
|
std::cerr << std::endl;
|
2012-02-13 13:22:35 -05:00
|
|
|
return false;
|
|
|
|
}
|
2012-06-13 20:27:28 -04:00
|
|
|
|
2012-07-06 19:14:18 -04:00
|
|
|
{
|
|
|
|
RsStackMutex stack(mIdMtx); /********** STACK LOCKED MTX ******/
|
|
|
|
|
|
|
|
mUpdated = true;
|
|
|
|
mIdProxy->addGroup(group);
|
|
|
|
}
|
2012-06-13 20:27:28 -04:00
|
|
|
|
2012-07-06 19:14:18 -04:00
|
|
|
// Fake a request to return the GroupMetaData.
|
|
|
|
generateToken(token);
|
|
|
|
uint32_t ansType = RS_TOKREQ_ANSTYPE_SUMMARY;
|
|
|
|
RsTokReqOptions opts; // NULL is good.
|
|
|
|
std::list<std::string> groupIds;
|
|
|
|
groupIds.push_back(group.mMeta.mGroupId); // It will just return this one.
|
|
|
|
|
|
|
|
std::cerr << "p3IdService::createGroup() Generating Request Token: " << token << std::endl;
|
|
|
|
storeRequest(token, ansType, opts, GXS_REQUEST_TYPE_GROUPS, groupIds);
|
|
|
|
|
2012-06-13 20:27:28 -04:00
|
|
|
|
2012-02-13 13:22:35 -05:00
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
2012-06-13 20:27:28 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
2012-07-06 19:14:18 -04:00
|
|
|
bool p3IdService::createMsg(uint32_t &token, RsIdMsg &msg, bool isNew)
|
2012-02-13 13:22:35 -05:00
|
|
|
{
|
2012-06-13 20:27:28 -04:00
|
|
|
if (msg.mMeta.mGroupId.empty())
|
2012-02-13 13:22:35 -05:00
|
|
|
{
|
2012-06-13 20:27:28 -04:00
|
|
|
/* new photo */
|
|
|
|
std::cerr << "p3IdService::createMsg() Missing MsgID";
|
|
|
|
std::cerr << std::endl;
|
2012-02-13 13:22:35 -05:00
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
2012-06-13 20:27:28 -04:00
|
|
|
/* check if its a mod or new msg */
|
|
|
|
if (msg.mMeta.mOrigMsgId.empty())
|
|
|
|
{
|
|
|
|
std::cerr << "p3IdService::createMsg() New Msg";
|
|
|
|
std::cerr << std::endl;
|
|
|
|
|
|
|
|
/* new msg, generate a new OrigMsgId */
|
|
|
|
msg.mMeta.mOrigMsgId = genRandomId();
|
|
|
|
msg.mMeta.mMsgId = msg.mMeta.mOrigMsgId;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
std::cerr << "p3IdService::createMsg() Modified Msg";
|
|
|
|
std::cerr << std::endl;
|
|
|
|
|
|
|
|
/* mod msg, keep orig msg id, generate a new MsgId */
|
|
|
|
msg.mMeta.mMsgId = genRandomId();
|
|
|
|
}
|
|
|
|
|
|
|
|
std::cerr << "p3IdService::createMsg() GroupId: " << msg.mMeta.mGroupId;
|
|
|
|
std::cerr << std::endl;
|
|
|
|
std::cerr << "p3IdService::createMsg() MsgId: " << msg.mMeta.mMsgId;
|
|
|
|
std::cerr << std::endl;
|
|
|
|
std::cerr << "p3IdService::createMsg() OrigMsgId: " << msg.mMeta.mOrigMsgId;
|
|
|
|
std::cerr << std::endl;
|
|
|
|
|
2012-07-06 19:14:18 -04:00
|
|
|
{
|
|
|
|
RsStackMutex stack(mIdMtx); /********** STACK LOCKED MTX ******/
|
2012-06-13 20:27:28 -04:00
|
|
|
|
2012-07-06 19:14:18 -04:00
|
|
|
mUpdated = true;
|
|
|
|
mIdProxy->addMsg(msg);
|
|
|
|
}
|
|
|
|
|
|
|
|
// Fake a request to return the MsgMetaData.
|
|
|
|
generateToken(token);
|
|
|
|
uint32_t ansType = RS_TOKREQ_ANSTYPE_SUMMARY;
|
|
|
|
RsTokReqOptions opts; // NULL is good.
|
|
|
|
std::list<std::string> msgIds;
|
|
|
|
msgIds.push_back(msg.mMeta.mMsgId); // It will just return this one.
|
|
|
|
|
|
|
|
std::cerr << "p3IdService::createMsg() Generating Request Token: " << token << std::endl;
|
|
|
|
storeRequest(token, ansType, opts, GXS_REQUEST_TYPE_MSGRELATED, msgIds);
|
2012-06-13 20:27:28 -04:00
|
|
|
|
2012-02-13 13:22:35 -05:00
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2012-06-13 20:27:28 -04:00
|
|
|
|
|
|
|
/********************************************************************************************/
|
|
|
|
|
|
|
|
|
2012-02-13 13:22:35 -05:00
|
|
|
|
2012-06-13 20:27:28 -04:00
|
|
|
bool IdDataProxy::getGroup(const std::string &id, RsIdGroup &group)
|
|
|
|
{
|
|
|
|
void *groupData = NULL;
|
|
|
|
RsGroupMetaData meta;
|
|
|
|
if (getGroupData(id, groupData) && getGroupSummary(id, meta))
|
2012-02-13 13:22:35 -05:00
|
|
|
{
|
2012-06-13 20:27:28 -04:00
|
|
|
RsIdGroup *pG = (RsIdGroup *) groupData;
|
|
|
|
group = *pG;
|
|
|
|
|
|
|
|
// update definitive version of the metadata.
|
|
|
|
group.mMeta = meta;
|
|
|
|
|
|
|
|
std::cerr << "IdDataProxy::getGroup() Id: " << id;
|
|
|
|
std::cerr << " MetaData: " << meta << " DataPointer: " << groupData;
|
|
|
|
std::cerr << std::endl;
|
|
|
|
return true;
|
2012-02-13 13:22:35 -05:00
|
|
|
}
|
|
|
|
|
2012-06-13 20:27:28 -04:00
|
|
|
std::cerr << "IdDataProxy::getGroup() FAILED Id: " << id;
|
|
|
|
std::cerr << std::endl;
|
|
|
|
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
|
|
|
bool IdDataProxy::getMsg(const std::string &id, RsIdMsg &msg)
|
|
|
|
{
|
|
|
|
void *msgData = NULL;
|
|
|
|
RsMsgMetaData meta;
|
|
|
|
if (getMsgData(id, msgData) && getMsgSummary(id, meta))
|
2012-02-13 13:22:35 -05:00
|
|
|
{
|
2012-06-13 20:27:28 -04:00
|
|
|
RsIdMsg *pM = (RsIdMsg *) msgData;
|
|
|
|
// Shallow copy of thumbnail.
|
|
|
|
msg = *pM;
|
2012-02-13 13:22:35 -05:00
|
|
|
|
2012-06-13 20:27:28 -04:00
|
|
|
// update definitive version of the metadata.
|
|
|
|
msg.mMeta = meta;
|
|
|
|
|
|
|
|
std::cerr << "IdDataProxy::getMsg() Id: " << id;
|
|
|
|
std::cerr << " MetaData: " << meta << " DataPointer: " << msgData;
|
|
|
|
std::cerr << std::endl;
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
|
|
|
std::cerr << "IdDataProxy::getMsg() FAILED Id: " << id;
|
|
|
|
std::cerr << std::endl;
|
|
|
|
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
|
|
|
bool IdDataProxy::addGroup(const RsIdGroup &group)
|
|
|
|
{
|
|
|
|
// Make duplicate.
|
|
|
|
RsIdGroup *pG = new RsIdGroup();
|
|
|
|
*pG = group;
|
|
|
|
|
|
|
|
std::cerr << "IdDataProxy::addGroup()";
|
|
|
|
std::cerr << " MetaData: " << pG->mMeta << " DataPointer: " << pG;
|
|
|
|
std::cerr << std::endl;
|
|
|
|
|
|
|
|
return createGroup(pG);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
bool IdDataProxy::addMsg(const RsIdMsg &msg)
|
|
|
|
{
|
|
|
|
// Make duplicate.
|
|
|
|
RsIdMsg *pM = new RsIdMsg();
|
|
|
|
*pM = msg;
|
|
|
|
|
|
|
|
std::cerr << "IdDataProxy::addMsg()";
|
|
|
|
std::cerr << " MetaData: " << pM->mMeta << " DataPointer: " << pM;
|
|
|
|
std::cerr << std::endl;
|
|
|
|
|
|
|
|
return createMsg(pM);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/* These Functions must be overloaded to complete the service */
|
|
|
|
bool IdDataProxy::convertGroupToMetaData(void *groupData, RsGroupMetaData &meta)
|
|
|
|
{
|
|
|
|
RsIdGroup *group = (RsIdGroup *) groupData;
|
|
|
|
meta = group->mMeta;
|
|
|
|
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
|
|
|
bool IdDataProxy::convertMsgToMetaData(void *msgData, RsMsgMetaData &meta)
|
|
|
|
{
|
|
|
|
RsIdMsg *page = (RsIdMsg *) msgData;
|
|
|
|
meta = page->mMeta;
|
|
|
|
|
2012-02-13 13:22:35 -05:00
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2012-06-13 20:27:28 -04:00
|
|
|
|
|
|
|
|
|
|
|
/************************************************************************************/
|
|
|
|
/************************************************************************************/
|
|
|
|
/************************************************************************************/
|
|
|
|
/************************************************************************************/
|
|
|
|
/************************************************************************************/
|
|
|
|
|
|
|
|
#if 0
|
|
|
|
|
2012-02-13 13:22:35 -05:00
|
|
|
/* details are updated */
|
|
|
|
bool p3IdService::updateIdentity(RsIdData &data)
|
|
|
|
{
|
|
|
|
if (data.mKeyId.empty())
|
|
|
|
{
|
|
|
|
/* new photo */
|
|
|
|
|
|
|
|
/* generate a temp id */
|
|
|
|
data.mKeyId = genRandomId();
|
|
|
|
|
|
|
|
if (data.mIdType & RSID_TYPE_REALID)
|
|
|
|
{
|
|
|
|
data.mGpgIdHash = genRandomId();
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
data.mGpgIdHash = "";
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
RsStackMutex stack(mIdMtx); /********** STACK LOCKED MTX ******/
|
|
|
|
|
|
|
|
mUpdated = true;
|
|
|
|
|
|
|
|
/* add / modify */
|
|
|
|
mIds[data.mKeyId] = data;
|
|
|
|
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
bool p3IdService::updateOpinion(RsIdOpinion &opinion)
|
|
|
|
{
|
|
|
|
if (opinion.mKeyId.empty())
|
|
|
|
{
|
|
|
|
/* new photo */
|
|
|
|
std::cerr << "p3IdService::updateOpinion() Missing KeyId";
|
|
|
|
std::cerr << std::endl;
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* check if its a mod or new page */
|
|
|
|
if (opinion.mPeerId.empty())
|
|
|
|
{
|
|
|
|
std::cerr << "p3IdService::updateOpinion() Missing PeerId";
|
|
|
|
std::cerr << std::endl;
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
|
|
|
std::cerr << "p3IdService::updateOpinion() KeyId: " << opinion.mKeyId;
|
|
|
|
std::cerr << std::endl;
|
|
|
|
std::cerr << "p3IdService::updateOpinion() PeerId: " << opinion.mPeerId;
|
|
|
|
std::cerr << std::endl;
|
|
|
|
|
|
|
|
RsStackMutex stack(mIdMtx); /********** STACK LOCKED MTX ******/
|
|
|
|
|
|
|
|
mUpdated = true;
|
|
|
|
|
|
|
|
std::map<std::string, std::map<std::string, RsIdOpinion> >::iterator it;
|
|
|
|
std::map<std::string, RsIdOpinion>::iterator oit;
|
|
|
|
|
|
|
|
it = mOpinions.find(opinion.mKeyId);
|
|
|
|
if (it == mOpinions.end())
|
|
|
|
{
|
|
|
|
std::map<std::string, RsIdOpinion> emptyMap;
|
|
|
|
mOpinions[opinion.mKeyId] = emptyMap;
|
|
|
|
|
|
|
|
it = mOpinions.find(opinion.mKeyId);
|
|
|
|
}
|
|
|
|
|
|
|
|
(it->second)[opinion.mPeerId] = opinion;
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2012-06-13 20:27:28 -04:00
|
|
|
#endif
|
2012-02-13 13:22:35 -05:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void p3IdService::generateDummyData()
|
|
|
|
{
|
|
|
|
RsStackMutex stack(mIdMtx); /********** STACK LOCKED MTX ******/
|
|
|
|
|
|
|
|
/* grab all the gpg ids... and make some ids */
|
|
|
|
|
|
|
|
std::list<std::string> gpgids;
|
|
|
|
std::list<std::string>::iterator it;
|
|
|
|
|
|
|
|
rsPeers->getGPGAllList(gpgids);
|
|
|
|
|
|
|
|
std::string ownId = rsPeers->getGPGOwnId();
|
|
|
|
gpgids.push_back(ownId);
|
|
|
|
|
|
|
|
int i;
|
|
|
|
for(it = gpgids.begin(); it != gpgids.end(); it++)
|
|
|
|
{
|
|
|
|
/* create one or two for each one */
|
|
|
|
int nIds = 1 + (RSRandom::random_u32() % 2);
|
|
|
|
for(i = 0; i < nIds; i++)
|
|
|
|
{
|
2012-06-13 20:27:28 -04:00
|
|
|
RsIdGroup id;
|
2012-02-13 13:22:35 -05:00
|
|
|
|
|
|
|
RsPeerDetails details;
|
|
|
|
|
2012-06-13 20:27:28 -04:00
|
|
|
//id.mKeyId = genRandomId();
|
|
|
|
id.mMeta.mGroupId = genRandomId();
|
2012-02-13 13:22:35 -05:00
|
|
|
id.mIdType = RSID_TYPE_REALID;
|
|
|
|
id.mGpgIdHash = genRandomId();
|
|
|
|
|
|
|
|
if (rsPeers->getPeerDetails(*it, details))
|
|
|
|
{
|
|
|
|
std::ostringstream out;
|
|
|
|
out << details.name << "_" << i + 1;
|
|
|
|
|
2012-06-13 20:27:28 -04:00
|
|
|
//id.mNickname = out.str();
|
|
|
|
id.mMeta.mGroupName = out.str();
|
|
|
|
|
2012-02-13 13:22:35 -05:00
|
|
|
id.mGpgIdKnown = true;
|
|
|
|
|
|
|
|
id.mGpgId = *it;
|
|
|
|
id.mGpgName = details.name;
|
|
|
|
id.mGpgEmail = details.email;
|
|
|
|
|
|
|
|
if (*it == ownId)
|
|
|
|
{
|
|
|
|
id.mIdType |= RSID_RELATION_YOURSELF;
|
|
|
|
}
|
|
|
|
else if (rsPeers->isGPGAccepted(*it))
|
|
|
|
{
|
|
|
|
id.mIdType |= RSID_RELATION_FRIEND;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
id.mIdType |= RSID_RELATION_OTHER;
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
std::cerr << "p3IdService::generateDummyData() missing" << std::endl;
|
|
|
|
std::cerr << std::endl;
|
|
|
|
|
|
|
|
id.mIdType |= RSID_RELATION_OTHER;
|
2012-06-13 20:27:28 -04:00
|
|
|
//id.mNickname = genRandomId();
|
|
|
|
id.mMeta.mGroupName = genRandomId();
|
2012-02-13 13:22:35 -05:00
|
|
|
id.mGpgIdKnown = false;
|
|
|
|
}
|
|
|
|
|
2012-06-13 20:27:28 -04:00
|
|
|
//mIds[id.mKeyId] = id;
|
|
|
|
mIdProxy->addGroup(id);
|
2012-02-13 13:22:35 -05:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
#define MAX_RANDOM_GPGIDS 1000
|
|
|
|
#define MAX_RANDOM_PSEUDOIDS 5000
|
|
|
|
|
|
|
|
int nFakeGPGs = (RSRandom::random_u32() % MAX_RANDOM_GPGIDS);
|
|
|
|
int nFakePseudoIds = (RSRandom::random_u32() % MAX_RANDOM_PSEUDOIDS);
|
|
|
|
|
|
|
|
/* make some fake gpg ids */
|
|
|
|
for(i = 0; i < nFakeGPGs; i++)
|
|
|
|
{
|
2012-06-13 20:27:28 -04:00
|
|
|
RsIdGroup id;
|
2012-02-13 13:22:35 -05:00
|
|
|
|
|
|
|
RsPeerDetails details;
|
|
|
|
|
2012-06-13 20:27:28 -04:00
|
|
|
//id.mKeyId = genRandomId();
|
|
|
|
id.mMeta.mGroupId = genRandomId();
|
2012-02-13 13:22:35 -05:00
|
|
|
id.mIdType = RSID_TYPE_REALID;
|
|
|
|
id.mGpgIdHash = genRandomId();
|
|
|
|
|
|
|
|
id.mIdType |= RSID_RELATION_OTHER;
|
2012-06-13 20:27:28 -04:00
|
|
|
//id.mNickname = genRandomId();
|
|
|
|
id.mMeta.mGroupName = genRandomId();
|
2012-02-13 13:22:35 -05:00
|
|
|
id.mGpgIdKnown = false;
|
|
|
|
id.mGpgId = "";
|
|
|
|
id.mGpgName = "";
|
|
|
|
id.mGpgEmail = "";
|
|
|
|
|
2012-06-13 20:27:28 -04:00
|
|
|
//mIds[id.mKeyId] = id;
|
|
|
|
mIdProxy->addGroup(id);
|
2012-02-13 13:22:35 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
/* make lots of pseudo ids */
|
|
|
|
for(i = 0; i < nFakePseudoIds; i++)
|
|
|
|
{
|
2012-06-13 20:27:28 -04:00
|
|
|
RsIdGroup id;
|
2012-02-13 13:22:35 -05:00
|
|
|
|
|
|
|
RsPeerDetails details;
|
|
|
|
|
2012-06-13 20:27:28 -04:00
|
|
|
//id.mKeyId = genRandomId();
|
|
|
|
id.mMeta.mGroupId = genRandomId();
|
2012-02-13 13:22:35 -05:00
|
|
|
id.mIdType = RSID_TYPE_PSEUDONYM;
|
|
|
|
id.mGpgIdHash = "";
|
|
|
|
|
2012-06-13 20:27:28 -04:00
|
|
|
//id.mNickname = genRandomId();
|
|
|
|
id.mMeta.mGroupName = genRandomId();
|
2012-02-13 13:22:35 -05:00
|
|
|
id.mGpgIdKnown = false;
|
|
|
|
id.mGpgId = "";
|
|
|
|
id.mGpgName = "";
|
|
|
|
id.mGpgEmail = "";
|
|
|
|
|
2012-06-13 20:27:28 -04:00
|
|
|
//mIds[id.mKeyId] = id;
|
|
|
|
mIdProxy->addGroup(id);
|
2012-02-13 13:22:35 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
mUpdated = true;
|
|
|
|
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
std::string rsIdTypeToString(uint32_t idtype)
|
|
|
|
{
|
|
|
|
std::string str;
|
|
|
|
if (idtype & RSID_TYPE_REALID)
|
|
|
|
{
|
|
|
|
str += "GPGID ";
|
|
|
|
}
|
|
|
|
if (idtype & RSID_TYPE_PSEUDONYM)
|
|
|
|
{
|
|
|
|
str += "PSEUDO ";
|
|
|
|
}
|
|
|
|
if (idtype & RSID_RELATION_YOURSELF)
|
|
|
|
{
|
|
|
|
str += "YOURSELF ";
|
|
|
|
}
|
|
|
|
if (idtype & RSID_RELATION_FRIEND)
|
|
|
|
{
|
|
|
|
str += "FRIEND ";
|
|
|
|
}
|
|
|
|
if (idtype & RSID_RELATION_FOF)
|
|
|
|
{
|
|
|
|
str += "FOF ";
|
|
|
|
}
|
|
|
|
if (idtype & RSID_RELATION_OTHER)
|
|
|
|
{
|
|
|
|
str += "OTHER ";
|
|
|
|
}
|
|
|
|
if (idtype & RSID_RELATION_UNKNOWN)
|
|
|
|
{
|
|
|
|
str += "UNKNOWN ";
|
|
|
|
}
|
|
|
|
return str;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
2012-06-13 20:27:28 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|