mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-01-24 14:23:36 -05:00
Improved interfaces for Search, Chat and Peers.
Added latest protobuf files. NB: This branch is now incompatible with most RPC Clients. It will be developed in parallel with pyrs branch "rpc_dev" git-svn-id: http://svn.code.sf.net/p/retroshare/code/branches/v0.5-rpc-b1@6137 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
parent
e833fd1aaa
commit
e1e040c3eb
@ -141,7 +141,7 @@ introserver {
|
||||
|
||||
|
||||
sshserver {
|
||||
LIBSSH_DIR = ../../../../libssh-0.5.2
|
||||
LIBSSH_DIR = ../../../lib/libssh-0.5.2
|
||||
|
||||
# This Requires libssh-0.5.* to compile.
|
||||
# Modify path below to point at it.
|
||||
|
@ -67,6 +67,12 @@ const ::google::protobuf::internal::GeneratedMessageReflection*
|
||||
const ::google::protobuf::Descriptor* ResponseSendMessage_descriptor_ = NULL;
|
||||
const ::google::protobuf::internal::GeneratedMessageReflection*
|
||||
ResponseSendMessage_reflection_ = NULL;
|
||||
const ::google::protobuf::Descriptor* RequestChatHistory_descriptor_ = NULL;
|
||||
const ::google::protobuf::internal::GeneratedMessageReflection*
|
||||
RequestChatHistory_reflection_ = NULL;
|
||||
const ::google::protobuf::Descriptor* ResponseChatHistory_descriptor_ = NULL;
|
||||
const ::google::protobuf::internal::GeneratedMessageReflection*
|
||||
ResponseChatHistory_reflection_ = NULL;
|
||||
const ::google::protobuf::EnumDescriptor* RequestMsgIds_descriptor_ = NULL;
|
||||
const ::google::protobuf::EnumDescriptor* ResponseMsgIds_descriptor_ = NULL;
|
||||
const ::google::protobuf::EnumDescriptor* LobbyPrivacyLevel_descriptor_ = NULL;
|
||||
@ -332,6 +338,38 @@ void protobuf_AssignDesc_chat_2eproto() {
|
||||
::google::protobuf::DescriptorPool::generated_pool(),
|
||||
::google::protobuf::MessageFactory::generated_factory(),
|
||||
sizeof(ResponseSendMessage));
|
||||
RequestChatHistory_descriptor_ = file->message_type(15);
|
||||
static const int RequestChatHistory_offsets_[1] = {
|
||||
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(RequestChatHistory, id_),
|
||||
};
|
||||
RequestChatHistory_reflection_ =
|
||||
new ::google::protobuf::internal::GeneratedMessageReflection(
|
||||
RequestChatHistory_descriptor_,
|
||||
RequestChatHistory::default_instance_,
|
||||
RequestChatHistory_offsets_,
|
||||
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(RequestChatHistory, _has_bits_[0]),
|
||||
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(RequestChatHistory, _unknown_fields_),
|
||||
-1,
|
||||
::google::protobuf::DescriptorPool::generated_pool(),
|
||||
::google::protobuf::MessageFactory::generated_factory(),
|
||||
sizeof(RequestChatHistory));
|
||||
ResponseChatHistory_descriptor_ = file->message_type(16);
|
||||
static const int ResponseChatHistory_offsets_[3] = {
|
||||
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(ResponseChatHistory, status_),
|
||||
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(ResponseChatHistory, id_),
|
||||
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(ResponseChatHistory, msgs_),
|
||||
};
|
||||
ResponseChatHistory_reflection_ =
|
||||
new ::google::protobuf::internal::GeneratedMessageReflection(
|
||||
ResponseChatHistory_descriptor_,
|
||||
ResponseChatHistory::default_instance_,
|
||||
ResponseChatHistory_offsets_,
|
||||
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(ResponseChatHistory, _has_bits_[0]),
|
||||
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(ResponseChatHistory, _unknown_fields_),
|
||||
-1,
|
||||
::google::protobuf::DescriptorPool::generated_pool(),
|
||||
::google::protobuf::MessageFactory::generated_factory(),
|
||||
sizeof(ResponseChatHistory));
|
||||
RequestMsgIds_descriptor_ = file->enum_type(0);
|
||||
ResponseMsgIds_descriptor_ = file->enum_type(1);
|
||||
LobbyPrivacyLevel_descriptor_ = file->enum_type(2);
|
||||
@ -378,6 +416,10 @@ void protobuf_RegisterTypes(const ::std::string&) {
|
||||
RequestSendMessage_descriptor_, &RequestSendMessage::default_instance());
|
||||
::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage(
|
||||
ResponseSendMessage_descriptor_, &ResponseSendMessage::default_instance());
|
||||
::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage(
|
||||
RequestChatHistory_descriptor_, &RequestChatHistory::default_instance());
|
||||
::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage(
|
||||
ResponseChatHistory_descriptor_, &ResponseChatHistory::default_instance());
|
||||
}
|
||||
|
||||
} // namespace
|
||||
@ -413,6 +455,10 @@ void protobuf_ShutdownFile_chat_2eproto() {
|
||||
delete RequestSendMessage_reflection_;
|
||||
delete ResponseSendMessage::default_instance_;
|
||||
delete ResponseSendMessage_reflection_;
|
||||
delete RequestChatHistory::default_instance_;
|
||||
delete RequestChatHistory_reflection_;
|
||||
delete ResponseChatHistory::default_instance_;
|
||||
delete ResponseChatHistory_reflection_;
|
||||
}
|
||||
|
||||
void protobuf_AddDesc_chat_2eproto() {
|
||||
@ -468,21 +514,27 @@ void protobuf_AddDesc_chat_2eproto() {
|
||||
"\003msg\030\001 \002(\0132\030.rsctrl.chat.ChatMessage\";\n\022"
|
||||
"RequestSendMessage\022%\n\003msg\030\001 \002(\0132\030.rsctrl"
|
||||
".chat.ChatMessage\":\n\023ResponseSendMessage"
|
||||
"\022#\n\006status\030\001 \002(\0132\023.rsctrl.core.Status*\320\001"
|
||||
"\n\rRequestMsgIds\022\034\n\030MsgId_RequestChatLobb"
|
||||
"ies\020\001\022\034\n\030MsgId_RequestCreateLobby\020\002\022!\n\035M"
|
||||
"sgId_RequestJoinOrLeaveLobby\020\003\022!\n\035MsgId_"
|
||||
"RequestSetLobbyNickname\020\004\022\037\n\033MsgId_Reque"
|
||||
"stRegisterEvents\020\005\022\034\n\030MsgId_RequestSendM"
|
||||
"essage\020\006*\314\001\n\016ResponseMsgIds\022\035\n\031MsgId_Res"
|
||||
"ponseChatLobbies\020\001\022\"\n\036MsgId_ResponseSetL"
|
||||
"obbyNickname\020\004\022 \n\034MsgId_ResponseRegister"
|
||||
"Events\020\005\022\035\n\031MsgId_ResponseSendMessage\020\006\022"
|
||||
"\032\n\026MsgId_EventLobbyInvite\020e\022\032\n\026MsgId_Eve"
|
||||
"ntChatMessage\020f*<\n\021LobbyPrivacyLevel\022\023\n\017"
|
||||
"PRIVACY_PRIVATE\020\001\022\022\n\016PRIVACY_PUBLIC\020\002*<\n"
|
||||
"\010ChatType\022\020\n\014TYPE_PRIVATE\020\001\022\016\n\nTYPE_LOBB"
|
||||
"Y\020\002\022\016\n\nTYPE_GROUP\020\003", 2379);
|
||||
"\022#\n\006status\030\001 \002(\0132\023.rsctrl.core.Status\"5\n"
|
||||
"\022RequestChatHistory\022\037\n\002id\030\001 \002(\0132\023.rsctrl"
|
||||
".chat.ChatId\"\203\001\n\023ResponseChatHistory\022#\n\006"
|
||||
"status\030\001 \002(\0132\023.rsctrl.core.Status\022\037\n\002id\030"
|
||||
"\002 \002(\0132\023.rsctrl.chat.ChatId\022&\n\004msgs\030\003 \003(\013"
|
||||
"2\030.rsctrl.chat.ChatMessage*\356\001\n\rRequestMs"
|
||||
"gIds\022\034\n\030MsgId_RequestChatLobbies\020\001\022\034\n\030Ms"
|
||||
"gId_RequestCreateLobby\020\002\022!\n\035MsgId_Reques"
|
||||
"tJoinOrLeaveLobby\020\003\022!\n\035MsgId_RequestSetL"
|
||||
"obbyNickname\020\004\022\037\n\033MsgId_RequestRegisterE"
|
||||
"vents\020\005\022\034\n\030MsgId_RequestSendMessage\020\006\022\034\n"
|
||||
"\030MsgId_RequestChatHistory\020\007*\353\001\n\016Response"
|
||||
"MsgIds\022\035\n\031MsgId_ResponseChatLobbies\020\001\022\"\n"
|
||||
"\036MsgId_ResponseSetLobbyNickname\020\004\022 \n\034Msg"
|
||||
"Id_ResponseRegisterEvents\020\005\022\035\n\031MsgId_Res"
|
||||
"ponseSendMessage\020\006\022\035\n\031MsgId_ResponseChat"
|
||||
"History\020\007\022\032\n\026MsgId_EventLobbyInvite\020e\022\032\n"
|
||||
"\026MsgId_EventChatMessage\020f*<\n\021LobbyPrivac"
|
||||
"yLevel\022\023\n\017PRIVACY_PRIVATE\020\001\022\022\n\016PRIVACY_P"
|
||||
"UBLIC\020\002*<\n\010ChatType\022\020\n\014TYPE_PRIVATE\020\001\022\016\n"
|
||||
"\nTYPE_LOBBY\020\002\022\016\n\nTYPE_GROUP\020\003", 2629);
|
||||
::google::protobuf::MessageFactory::InternalRegisterGeneratedFile(
|
||||
"chat.proto", &protobuf_RegisterTypes);
|
||||
ChatLobbyInfo::default_instance_ = new ChatLobbyInfo();
|
||||
@ -500,6 +552,8 @@ void protobuf_AddDesc_chat_2eproto() {
|
||||
EventChatMessage::default_instance_ = new EventChatMessage();
|
||||
RequestSendMessage::default_instance_ = new RequestSendMessage();
|
||||
ResponseSendMessage::default_instance_ = new ResponseSendMessage();
|
||||
RequestChatHistory::default_instance_ = new RequestChatHistory();
|
||||
ResponseChatHistory::default_instance_ = new ResponseChatHistory();
|
||||
ChatLobbyInfo::default_instance_->InitAsDefaultInstance();
|
||||
ChatId::default_instance_->InitAsDefaultInstance();
|
||||
ChatMessage::default_instance_->InitAsDefaultInstance();
|
||||
@ -515,6 +569,8 @@ void protobuf_AddDesc_chat_2eproto() {
|
||||
EventChatMessage::default_instance_->InitAsDefaultInstance();
|
||||
RequestSendMessage::default_instance_->InitAsDefaultInstance();
|
||||
ResponseSendMessage::default_instance_->InitAsDefaultInstance();
|
||||
RequestChatHistory::default_instance_->InitAsDefaultInstance();
|
||||
ResponseChatHistory::default_instance_->InitAsDefaultInstance();
|
||||
::google::protobuf::internal::OnShutdown(&protobuf_ShutdownFile_chat_2eproto);
|
||||
}
|
||||
|
||||
@ -537,6 +593,7 @@ bool RequestMsgIds_IsValid(int value) {
|
||||
case 4:
|
||||
case 5:
|
||||
case 6:
|
||||
case 7:
|
||||
return true;
|
||||
default:
|
||||
return false;
|
||||
@ -553,6 +610,7 @@ bool ResponseMsgIds_IsValid(int value) {
|
||||
case 4:
|
||||
case 5:
|
||||
case 6:
|
||||
case 7:
|
||||
case 101:
|
||||
case 102:
|
||||
return true;
|
||||
@ -5011,6 +5069,529 @@ void ResponseSendMessage::Swap(ResponseSendMessage* other) {
|
||||
}
|
||||
|
||||
|
||||
// ===================================================================
|
||||
|
||||
#ifndef _MSC_VER
|
||||
const int RequestChatHistory::kIdFieldNumber;
|
||||
#endif // !_MSC_VER
|
||||
|
||||
RequestChatHistory::RequestChatHistory()
|
||||
: ::google::protobuf::Message() {
|
||||
SharedCtor();
|
||||
}
|
||||
|
||||
void RequestChatHistory::InitAsDefaultInstance() {
|
||||
id_ = const_cast< ::rsctrl::chat::ChatId*>(&::rsctrl::chat::ChatId::default_instance());
|
||||
}
|
||||
|
||||
RequestChatHistory::RequestChatHistory(const RequestChatHistory& from)
|
||||
: ::google::protobuf::Message() {
|
||||
SharedCtor();
|
||||
MergeFrom(from);
|
||||
}
|
||||
|
||||
void RequestChatHistory::SharedCtor() {
|
||||
_cached_size_ = 0;
|
||||
id_ = NULL;
|
||||
::memset(_has_bits_, 0, sizeof(_has_bits_));
|
||||
}
|
||||
|
||||
RequestChatHistory::~RequestChatHistory() {
|
||||
SharedDtor();
|
||||
}
|
||||
|
||||
void RequestChatHistory::SharedDtor() {
|
||||
if (this != default_instance_) {
|
||||
delete id_;
|
||||
}
|
||||
}
|
||||
|
||||
void RequestChatHistory::SetCachedSize(int size) const {
|
||||
GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
|
||||
_cached_size_ = size;
|
||||
GOOGLE_SAFE_CONCURRENT_WRITES_END();
|
||||
}
|
||||
const ::google::protobuf::Descriptor* RequestChatHistory::descriptor() {
|
||||
protobuf_AssignDescriptorsOnce();
|
||||
return RequestChatHistory_descriptor_;
|
||||
}
|
||||
|
||||
const RequestChatHistory& RequestChatHistory::default_instance() {
|
||||
if (default_instance_ == NULL) protobuf_AddDesc_chat_2eproto(); return *default_instance_;
|
||||
}
|
||||
|
||||
RequestChatHistory* RequestChatHistory::default_instance_ = NULL;
|
||||
|
||||
RequestChatHistory* RequestChatHistory::New() const {
|
||||
return new RequestChatHistory;
|
||||
}
|
||||
|
||||
void RequestChatHistory::Clear() {
|
||||
if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) {
|
||||
if (has_id()) {
|
||||
if (id_ != NULL) id_->::rsctrl::chat::ChatId::Clear();
|
||||
}
|
||||
}
|
||||
::memset(_has_bits_, 0, sizeof(_has_bits_));
|
||||
mutable_unknown_fields()->Clear();
|
||||
}
|
||||
|
||||
bool RequestChatHistory::MergePartialFromCodedStream(
|
||||
::google::protobuf::io::CodedInputStream* input) {
|
||||
#define DO_(EXPRESSION) if (!(EXPRESSION)) return false
|
||||
::google::protobuf::uint32 tag;
|
||||
while ((tag = input->ReadTag()) != 0) {
|
||||
switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) {
|
||||
// required .rsctrl.chat.ChatId id = 1;
|
||||
case 1: {
|
||||
if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
|
||||
::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED) {
|
||||
DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual(
|
||||
input, mutable_id()));
|
||||
} else {
|
||||
goto handle_uninterpreted;
|
||||
}
|
||||
if (input->ExpectAtEnd()) return true;
|
||||
break;
|
||||
}
|
||||
|
||||
default: {
|
||||
handle_uninterpreted:
|
||||
if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
|
||||
::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) {
|
||||
return true;
|
||||
}
|
||||
DO_(::google::protobuf::internal::WireFormat::SkipField(
|
||||
input, tag, mutable_unknown_fields()));
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
return true;
|
||||
#undef DO_
|
||||
}
|
||||
|
||||
void RequestChatHistory::SerializeWithCachedSizes(
|
||||
::google::protobuf::io::CodedOutputStream* output) const {
|
||||
// required .rsctrl.chat.ChatId id = 1;
|
||||
if (has_id()) {
|
||||
::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray(
|
||||
1, this->id(), output);
|
||||
}
|
||||
|
||||
if (!unknown_fields().empty()) {
|
||||
::google::protobuf::internal::WireFormat::SerializeUnknownFields(
|
||||
unknown_fields(), output);
|
||||
}
|
||||
}
|
||||
|
||||
::google::protobuf::uint8* RequestChatHistory::SerializeWithCachedSizesToArray(
|
||||
::google::protobuf::uint8* target) const {
|
||||
// required .rsctrl.chat.ChatId id = 1;
|
||||
if (has_id()) {
|
||||
target = ::google::protobuf::internal::WireFormatLite::
|
||||
WriteMessageNoVirtualToArray(
|
||||
1, this->id(), target);
|
||||
}
|
||||
|
||||
if (!unknown_fields().empty()) {
|
||||
target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray(
|
||||
unknown_fields(), target);
|
||||
}
|
||||
return target;
|
||||
}
|
||||
|
||||
int RequestChatHistory::ByteSize() const {
|
||||
int total_size = 0;
|
||||
|
||||
if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) {
|
||||
// required .rsctrl.chat.ChatId id = 1;
|
||||
if (has_id()) {
|
||||
total_size += 1 +
|
||||
::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual(
|
||||
this->id());
|
||||
}
|
||||
|
||||
}
|
||||
if (!unknown_fields().empty()) {
|
||||
total_size +=
|
||||
::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize(
|
||||
unknown_fields());
|
||||
}
|
||||
GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
|
||||
_cached_size_ = total_size;
|
||||
GOOGLE_SAFE_CONCURRENT_WRITES_END();
|
||||
return total_size;
|
||||
}
|
||||
|
||||
void RequestChatHistory::MergeFrom(const ::google::protobuf::Message& from) {
|
||||
GOOGLE_CHECK_NE(&from, this);
|
||||
const RequestChatHistory* source =
|
||||
::google::protobuf::internal::dynamic_cast_if_available<const RequestChatHistory*>(
|
||||
&from);
|
||||
if (source == NULL) {
|
||||
::google::protobuf::internal::ReflectionOps::Merge(from, this);
|
||||
} else {
|
||||
MergeFrom(*source);
|
||||
}
|
||||
}
|
||||
|
||||
void RequestChatHistory::MergeFrom(const RequestChatHistory& from) {
|
||||
GOOGLE_CHECK_NE(&from, this);
|
||||
if (from._has_bits_[0 / 32] & (0xffu << (0 % 32))) {
|
||||
if (from.has_id()) {
|
||||
mutable_id()->::rsctrl::chat::ChatId::MergeFrom(from.id());
|
||||
}
|
||||
}
|
||||
mutable_unknown_fields()->MergeFrom(from.unknown_fields());
|
||||
}
|
||||
|
||||
void RequestChatHistory::CopyFrom(const ::google::protobuf::Message& from) {
|
||||
if (&from == this) return;
|
||||
Clear();
|
||||
MergeFrom(from);
|
||||
}
|
||||
|
||||
void RequestChatHistory::CopyFrom(const RequestChatHistory& from) {
|
||||
if (&from == this) return;
|
||||
Clear();
|
||||
MergeFrom(from);
|
||||
}
|
||||
|
||||
bool RequestChatHistory::IsInitialized() const {
|
||||
if ((_has_bits_[0] & 0x00000001) != 0x00000001) return false;
|
||||
|
||||
if (has_id()) {
|
||||
if (!this->id().IsInitialized()) return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
void RequestChatHistory::Swap(RequestChatHistory* other) {
|
||||
if (other != this) {
|
||||
std::swap(id_, other->id_);
|
||||
std::swap(_has_bits_[0], other->_has_bits_[0]);
|
||||
_unknown_fields_.Swap(&other->_unknown_fields_);
|
||||
std::swap(_cached_size_, other->_cached_size_);
|
||||
}
|
||||
}
|
||||
|
||||
::google::protobuf::Metadata RequestChatHistory::GetMetadata() const {
|
||||
protobuf_AssignDescriptorsOnce();
|
||||
::google::protobuf::Metadata metadata;
|
||||
metadata.descriptor = RequestChatHistory_descriptor_;
|
||||
metadata.reflection = RequestChatHistory_reflection_;
|
||||
return metadata;
|
||||
}
|
||||
|
||||
|
||||
// ===================================================================
|
||||
|
||||
#ifndef _MSC_VER
|
||||
const int ResponseChatHistory::kStatusFieldNumber;
|
||||
const int ResponseChatHistory::kIdFieldNumber;
|
||||
const int ResponseChatHistory::kMsgsFieldNumber;
|
||||
#endif // !_MSC_VER
|
||||
|
||||
ResponseChatHistory::ResponseChatHistory()
|
||||
: ::google::protobuf::Message() {
|
||||
SharedCtor();
|
||||
}
|
||||
|
||||
void ResponseChatHistory::InitAsDefaultInstance() {
|
||||
status_ = const_cast< ::rsctrl::core::Status*>(&::rsctrl::core::Status::default_instance());
|
||||
id_ = const_cast< ::rsctrl::chat::ChatId*>(&::rsctrl::chat::ChatId::default_instance());
|
||||
}
|
||||
|
||||
ResponseChatHistory::ResponseChatHistory(const ResponseChatHistory& from)
|
||||
: ::google::protobuf::Message() {
|
||||
SharedCtor();
|
||||
MergeFrom(from);
|
||||
}
|
||||
|
||||
void ResponseChatHistory::SharedCtor() {
|
||||
_cached_size_ = 0;
|
||||
status_ = NULL;
|
||||
id_ = NULL;
|
||||
::memset(_has_bits_, 0, sizeof(_has_bits_));
|
||||
}
|
||||
|
||||
ResponseChatHistory::~ResponseChatHistory() {
|
||||
SharedDtor();
|
||||
}
|
||||
|
||||
void ResponseChatHistory::SharedDtor() {
|
||||
if (this != default_instance_) {
|
||||
delete status_;
|
||||
delete id_;
|
||||
}
|
||||
}
|
||||
|
||||
void ResponseChatHistory::SetCachedSize(int size) const {
|
||||
GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
|
||||
_cached_size_ = size;
|
||||
GOOGLE_SAFE_CONCURRENT_WRITES_END();
|
||||
}
|
||||
const ::google::protobuf::Descriptor* ResponseChatHistory::descriptor() {
|
||||
protobuf_AssignDescriptorsOnce();
|
||||
return ResponseChatHistory_descriptor_;
|
||||
}
|
||||
|
||||
const ResponseChatHistory& ResponseChatHistory::default_instance() {
|
||||
if (default_instance_ == NULL) protobuf_AddDesc_chat_2eproto(); return *default_instance_;
|
||||
}
|
||||
|
||||
ResponseChatHistory* ResponseChatHistory::default_instance_ = NULL;
|
||||
|
||||
ResponseChatHistory* ResponseChatHistory::New() const {
|
||||
return new ResponseChatHistory;
|
||||
}
|
||||
|
||||
void ResponseChatHistory::Clear() {
|
||||
if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) {
|
||||
if (has_status()) {
|
||||
if (status_ != NULL) status_->::rsctrl::core::Status::Clear();
|
||||
}
|
||||
if (has_id()) {
|
||||
if (id_ != NULL) id_->::rsctrl::chat::ChatId::Clear();
|
||||
}
|
||||
}
|
||||
msgs_.Clear();
|
||||
::memset(_has_bits_, 0, sizeof(_has_bits_));
|
||||
mutable_unknown_fields()->Clear();
|
||||
}
|
||||
|
||||
bool ResponseChatHistory::MergePartialFromCodedStream(
|
||||
::google::protobuf::io::CodedInputStream* input) {
|
||||
#define DO_(EXPRESSION) if (!(EXPRESSION)) return false
|
||||
::google::protobuf::uint32 tag;
|
||||
while ((tag = input->ReadTag()) != 0) {
|
||||
switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) {
|
||||
// required .rsctrl.core.Status status = 1;
|
||||
case 1: {
|
||||
if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
|
||||
::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED) {
|
||||
DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual(
|
||||
input, mutable_status()));
|
||||
} else {
|
||||
goto handle_uninterpreted;
|
||||
}
|
||||
if (input->ExpectTag(18)) goto parse_id;
|
||||
break;
|
||||
}
|
||||
|
||||
// required .rsctrl.chat.ChatId id = 2;
|
||||
case 2: {
|
||||
if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
|
||||
::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED) {
|
||||
parse_id:
|
||||
DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual(
|
||||
input, mutable_id()));
|
||||
} else {
|
||||
goto handle_uninterpreted;
|
||||
}
|
||||
if (input->ExpectTag(26)) goto parse_msgs;
|
||||
break;
|
||||
}
|
||||
|
||||
// repeated .rsctrl.chat.ChatMessage msgs = 3;
|
||||
case 3: {
|
||||
if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
|
||||
::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED) {
|
||||
parse_msgs:
|
||||
DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual(
|
||||
input, add_msgs()));
|
||||
} else {
|
||||
goto handle_uninterpreted;
|
||||
}
|
||||
if (input->ExpectTag(26)) goto parse_msgs;
|
||||
if (input->ExpectAtEnd()) return true;
|
||||
break;
|
||||
}
|
||||
|
||||
default: {
|
||||
handle_uninterpreted:
|
||||
if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
|
||||
::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) {
|
||||
return true;
|
||||
}
|
||||
DO_(::google::protobuf::internal::WireFormat::SkipField(
|
||||
input, tag, mutable_unknown_fields()));
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
return true;
|
||||
#undef DO_
|
||||
}
|
||||
|
||||
void ResponseChatHistory::SerializeWithCachedSizes(
|
||||
::google::protobuf::io::CodedOutputStream* output) const {
|
||||
// required .rsctrl.core.Status status = 1;
|
||||
if (has_status()) {
|
||||
::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray(
|
||||
1, this->status(), output);
|
||||
}
|
||||
|
||||
// required .rsctrl.chat.ChatId id = 2;
|
||||
if (has_id()) {
|
||||
::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray(
|
||||
2, this->id(), output);
|
||||
}
|
||||
|
||||
// repeated .rsctrl.chat.ChatMessage msgs = 3;
|
||||
for (int i = 0; i < this->msgs_size(); i++) {
|
||||
::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray(
|
||||
3, this->msgs(i), output);
|
||||
}
|
||||
|
||||
if (!unknown_fields().empty()) {
|
||||
::google::protobuf::internal::WireFormat::SerializeUnknownFields(
|
||||
unknown_fields(), output);
|
||||
}
|
||||
}
|
||||
|
||||
::google::protobuf::uint8* ResponseChatHistory::SerializeWithCachedSizesToArray(
|
||||
::google::protobuf::uint8* target) const {
|
||||
// required .rsctrl.core.Status status = 1;
|
||||
if (has_status()) {
|
||||
target = ::google::protobuf::internal::WireFormatLite::
|
||||
WriteMessageNoVirtualToArray(
|
||||
1, this->status(), target);
|
||||
}
|
||||
|
||||
// required .rsctrl.chat.ChatId id = 2;
|
||||
if (has_id()) {
|
||||
target = ::google::protobuf::internal::WireFormatLite::
|
||||
WriteMessageNoVirtualToArray(
|
||||
2, this->id(), target);
|
||||
}
|
||||
|
||||
// repeated .rsctrl.chat.ChatMessage msgs = 3;
|
||||
for (int i = 0; i < this->msgs_size(); i++) {
|
||||
target = ::google::protobuf::internal::WireFormatLite::
|
||||
WriteMessageNoVirtualToArray(
|
||||
3, this->msgs(i), target);
|
||||
}
|
||||
|
||||
if (!unknown_fields().empty()) {
|
||||
target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray(
|
||||
unknown_fields(), target);
|
||||
}
|
||||
return target;
|
||||
}
|
||||
|
||||
int ResponseChatHistory::ByteSize() const {
|
||||
int total_size = 0;
|
||||
|
||||
if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) {
|
||||
// required .rsctrl.core.Status status = 1;
|
||||
if (has_status()) {
|
||||
total_size += 1 +
|
||||
::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual(
|
||||
this->status());
|
||||
}
|
||||
|
||||
// required .rsctrl.chat.ChatId id = 2;
|
||||
if (has_id()) {
|
||||
total_size += 1 +
|
||||
::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual(
|
||||
this->id());
|
||||
}
|
||||
|
||||
}
|
||||
// repeated .rsctrl.chat.ChatMessage msgs = 3;
|
||||
total_size += 1 * this->msgs_size();
|
||||
for (int i = 0; i < this->msgs_size(); i++) {
|
||||
total_size +=
|
||||
::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual(
|
||||
this->msgs(i));
|
||||
}
|
||||
|
||||
if (!unknown_fields().empty()) {
|
||||
total_size +=
|
||||
::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize(
|
||||
unknown_fields());
|
||||
}
|
||||
GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
|
||||
_cached_size_ = total_size;
|
||||
GOOGLE_SAFE_CONCURRENT_WRITES_END();
|
||||
return total_size;
|
||||
}
|
||||
|
||||
void ResponseChatHistory::MergeFrom(const ::google::protobuf::Message& from) {
|
||||
GOOGLE_CHECK_NE(&from, this);
|
||||
const ResponseChatHistory* source =
|
||||
::google::protobuf::internal::dynamic_cast_if_available<const ResponseChatHistory*>(
|
||||
&from);
|
||||
if (source == NULL) {
|
||||
::google::protobuf::internal::ReflectionOps::Merge(from, this);
|
||||
} else {
|
||||
MergeFrom(*source);
|
||||
}
|
||||
}
|
||||
|
||||
void ResponseChatHistory::MergeFrom(const ResponseChatHistory& from) {
|
||||
GOOGLE_CHECK_NE(&from, this);
|
||||
msgs_.MergeFrom(from.msgs_);
|
||||
if (from._has_bits_[0 / 32] & (0xffu << (0 % 32))) {
|
||||
if (from.has_status()) {
|
||||
mutable_status()->::rsctrl::core::Status::MergeFrom(from.status());
|
||||
}
|
||||
if (from.has_id()) {
|
||||
mutable_id()->::rsctrl::chat::ChatId::MergeFrom(from.id());
|
||||
}
|
||||
}
|
||||
mutable_unknown_fields()->MergeFrom(from.unknown_fields());
|
||||
}
|
||||
|
||||
void ResponseChatHistory::CopyFrom(const ::google::protobuf::Message& from) {
|
||||
if (&from == this) return;
|
||||
Clear();
|
||||
MergeFrom(from);
|
||||
}
|
||||
|
||||
void ResponseChatHistory::CopyFrom(const ResponseChatHistory& from) {
|
||||
if (&from == this) return;
|
||||
Clear();
|
||||
MergeFrom(from);
|
||||
}
|
||||
|
||||
bool ResponseChatHistory::IsInitialized() const {
|
||||
if ((_has_bits_[0] & 0x00000003) != 0x00000003) return false;
|
||||
|
||||
if (has_status()) {
|
||||
if (!this->status().IsInitialized()) return false;
|
||||
}
|
||||
if (has_id()) {
|
||||
if (!this->id().IsInitialized()) return false;
|
||||
}
|
||||
for (int i = 0; i < msgs_size(); i++) {
|
||||
if (!this->msgs(i).IsInitialized()) return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
void ResponseChatHistory::Swap(ResponseChatHistory* other) {
|
||||
if (other != this) {
|
||||
std::swap(status_, other->status_);
|
||||
std::swap(id_, other->id_);
|
||||
msgs_.Swap(&other->msgs_);
|
||||
std::swap(_has_bits_[0], other->_has_bits_[0]);
|
||||
_unknown_fields_.Swap(&other->_unknown_fields_);
|
||||
std::swap(_cached_size_, other->_cached_size_);
|
||||
}
|
||||
}
|
||||
|
||||
::google::protobuf::Metadata ResponseChatHistory::GetMetadata() const {
|
||||
protobuf_AssignDescriptorsOnce();
|
||||
::google::protobuf::Metadata metadata;
|
||||
metadata.descriptor = ResponseChatHistory_descriptor_;
|
||||
metadata.reflection = ResponseChatHistory_reflection_;
|
||||
return metadata;
|
||||
}
|
||||
|
||||
|
||||
// @@protoc_insertion_point(namespace_scope)
|
||||
|
||||
} // namespace chat
|
||||
|
@ -49,6 +49,8 @@ class EventLobbyInvite;
|
||||
class EventChatMessage;
|
||||
class RequestSendMessage;
|
||||
class ResponseSendMessage;
|
||||
class RequestChatHistory;
|
||||
class ResponseChatHistory;
|
||||
|
||||
enum ChatLobbyInfo_LobbyState {
|
||||
ChatLobbyInfo_LobbyState_LOBBYSTATE_JOINED = 1,
|
||||
@ -135,11 +137,12 @@ enum RequestMsgIds {
|
||||
MsgId_RequestJoinOrLeaveLobby = 3,
|
||||
MsgId_RequestSetLobbyNickname = 4,
|
||||
MsgId_RequestRegisterEvents = 5,
|
||||
MsgId_RequestSendMessage = 6
|
||||
MsgId_RequestSendMessage = 6,
|
||||
MsgId_RequestChatHistory = 7
|
||||
};
|
||||
bool RequestMsgIds_IsValid(int value);
|
||||
const RequestMsgIds RequestMsgIds_MIN = MsgId_RequestChatLobbies;
|
||||
const RequestMsgIds RequestMsgIds_MAX = MsgId_RequestSendMessage;
|
||||
const RequestMsgIds RequestMsgIds_MAX = MsgId_RequestChatHistory;
|
||||
const int RequestMsgIds_ARRAYSIZE = RequestMsgIds_MAX + 1;
|
||||
|
||||
const ::google::protobuf::EnumDescriptor* RequestMsgIds_descriptor();
|
||||
@ -157,6 +160,7 @@ enum ResponseMsgIds {
|
||||
MsgId_ResponseSetLobbyNickname = 4,
|
||||
MsgId_ResponseRegisterEvents = 5,
|
||||
MsgId_ResponseSendMessage = 6,
|
||||
MsgId_ResponseChatHistory = 7,
|
||||
MsgId_EventLobbyInvite = 101,
|
||||
MsgId_EventChatMessage = 102
|
||||
};
|
||||
@ -1846,6 +1850,196 @@ class ResponseSendMessage : public ::google::protobuf::Message {
|
||||
void InitAsDefaultInstance();
|
||||
static ResponseSendMessage* default_instance_;
|
||||
};
|
||||
// -------------------------------------------------------------------
|
||||
|
||||
class RequestChatHistory : public ::google::protobuf::Message {
|
||||
public:
|
||||
RequestChatHistory();
|
||||
virtual ~RequestChatHistory();
|
||||
|
||||
RequestChatHistory(const RequestChatHistory& from);
|
||||
|
||||
inline RequestChatHistory& operator=(const RequestChatHistory& from) {
|
||||
CopyFrom(from);
|
||||
return *this;
|
||||
}
|
||||
|
||||
inline const ::google::protobuf::UnknownFieldSet& unknown_fields() const {
|
||||
return _unknown_fields_;
|
||||
}
|
||||
|
||||
inline ::google::protobuf::UnknownFieldSet* mutable_unknown_fields() {
|
||||
return &_unknown_fields_;
|
||||
}
|
||||
|
||||
static const ::google::protobuf::Descriptor* descriptor();
|
||||
static const RequestChatHistory& default_instance();
|
||||
|
||||
void Swap(RequestChatHistory* other);
|
||||
|
||||
// implements Message ----------------------------------------------
|
||||
|
||||
RequestChatHistory* New() const;
|
||||
void CopyFrom(const ::google::protobuf::Message& from);
|
||||
void MergeFrom(const ::google::protobuf::Message& from);
|
||||
void CopyFrom(const RequestChatHistory& from);
|
||||
void MergeFrom(const RequestChatHistory& from);
|
||||
void Clear();
|
||||
bool IsInitialized() const;
|
||||
|
||||
int ByteSize() const;
|
||||
bool MergePartialFromCodedStream(
|
||||
::google::protobuf::io::CodedInputStream* input);
|
||||
void SerializeWithCachedSizes(
|
||||
::google::protobuf::io::CodedOutputStream* output) const;
|
||||
::google::protobuf::uint8* SerializeWithCachedSizesToArray(::google::protobuf::uint8* output) const;
|
||||
int GetCachedSize() const { return _cached_size_; }
|
||||
private:
|
||||
void SharedCtor();
|
||||
void SharedDtor();
|
||||
void SetCachedSize(int size) const;
|
||||
public:
|
||||
|
||||
::google::protobuf::Metadata GetMetadata() const;
|
||||
|
||||
// nested types ----------------------------------------------------
|
||||
|
||||
// accessors -------------------------------------------------------
|
||||
|
||||
// required .rsctrl.chat.ChatId id = 1;
|
||||
inline bool has_id() const;
|
||||
inline void clear_id();
|
||||
static const int kIdFieldNumber = 1;
|
||||
inline const ::rsctrl::chat::ChatId& id() const;
|
||||
inline ::rsctrl::chat::ChatId* mutable_id();
|
||||
inline ::rsctrl::chat::ChatId* release_id();
|
||||
|
||||
// @@protoc_insertion_point(class_scope:rsctrl.chat.RequestChatHistory)
|
||||
private:
|
||||
inline void set_has_id();
|
||||
inline void clear_has_id();
|
||||
|
||||
::google::protobuf::UnknownFieldSet _unknown_fields_;
|
||||
|
||||
::rsctrl::chat::ChatId* id_;
|
||||
|
||||
mutable int _cached_size_;
|
||||
::google::protobuf::uint32 _has_bits_[(1 + 31) / 32];
|
||||
|
||||
friend void protobuf_AddDesc_chat_2eproto();
|
||||
friend void protobuf_AssignDesc_chat_2eproto();
|
||||
friend void protobuf_ShutdownFile_chat_2eproto();
|
||||
|
||||
void InitAsDefaultInstance();
|
||||
static RequestChatHistory* default_instance_;
|
||||
};
|
||||
// -------------------------------------------------------------------
|
||||
|
||||
class ResponseChatHistory : public ::google::protobuf::Message {
|
||||
public:
|
||||
ResponseChatHistory();
|
||||
virtual ~ResponseChatHistory();
|
||||
|
||||
ResponseChatHistory(const ResponseChatHistory& from);
|
||||
|
||||
inline ResponseChatHistory& operator=(const ResponseChatHistory& from) {
|
||||
CopyFrom(from);
|
||||
return *this;
|
||||
}
|
||||
|
||||
inline const ::google::protobuf::UnknownFieldSet& unknown_fields() const {
|
||||
return _unknown_fields_;
|
||||
}
|
||||
|
||||
inline ::google::protobuf::UnknownFieldSet* mutable_unknown_fields() {
|
||||
return &_unknown_fields_;
|
||||
}
|
||||
|
||||
static const ::google::protobuf::Descriptor* descriptor();
|
||||
static const ResponseChatHistory& default_instance();
|
||||
|
||||
void Swap(ResponseChatHistory* other);
|
||||
|
||||
// implements Message ----------------------------------------------
|
||||
|
||||
ResponseChatHistory* New() const;
|
||||
void CopyFrom(const ::google::protobuf::Message& from);
|
||||
void MergeFrom(const ::google::protobuf::Message& from);
|
||||
void CopyFrom(const ResponseChatHistory& from);
|
||||
void MergeFrom(const ResponseChatHistory& from);
|
||||
void Clear();
|
||||
bool IsInitialized() const;
|
||||
|
||||
int ByteSize() const;
|
||||
bool MergePartialFromCodedStream(
|
||||
::google::protobuf::io::CodedInputStream* input);
|
||||
void SerializeWithCachedSizes(
|
||||
::google::protobuf::io::CodedOutputStream* output) const;
|
||||
::google::protobuf::uint8* SerializeWithCachedSizesToArray(::google::protobuf::uint8* output) const;
|
||||
int GetCachedSize() const { return _cached_size_; }
|
||||
private:
|
||||
void SharedCtor();
|
||||
void SharedDtor();
|
||||
void SetCachedSize(int size) const;
|
||||
public:
|
||||
|
||||
::google::protobuf::Metadata GetMetadata() const;
|
||||
|
||||
// nested types ----------------------------------------------------
|
||||
|
||||
// accessors -------------------------------------------------------
|
||||
|
||||
// required .rsctrl.core.Status status = 1;
|
||||
inline bool has_status() const;
|
||||
inline void clear_status();
|
||||
static const int kStatusFieldNumber = 1;
|
||||
inline const ::rsctrl::core::Status& status() const;
|
||||
inline ::rsctrl::core::Status* mutable_status();
|
||||
inline ::rsctrl::core::Status* release_status();
|
||||
|
||||
// required .rsctrl.chat.ChatId id = 2;
|
||||
inline bool has_id() const;
|
||||
inline void clear_id();
|
||||
static const int kIdFieldNumber = 2;
|
||||
inline const ::rsctrl::chat::ChatId& id() const;
|
||||
inline ::rsctrl::chat::ChatId* mutable_id();
|
||||
inline ::rsctrl::chat::ChatId* release_id();
|
||||
|
||||
// repeated .rsctrl.chat.ChatMessage msgs = 3;
|
||||
inline int msgs_size() const;
|
||||
inline void clear_msgs();
|
||||
static const int kMsgsFieldNumber = 3;
|
||||
inline const ::rsctrl::chat::ChatMessage& msgs(int index) const;
|
||||
inline ::rsctrl::chat::ChatMessage* mutable_msgs(int index);
|
||||
inline ::rsctrl::chat::ChatMessage* add_msgs();
|
||||
inline const ::google::protobuf::RepeatedPtrField< ::rsctrl::chat::ChatMessage >&
|
||||
msgs() const;
|
||||
inline ::google::protobuf::RepeatedPtrField< ::rsctrl::chat::ChatMessage >*
|
||||
mutable_msgs();
|
||||
|
||||
// @@protoc_insertion_point(class_scope:rsctrl.chat.ResponseChatHistory)
|
||||
private:
|
||||
inline void set_has_status();
|
||||
inline void clear_has_status();
|
||||
inline void set_has_id();
|
||||
inline void clear_has_id();
|
||||
|
||||
::google::protobuf::UnknownFieldSet _unknown_fields_;
|
||||
|
||||
::rsctrl::core::Status* status_;
|
||||
::rsctrl::chat::ChatId* id_;
|
||||
::google::protobuf::RepeatedPtrField< ::rsctrl::chat::ChatMessage > msgs_;
|
||||
|
||||
mutable int _cached_size_;
|
||||
::google::protobuf::uint32 _has_bits_[(3 + 31) / 32];
|
||||
|
||||
friend void protobuf_AddDesc_chat_2eproto();
|
||||
friend void protobuf_AssignDesc_chat_2eproto();
|
||||
friend void protobuf_ShutdownFile_chat_2eproto();
|
||||
|
||||
void InitAsDefaultInstance();
|
||||
static ResponseChatHistory* default_instance_;
|
||||
};
|
||||
// ===================================================================
|
||||
|
||||
|
||||
@ -3273,6 +3467,126 @@ inline ::rsctrl::core::Status* ResponseSendMessage::release_status() {
|
||||
return temp;
|
||||
}
|
||||
|
||||
// -------------------------------------------------------------------
|
||||
|
||||
// RequestChatHistory
|
||||
|
||||
// required .rsctrl.chat.ChatId id = 1;
|
||||
inline bool RequestChatHistory::has_id() const {
|
||||
return (_has_bits_[0] & 0x00000001u) != 0;
|
||||
}
|
||||
inline void RequestChatHistory::set_has_id() {
|
||||
_has_bits_[0] |= 0x00000001u;
|
||||
}
|
||||
inline void RequestChatHistory::clear_has_id() {
|
||||
_has_bits_[0] &= ~0x00000001u;
|
||||
}
|
||||
inline void RequestChatHistory::clear_id() {
|
||||
if (id_ != NULL) id_->::rsctrl::chat::ChatId::Clear();
|
||||
clear_has_id();
|
||||
}
|
||||
inline const ::rsctrl::chat::ChatId& RequestChatHistory::id() const {
|
||||
return id_ != NULL ? *id_ : *default_instance_->id_;
|
||||
}
|
||||
inline ::rsctrl::chat::ChatId* RequestChatHistory::mutable_id() {
|
||||
set_has_id();
|
||||
if (id_ == NULL) id_ = new ::rsctrl::chat::ChatId;
|
||||
return id_;
|
||||
}
|
||||
inline ::rsctrl::chat::ChatId* RequestChatHistory::release_id() {
|
||||
clear_has_id();
|
||||
::rsctrl::chat::ChatId* temp = id_;
|
||||
id_ = NULL;
|
||||
return temp;
|
||||
}
|
||||
|
||||
// -------------------------------------------------------------------
|
||||
|
||||
// ResponseChatHistory
|
||||
|
||||
// required .rsctrl.core.Status status = 1;
|
||||
inline bool ResponseChatHistory::has_status() const {
|
||||
return (_has_bits_[0] & 0x00000001u) != 0;
|
||||
}
|
||||
inline void ResponseChatHistory::set_has_status() {
|
||||
_has_bits_[0] |= 0x00000001u;
|
||||
}
|
||||
inline void ResponseChatHistory::clear_has_status() {
|
||||
_has_bits_[0] &= ~0x00000001u;
|
||||
}
|
||||
inline void ResponseChatHistory::clear_status() {
|
||||
if (status_ != NULL) status_->::rsctrl::core::Status::Clear();
|
||||
clear_has_status();
|
||||
}
|
||||
inline const ::rsctrl::core::Status& ResponseChatHistory::status() const {
|
||||
return status_ != NULL ? *status_ : *default_instance_->status_;
|
||||
}
|
||||
inline ::rsctrl::core::Status* ResponseChatHistory::mutable_status() {
|
||||
set_has_status();
|
||||
if (status_ == NULL) status_ = new ::rsctrl::core::Status;
|
||||
return status_;
|
||||
}
|
||||
inline ::rsctrl::core::Status* ResponseChatHistory::release_status() {
|
||||
clear_has_status();
|
||||
::rsctrl::core::Status* temp = status_;
|
||||
status_ = NULL;
|
||||
return temp;
|
||||
}
|
||||
|
||||
// required .rsctrl.chat.ChatId id = 2;
|
||||
inline bool ResponseChatHistory::has_id() const {
|
||||
return (_has_bits_[0] & 0x00000002u) != 0;
|
||||
}
|
||||
inline void ResponseChatHistory::set_has_id() {
|
||||
_has_bits_[0] |= 0x00000002u;
|
||||
}
|
||||
inline void ResponseChatHistory::clear_has_id() {
|
||||
_has_bits_[0] &= ~0x00000002u;
|
||||
}
|
||||
inline void ResponseChatHistory::clear_id() {
|
||||
if (id_ != NULL) id_->::rsctrl::chat::ChatId::Clear();
|
||||
clear_has_id();
|
||||
}
|
||||
inline const ::rsctrl::chat::ChatId& ResponseChatHistory::id() const {
|
||||
return id_ != NULL ? *id_ : *default_instance_->id_;
|
||||
}
|
||||
inline ::rsctrl::chat::ChatId* ResponseChatHistory::mutable_id() {
|
||||
set_has_id();
|
||||
if (id_ == NULL) id_ = new ::rsctrl::chat::ChatId;
|
||||
return id_;
|
||||
}
|
||||
inline ::rsctrl::chat::ChatId* ResponseChatHistory::release_id() {
|
||||
clear_has_id();
|
||||
::rsctrl::chat::ChatId* temp = id_;
|
||||
id_ = NULL;
|
||||
return temp;
|
||||
}
|
||||
|
||||
// repeated .rsctrl.chat.ChatMessage msgs = 3;
|
||||
inline int ResponseChatHistory::msgs_size() const {
|
||||
return msgs_.size();
|
||||
}
|
||||
inline void ResponseChatHistory::clear_msgs() {
|
||||
msgs_.Clear();
|
||||
}
|
||||
inline const ::rsctrl::chat::ChatMessage& ResponseChatHistory::msgs(int index) const {
|
||||
return msgs_.Get(index);
|
||||
}
|
||||
inline ::rsctrl::chat::ChatMessage* ResponseChatHistory::mutable_msgs(int index) {
|
||||
return msgs_.Mutable(index);
|
||||
}
|
||||
inline ::rsctrl::chat::ChatMessage* ResponseChatHistory::add_msgs() {
|
||||
return msgs_.Add();
|
||||
}
|
||||
inline const ::google::protobuf::RepeatedPtrField< ::rsctrl::chat::ChatMessage >&
|
||||
ResponseChatHistory::msgs() const {
|
||||
return msgs_;
|
||||
}
|
||||
inline ::google::protobuf::RepeatedPtrField< ::rsctrl::chat::ChatMessage >*
|
||||
ResponseChatHistory::mutable_msgs() {
|
||||
return &msgs_;
|
||||
}
|
||||
|
||||
|
||||
// @@protoc_insertion_point(namespace_scope)
|
||||
|
||||
|
@ -292,28 +292,28 @@ void protobuf_AddDesc_core_2eproto() {
|
||||
"rl.core.IpAddr\022$\n\007extaddr\030\004 \002(\0132\023.rsctrl"
|
||||
".core.IpAddr\022\r\n\005state\030\005 \002(\r\"8\n\nStateFlag"
|
||||
"s\022\n\n\006ONLINE\020\001\022\r\n\tCONNECTED\020\002\022\017\n\013UNREACHA"
|
||||
"BLE\020\004\"\340\001\n\006Person\022\016\n\006gpg_id\030\001 \002(\t\022\014\n\004name"
|
||||
"BLE\020\004\"\356\001\n\006Person\022\016\n\006gpg_id\030\001 \002(\t\022\014\n\004name"
|
||||
"\030\002 \002(\t\0222\n\010relation\030\003 \002(\0162 .rsctrl.core.P"
|
||||
"erson.Relationship\022(\n\tlocations\030\004 \003(\0132\025."
|
||||
"rsctrl.core.Location\"Z\n\014Relationship\022\n\n\006"
|
||||
"FRIEND\020\001\022\032\n\026FRIEND_OF_MANY_FRIENDS\020\002\022\025\n\021"
|
||||
"FRIEND_OF_FRIENDS\020\003\022\013\n\007UNKNOWN\020\004\"0\n\004File"
|
||||
"\022\014\n\004name\030\001 \002(\t\022\014\n\004hash\030\002 \002(\t\022\014\n\004size\030\003 \002"
|
||||
"(\004\"f\n\003Dir\022\014\n\004name\030\001 \002(\t\022\014\n\004path\030\002 \002(\t\022!\n"
|
||||
"\007subdirs\030\003 \003(\0132\020.rsctrl.core.Dir\022 \n\005file"
|
||||
"s\030\004 \003(\0132\021.rsctrl.core.File\"\372\001\n\014SystemSta"
|
||||
"tus\0225\n\nnet_status\030\001 \002(\0162!.rsctrl.core.Sy"
|
||||
"stemStatus.NetCode\022\013\n\003msg\030\002 \001(\t\"\245\001\n\007NetC"
|
||||
"ode\022\017\n\013BAD_UNKNOWN\020\000\022\017\n\013BAD_OFFLINE\020\001\022\016\n"
|
||||
"\nBAD_NATSYM\020\002\022\021\n\rBAD_NODHT_NAT\020\003\022\023\n\017WARN"
|
||||
"ING_RESTART\020\004\022\022\n\016WARNING_NATTED\020\005\022\021\n\rWAR"
|
||||
"NING_NODHT\020\006\022\010\n\004GOOD\020\007\022\017\n\013ADV_FORWARD\020\010\""
|
||||
"3\n\tBandwidth\022\n\n\002up\030\001 \002(\002\022\014\n\004down\030\002 \002(\002\022\014"
|
||||
"\n\004name\030\003 \001(\t\":\n\014BandwidthSet\022*\n\nbandwidt"
|
||||
"hs\030\001 \003(\0132\026.rsctrl.core.Bandwidth*\027\n\013Exte"
|
||||
"nsionId\022\010\n\004CORE\020\000*M\n\tPackageId\022\t\n\005PEERS\020"
|
||||
"\001\022\n\n\006SYSTEM\020\002\022\010\n\004CHAT\020\003\022\n\n\006SEARCH\020\004\022\t\n\005F"
|
||||
"ILES\020\005\022\010\n\003GXS\020\350\007", 1296);
|
||||
"rsctrl.core.Location\"h\n\014Relationship\022\014\n\010"
|
||||
"YOURSELF\020\001\022\n\n\006FRIEND\020\002\022\032\n\026FRIEND_OF_MANY"
|
||||
"_FRIENDS\020\003\022\025\n\021FRIEND_OF_FRIENDS\020\004\022\013\n\007UNK"
|
||||
"NOWN\020\005\"0\n\004File\022\014\n\004name\030\001 \002(\t\022\014\n\004hash\030\002 \002"
|
||||
"(\t\022\014\n\004size\030\003 \002(\004\"f\n\003Dir\022\014\n\004name\030\001 \002(\t\022\014\n"
|
||||
"\004path\030\002 \002(\t\022!\n\007subdirs\030\003 \003(\0132\020.rsctrl.co"
|
||||
"re.Dir\022 \n\005files\030\004 \003(\0132\021.rsctrl.core.File"
|
||||
"\"\372\001\n\014SystemStatus\0225\n\nnet_status\030\001 \002(\0162!."
|
||||
"rsctrl.core.SystemStatus.NetCode\022\013\n\003msg\030"
|
||||
"\002 \001(\t\"\245\001\n\007NetCode\022\017\n\013BAD_UNKNOWN\020\000\022\017\n\013BA"
|
||||
"D_OFFLINE\020\001\022\016\n\nBAD_NATSYM\020\002\022\021\n\rBAD_NODHT"
|
||||
"_NAT\020\003\022\023\n\017WARNING_RESTART\020\004\022\022\n\016WARNING_N"
|
||||
"ATTED\020\005\022\021\n\rWARNING_NODHT\020\006\022\010\n\004GOOD\020\007\022\017\n\013"
|
||||
"ADV_FORWARD\020\010\"3\n\tBandwidth\022\n\n\002up\030\001 \002(\002\022\014"
|
||||
"\n\004down\030\002 \002(\002\022\014\n\004name\030\003 \001(\t\":\n\014BandwidthS"
|
||||
"et\022*\n\nbandwidths\030\001 \003(\0132\026.rsctrl.core.Ban"
|
||||
"dwidth*\027\n\013ExtensionId\022\010\n\004CORE\020\000*M\n\tPacka"
|
||||
"geId\022\t\n\005PEERS\020\001\022\n\n\006SYSTEM\020\002\022\010\n\004CHAT\020\003\022\n\n"
|
||||
"\006SEARCH\020\004\022\t\n\005FILES\020\005\022\010\n\003GXS\020\350\007", 1310);
|
||||
::google::protobuf::MessageFactory::InternalRegisterGeneratedFile(
|
||||
"core.proto", &protobuf_RegisterTypes);
|
||||
Status::default_instance_ = new Status();
|
||||
@ -1394,6 +1394,7 @@ bool Person_Relationship_IsValid(int value) {
|
||||
case 2:
|
||||
case 3:
|
||||
case 4:
|
||||
case 5:
|
||||
return true;
|
||||
default:
|
||||
return false;
|
||||
@ -1401,6 +1402,7 @@ bool Person_Relationship_IsValid(int value) {
|
||||
}
|
||||
|
||||
#ifndef _MSC_VER
|
||||
const Person_Relationship Person::YOURSELF;
|
||||
const Person_Relationship Person::FRIEND;
|
||||
const Person_Relationship Person::FRIEND_OF_MANY_FRIENDS;
|
||||
const Person_Relationship Person::FRIEND_OF_FRIENDS;
|
||||
|
@ -87,13 +87,14 @@ inline bool Location_StateFlags_Parse(
|
||||
Location_StateFlags_descriptor(), name, value);
|
||||
}
|
||||
enum Person_Relationship {
|
||||
Person_Relationship_FRIEND = 1,
|
||||
Person_Relationship_FRIEND_OF_MANY_FRIENDS = 2,
|
||||
Person_Relationship_FRIEND_OF_FRIENDS = 3,
|
||||
Person_Relationship_UNKNOWN = 4
|
||||
Person_Relationship_YOURSELF = 1,
|
||||
Person_Relationship_FRIEND = 2,
|
||||
Person_Relationship_FRIEND_OF_MANY_FRIENDS = 3,
|
||||
Person_Relationship_FRIEND_OF_FRIENDS = 4,
|
||||
Person_Relationship_UNKNOWN = 5
|
||||
};
|
||||
bool Person_Relationship_IsValid(int value);
|
||||
const Person_Relationship Person_Relationship_Relationship_MIN = Person_Relationship_FRIEND;
|
||||
const Person_Relationship Person_Relationship_Relationship_MIN = Person_Relationship_YOURSELF;
|
||||
const Person_Relationship Person_Relationship_Relationship_MAX = Person_Relationship_UNKNOWN;
|
||||
const int Person_Relationship_Relationship_ARRAYSIZE = Person_Relationship_Relationship_MAX + 1;
|
||||
|
||||
@ -606,6 +607,7 @@ class Person : public ::google::protobuf::Message {
|
||||
// nested types ----------------------------------------------------
|
||||
|
||||
typedef Person_Relationship Relationship;
|
||||
static const Relationship YOURSELF = Person_Relationship_YOURSELF;
|
||||
static const Relationship FRIEND = Person_Relationship_FRIEND;
|
||||
static const Relationship FRIEND_OF_MANY_FRIENDS = Person_Relationship_FRIEND_OF_MANY_FRIENDS;
|
||||
static const Relationship FRIEND_OF_FRIENDS = Person_Relationship_FRIEND_OF_FRIENDS;
|
||||
|
@ -59,10 +59,11 @@ void protobuf_AssignDesc_search_2eproto() {
|
||||
"search.proto");
|
||||
GOOGLE_CHECK(file != NULL);
|
||||
SearchHit_descriptor_ = file->message_type(0);
|
||||
static const int SearchHit_offsets_[3] = {
|
||||
static const int SearchHit_offsets_[4] = {
|
||||
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(SearchHit, file_),
|
||||
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(SearchHit, loc_),
|
||||
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(SearchHit, no_hits_),
|
||||
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(SearchHit, alt_names_),
|
||||
};
|
||||
SearchHit_reflection_ =
|
||||
new ::google::protobuf::internal::GeneratedMessageReflection(
|
||||
@ -168,7 +169,8 @@ void protobuf_AssignDesc_search_2eproto() {
|
||||
::google::protobuf::MessageFactory::generated_factory(),
|
||||
sizeof(RequestListSearches));
|
||||
RequestSearchResults_descriptor_ = file->message_type(7);
|
||||
static const int RequestSearchResults_offsets_[1] = {
|
||||
static const int RequestSearchResults_offsets_[2] = {
|
||||
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(RequestSearchResults, result_limit_),
|
||||
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(RequestSearchResults, search_ids_),
|
||||
};
|
||||
RequestSearchResults_reflection_ =
|
||||
@ -264,26 +266,27 @@ void protobuf_AddDesc_search_2eproto() {
|
||||
::rsctrl::core::protobuf_AddDesc_core_2eproto();
|
||||
::google::protobuf::DescriptorPool::InternalAddGeneratedFile(
|
||||
"\n\014search.proto\022\rrsctrl.search\032\ncore.prot"
|
||||
"o\"y\n\tSearchHit\022\037\n\004file\030\001 \002(\0132\021.rsctrl.co"
|
||||
"re.File\022\013\n\003loc\030\002 \002(\r\022\017\n\007no_hits\030\003 \002(\r\"-\n"
|
||||
"\007LocFlag\022\t\n\005LOCAL\020\001\022\n\n\006FRIEND\020\002\022\013\n\007NETWO"
|
||||
"RK\020\004\"F\n\tSearchSet\022\021\n\tsearch_id\030\001 \002(\r\022&\n\004"
|
||||
"hits\030\002 \003(\0132\030.rsctrl.search.SearchHit\"#\n\022"
|
||||
"RequestBasicSearch\022\r\n\005terms\030\001 \003(\t\"!\n\020Req"
|
||||
"uestAdvSearch\022\r\n\005terms\030\001 \003(\t\"K\n\021Response"
|
||||
"SearchIds\022#\n\006status\030\001 \002(\0132\023.rsctrl.core."
|
||||
"Status\022\021\n\tsearch_id\030\002 \003(\r\"\'\n\022RequestClos"
|
||||
"eSearch\022\021\n\tsearch_id\030\001 \002(\r\"\025\n\023RequestLis"
|
||||
"tSearches\"*\n\024RequestSearchResults\022\022\n\nsea"
|
||||
"rch_ids\030\002 \003(\r\"h\n\025ResponseSearchResults\022#"
|
||||
"\n\006status\030\001 \002(\0132\023.rsctrl.core.Status\022*\n\010s"
|
||||
"earches\030\002 \003(\0132\030.rsctrl.search.SearchSet*"
|
||||
"\212\001\n\rRequestMsgIds\022\034\n\030MsgId_RequestBasicS"
|
||||
"earch\020\001\022\034\n\030MsgId_RequestCloseSearch\020\003\022\035\n"
|
||||
"\031MsgId_RequestListSearches\020\004\022\036\n\032MsgId_Re"
|
||||
"questSearchResults\020\005*N\n\016ResponseMsgIds\022\033"
|
||||
"\n\027MsgId_ResponseSearchIds\020\001\022\037\n\033MsgId_Res"
|
||||
"ponseSearchResults\020\005", 820);
|
||||
"o\"\214\001\n\tSearchHit\022\037\n\004file\030\001 \002(\0132\021.rsctrl.c"
|
||||
"ore.File\022\013\n\003loc\030\002 \002(\r\022\017\n\007no_hits\030\003 \002(\r\022\021"
|
||||
"\n\talt_names\030\004 \003(\t\"-\n\007LocFlag\022\t\n\005LOCAL\020\001\022"
|
||||
"\n\n\006FRIEND\020\002\022\013\n\007NETWORK\020\004\"F\n\tSearchSet\022\021\n"
|
||||
"\tsearch_id\030\001 \002(\r\022&\n\004hits\030\002 \003(\0132\030.rsctrl."
|
||||
"search.SearchHit\"#\n\022RequestBasicSearch\022\r"
|
||||
"\n\005terms\030\001 \003(\t\"!\n\020RequestAdvSearch\022\r\n\005ter"
|
||||
"ms\030\001 \003(\t\"K\n\021ResponseSearchIds\022#\n\006status\030"
|
||||
"\001 \002(\0132\023.rsctrl.core.Status\022\021\n\tsearch_id\030"
|
||||
"\002 \003(\r\"\'\n\022RequestCloseSearch\022\021\n\tsearch_id"
|
||||
"\030\001 \002(\r\"\025\n\023RequestListSearches\"@\n\024Request"
|
||||
"SearchResults\022\024\n\014result_limit\030\001 \001(\r\022\022\n\ns"
|
||||
"earch_ids\030\002 \003(\r\"h\n\025ResponseSearchResults"
|
||||
"\022#\n\006status\030\001 \002(\0132\023.rsctrl.core.Status\022*\n"
|
||||
"\010searches\030\002 \003(\0132\030.rsctrl.search.SearchSe"
|
||||
"t*\212\001\n\rRequestMsgIds\022\034\n\030MsgId_RequestBasi"
|
||||
"cSearch\020\001\022\034\n\030MsgId_RequestCloseSearch\020\003\022"
|
||||
"\035\n\031MsgId_RequestListSearches\020\004\022\036\n\032MsgId_"
|
||||
"RequestSearchResults\020\005*N\n\016ResponseMsgIds"
|
||||
"\022\033\n\027MsgId_ResponseSearchIds\020\001\022\037\n\033MsgId_R"
|
||||
"esponseSearchResults\020\005", 862);
|
||||
::google::protobuf::MessageFactory::InternalRegisterGeneratedFile(
|
||||
"search.proto", &protobuf_RegisterTypes);
|
||||
SearchHit::default_instance_ = new SearchHit();
|
||||
@ -374,6 +377,7 @@ const int SearchHit::LocFlag_ARRAYSIZE;
|
||||
const int SearchHit::kFileFieldNumber;
|
||||
const int SearchHit::kLocFieldNumber;
|
||||
const int SearchHit::kNoHitsFieldNumber;
|
||||
const int SearchHit::kAltNamesFieldNumber;
|
||||
#endif // !_MSC_VER
|
||||
|
||||
SearchHit::SearchHit()
|
||||
@ -437,6 +441,7 @@ void SearchHit::Clear() {
|
||||
loc_ = 0u;
|
||||
no_hits_ = 0u;
|
||||
}
|
||||
alt_names_.Clear();
|
||||
::memset(_has_bits_, 0, sizeof(_has_bits_));
|
||||
mutable_unknown_fields()->Clear();
|
||||
}
|
||||
@ -488,6 +493,24 @@ bool SearchHit::MergePartialFromCodedStream(
|
||||
} else {
|
||||
goto handle_uninterpreted;
|
||||
}
|
||||
if (input->ExpectTag(34)) goto parse_alt_names;
|
||||
break;
|
||||
}
|
||||
|
||||
// repeated string alt_names = 4;
|
||||
case 4: {
|
||||
if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
|
||||
::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED) {
|
||||
parse_alt_names:
|
||||
DO_(::google::protobuf::internal::WireFormatLite::ReadString(
|
||||
input, this->add_alt_names()));
|
||||
::google::protobuf::internal::WireFormat::VerifyUTF8String(
|
||||
this->alt_names(0).data(), this->alt_names(0).length(),
|
||||
::google::protobuf::internal::WireFormat::PARSE);
|
||||
} else {
|
||||
goto handle_uninterpreted;
|
||||
}
|
||||
if (input->ExpectTag(34)) goto parse_alt_names;
|
||||
if (input->ExpectAtEnd()) return true;
|
||||
break;
|
||||
}
|
||||
@ -526,6 +549,15 @@ void SearchHit::SerializeWithCachedSizes(
|
||||
::google::protobuf::internal::WireFormatLite::WriteUInt32(3, this->no_hits(), output);
|
||||
}
|
||||
|
||||
// repeated string alt_names = 4;
|
||||
for (int i = 0; i < this->alt_names_size(); i++) {
|
||||
::google::protobuf::internal::WireFormat::VerifyUTF8String(
|
||||
this->alt_names(i).data(), this->alt_names(i).length(),
|
||||
::google::protobuf::internal::WireFormat::SERIALIZE);
|
||||
::google::protobuf::internal::WireFormatLite::WriteString(
|
||||
4, this->alt_names(i), output);
|
||||
}
|
||||
|
||||
if (!unknown_fields().empty()) {
|
||||
::google::protobuf::internal::WireFormat::SerializeUnknownFields(
|
||||
unknown_fields(), output);
|
||||
@ -551,6 +583,15 @@ void SearchHit::SerializeWithCachedSizes(
|
||||
target = ::google::protobuf::internal::WireFormatLite::WriteUInt32ToArray(3, this->no_hits(), target);
|
||||
}
|
||||
|
||||
// repeated string alt_names = 4;
|
||||
for (int i = 0; i < this->alt_names_size(); i++) {
|
||||
::google::protobuf::internal::WireFormat::VerifyUTF8String(
|
||||
this->alt_names(i).data(), this->alt_names(i).length(),
|
||||
::google::protobuf::internal::WireFormat::SERIALIZE);
|
||||
target = ::google::protobuf::internal::WireFormatLite::
|
||||
WriteStringToArray(4, this->alt_names(i), target);
|
||||
}
|
||||
|
||||
if (!unknown_fields().empty()) {
|
||||
target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray(
|
||||
unknown_fields(), target);
|
||||
@ -584,6 +625,13 @@ int SearchHit::ByteSize() const {
|
||||
}
|
||||
|
||||
}
|
||||
// repeated string alt_names = 4;
|
||||
total_size += 1 * this->alt_names_size();
|
||||
for (int i = 0; i < this->alt_names_size(); i++) {
|
||||
total_size += ::google::protobuf::internal::WireFormatLite::StringSize(
|
||||
this->alt_names(i));
|
||||
}
|
||||
|
||||
if (!unknown_fields().empty()) {
|
||||
total_size +=
|
||||
::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize(
|
||||
@ -609,6 +657,7 @@ void SearchHit::MergeFrom(const ::google::protobuf::Message& from) {
|
||||
|
||||
void SearchHit::MergeFrom(const SearchHit& from) {
|
||||
GOOGLE_CHECK_NE(&from, this);
|
||||
alt_names_.MergeFrom(from.alt_names_);
|
||||
if (from._has_bits_[0 / 32] & (0xffu << (0 % 32))) {
|
||||
if (from.has_file()) {
|
||||
mutable_file()->::rsctrl::core::File::MergeFrom(from.file());
|
||||
@ -649,6 +698,7 @@ void SearchHit::Swap(SearchHit* other) {
|
||||
std::swap(file_, other->file_);
|
||||
std::swap(loc_, other->loc_);
|
||||
std::swap(no_hits_, other->no_hits_);
|
||||
alt_names_.Swap(&other->alt_names_);
|
||||
std::swap(_has_bits_[0], other->_has_bits_[0]);
|
||||
_unknown_fields_.Swap(&other->_unknown_fields_);
|
||||
std::swap(_cached_size_, other->_cached_size_);
|
||||
@ -1963,6 +2013,7 @@ void RequestListSearches::Swap(RequestListSearches* other) {
|
||||
// ===================================================================
|
||||
|
||||
#ifndef _MSC_VER
|
||||
const int RequestSearchResults::kResultLimitFieldNumber;
|
||||
const int RequestSearchResults::kSearchIdsFieldNumber;
|
||||
#endif // !_MSC_VER
|
||||
|
||||
@ -1982,6 +2033,7 @@ RequestSearchResults::RequestSearchResults(const RequestSearchResults& from)
|
||||
|
||||
void RequestSearchResults::SharedCtor() {
|
||||
_cached_size_ = 0;
|
||||
result_limit_ = 0u;
|
||||
::memset(_has_bits_, 0, sizeof(_has_bits_));
|
||||
}
|
||||
|
||||
@ -2015,6 +2067,9 @@ RequestSearchResults* RequestSearchResults::New() const {
|
||||
}
|
||||
|
||||
void RequestSearchResults::Clear() {
|
||||
if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) {
|
||||
result_limit_ = 0u;
|
||||
}
|
||||
search_ids_.Clear();
|
||||
::memset(_has_bits_, 0, sizeof(_has_bits_));
|
||||
mutable_unknown_fields()->Clear();
|
||||
@ -2026,6 +2081,21 @@ bool RequestSearchResults::MergePartialFromCodedStream(
|
||||
::google::protobuf::uint32 tag;
|
||||
while ((tag = input->ReadTag()) != 0) {
|
||||
switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) {
|
||||
// optional uint32 result_limit = 1;
|
||||
case 1: {
|
||||
if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
|
||||
::google::protobuf::internal::WireFormatLite::WIRETYPE_VARINT) {
|
||||
DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
|
||||
::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>(
|
||||
input, &result_limit_)));
|
||||
set_has_result_limit();
|
||||
} else {
|
||||
goto handle_uninterpreted;
|
||||
}
|
||||
if (input->ExpectTag(16)) goto parse_search_ids;
|
||||
break;
|
||||
}
|
||||
|
||||
// repeated uint32 search_ids = 2;
|
||||
case 2: {
|
||||
if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
|
||||
@ -2066,6 +2136,11 @@ bool RequestSearchResults::MergePartialFromCodedStream(
|
||||
|
||||
void RequestSearchResults::SerializeWithCachedSizes(
|
||||
::google::protobuf::io::CodedOutputStream* output) const {
|
||||
// optional uint32 result_limit = 1;
|
||||
if (has_result_limit()) {
|
||||
::google::protobuf::internal::WireFormatLite::WriteUInt32(1, this->result_limit(), output);
|
||||
}
|
||||
|
||||
// repeated uint32 search_ids = 2;
|
||||
for (int i = 0; i < this->search_ids_size(); i++) {
|
||||
::google::protobuf::internal::WireFormatLite::WriteUInt32(
|
||||
@ -2080,6 +2155,11 @@ void RequestSearchResults::SerializeWithCachedSizes(
|
||||
|
||||
::google::protobuf::uint8* RequestSearchResults::SerializeWithCachedSizesToArray(
|
||||
::google::protobuf::uint8* target) const {
|
||||
// optional uint32 result_limit = 1;
|
||||
if (has_result_limit()) {
|
||||
target = ::google::protobuf::internal::WireFormatLite::WriteUInt32ToArray(1, this->result_limit(), target);
|
||||
}
|
||||
|
||||
// repeated uint32 search_ids = 2;
|
||||
for (int i = 0; i < this->search_ids_size(); i++) {
|
||||
target = ::google::protobuf::internal::WireFormatLite::
|
||||
@ -2096,6 +2176,15 @@ void RequestSearchResults::SerializeWithCachedSizes(
|
||||
int RequestSearchResults::ByteSize() const {
|
||||
int total_size = 0;
|
||||
|
||||
if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) {
|
||||
// optional uint32 result_limit = 1;
|
||||
if (has_result_limit()) {
|
||||
total_size += 1 +
|
||||
::google::protobuf::internal::WireFormatLite::UInt32Size(
|
||||
this->result_limit());
|
||||
}
|
||||
|
||||
}
|
||||
// repeated uint32 search_ids = 2;
|
||||
{
|
||||
int data_size = 0;
|
||||
@ -2132,6 +2221,11 @@ void RequestSearchResults::MergeFrom(const ::google::protobuf::Message& from) {
|
||||
void RequestSearchResults::MergeFrom(const RequestSearchResults& from) {
|
||||
GOOGLE_CHECK_NE(&from, this);
|
||||
search_ids_.MergeFrom(from.search_ids_);
|
||||
if (from._has_bits_[0 / 32] & (0xffu << (0 % 32))) {
|
||||
if (from.has_result_limit()) {
|
||||
set_result_limit(from.result_limit());
|
||||
}
|
||||
}
|
||||
mutable_unknown_fields()->MergeFrom(from.unknown_fields());
|
||||
}
|
||||
|
||||
@ -2154,6 +2248,7 @@ bool RequestSearchResults::IsInitialized() const {
|
||||
|
||||
void RequestSearchResults::Swap(RequestSearchResults* other) {
|
||||
if (other != this) {
|
||||
std::swap(result_limit_, other->result_limit_);
|
||||
search_ids_.Swap(&other->search_ids_);
|
||||
std::swap(_has_bits_[0], other->_has_bits_[0]);
|
||||
_unknown_fields_.Swap(&other->_unknown_fields_);
|
||||
|
@ -207,6 +207,22 @@ class SearchHit : public ::google::protobuf::Message {
|
||||
inline ::google::protobuf::uint32 no_hits() const;
|
||||
inline void set_no_hits(::google::protobuf::uint32 value);
|
||||
|
||||
// repeated string alt_names = 4;
|
||||
inline int alt_names_size() const;
|
||||
inline void clear_alt_names();
|
||||
static const int kAltNamesFieldNumber = 4;
|
||||
inline const ::std::string& alt_names(int index) const;
|
||||
inline ::std::string* mutable_alt_names(int index);
|
||||
inline void set_alt_names(int index, const ::std::string& value);
|
||||
inline void set_alt_names(int index, const char* value);
|
||||
inline void set_alt_names(int index, const char* value, size_t size);
|
||||
inline ::std::string* add_alt_names();
|
||||
inline void add_alt_names(const ::std::string& value);
|
||||
inline void add_alt_names(const char* value);
|
||||
inline void add_alt_names(const char* value, size_t size);
|
||||
inline const ::google::protobuf::RepeatedPtrField< ::std::string>& alt_names() const;
|
||||
inline ::google::protobuf::RepeatedPtrField< ::std::string>* mutable_alt_names();
|
||||
|
||||
// @@protoc_insertion_point(class_scope:rsctrl.search.SearchHit)
|
||||
private:
|
||||
inline void set_has_file();
|
||||
@ -221,9 +237,10 @@ class SearchHit : public ::google::protobuf::Message {
|
||||
::rsctrl::core::File* file_;
|
||||
::google::protobuf::uint32 loc_;
|
||||
::google::protobuf::uint32 no_hits_;
|
||||
::google::protobuf::RepeatedPtrField< ::std::string> alt_names_;
|
||||
|
||||
mutable int _cached_size_;
|
||||
::google::protobuf::uint32 _has_bits_[(3 + 31) / 32];
|
||||
::google::protobuf::uint32 _has_bits_[(4 + 31) / 32];
|
||||
|
||||
friend void protobuf_AddDesc_search_2eproto();
|
||||
friend void protobuf_AssignDesc_search_2eproto();
|
||||
@ -811,6 +828,13 @@ class RequestSearchResults : public ::google::protobuf::Message {
|
||||
|
||||
// accessors -------------------------------------------------------
|
||||
|
||||
// optional uint32 result_limit = 1;
|
||||
inline bool has_result_limit() const;
|
||||
inline void clear_result_limit();
|
||||
static const int kResultLimitFieldNumber = 1;
|
||||
inline ::google::protobuf::uint32 result_limit() const;
|
||||
inline void set_result_limit(::google::protobuf::uint32 value);
|
||||
|
||||
// repeated uint32 search_ids = 2;
|
||||
inline int search_ids_size() const;
|
||||
inline void clear_search_ids();
|
||||
@ -825,13 +849,16 @@ class RequestSearchResults : public ::google::protobuf::Message {
|
||||
|
||||
// @@protoc_insertion_point(class_scope:rsctrl.search.RequestSearchResults)
|
||||
private:
|
||||
inline void set_has_result_limit();
|
||||
inline void clear_has_result_limit();
|
||||
|
||||
::google::protobuf::UnknownFieldSet _unknown_fields_;
|
||||
|
||||
::google::protobuf::RepeatedField< ::google::protobuf::uint32 > search_ids_;
|
||||
::google::protobuf::uint32 result_limit_;
|
||||
|
||||
mutable int _cached_size_;
|
||||
::google::protobuf::uint32 _has_bits_[(1 + 31) / 32];
|
||||
::google::protobuf::uint32 _has_bits_[(2 + 31) / 32];
|
||||
|
||||
friend void protobuf_AddDesc_search_2eproto();
|
||||
friend void protobuf_AssignDesc_search_2eproto();
|
||||
@ -1016,6 +1043,50 @@ inline void SearchHit::set_no_hits(::google::protobuf::uint32 value) {
|
||||
no_hits_ = value;
|
||||
}
|
||||
|
||||
// repeated string alt_names = 4;
|
||||
inline int SearchHit::alt_names_size() const {
|
||||
return alt_names_.size();
|
||||
}
|
||||
inline void SearchHit::clear_alt_names() {
|
||||
alt_names_.Clear();
|
||||
}
|
||||
inline const ::std::string& SearchHit::alt_names(int index) const {
|
||||
return alt_names_.Get(index);
|
||||
}
|
||||
inline ::std::string* SearchHit::mutable_alt_names(int index) {
|
||||
return alt_names_.Mutable(index);
|
||||
}
|
||||
inline void SearchHit::set_alt_names(int index, const ::std::string& value) {
|
||||
alt_names_.Mutable(index)->assign(value);
|
||||
}
|
||||
inline void SearchHit::set_alt_names(int index, const char* value) {
|
||||
alt_names_.Mutable(index)->assign(value);
|
||||
}
|
||||
inline void SearchHit::set_alt_names(int index, const char* value, size_t size) {
|
||||
alt_names_.Mutable(index)->assign(
|
||||
reinterpret_cast<const char*>(value), size);
|
||||
}
|
||||
inline ::std::string* SearchHit::add_alt_names() {
|
||||
return alt_names_.Add();
|
||||
}
|
||||
inline void SearchHit::add_alt_names(const ::std::string& value) {
|
||||
alt_names_.Add()->assign(value);
|
||||
}
|
||||
inline void SearchHit::add_alt_names(const char* value) {
|
||||
alt_names_.Add()->assign(value);
|
||||
}
|
||||
inline void SearchHit::add_alt_names(const char* value, size_t size) {
|
||||
alt_names_.Add()->assign(reinterpret_cast<const char*>(value), size);
|
||||
}
|
||||
inline const ::google::protobuf::RepeatedPtrField< ::std::string>&
|
||||
SearchHit::alt_names() const {
|
||||
return alt_names_;
|
||||
}
|
||||
inline ::google::protobuf::RepeatedPtrField< ::std::string>*
|
||||
SearchHit::mutable_alt_names() {
|
||||
return &alt_names_;
|
||||
}
|
||||
|
||||
// -------------------------------------------------------------------
|
||||
|
||||
// SearchSet
|
||||
@ -1255,6 +1326,28 @@ inline void RequestCloseSearch::set_search_id(::google::protobuf::uint32 value)
|
||||
|
||||
// RequestSearchResults
|
||||
|
||||
// optional uint32 result_limit = 1;
|
||||
inline bool RequestSearchResults::has_result_limit() const {
|
||||
return (_has_bits_[0] & 0x00000001u) != 0;
|
||||
}
|
||||
inline void RequestSearchResults::set_has_result_limit() {
|
||||
_has_bits_[0] |= 0x00000001u;
|
||||
}
|
||||
inline void RequestSearchResults::clear_has_result_limit() {
|
||||
_has_bits_[0] &= ~0x00000001u;
|
||||
}
|
||||
inline void RequestSearchResults::clear_result_limit() {
|
||||
result_limit_ = 0u;
|
||||
clear_has_result_limit();
|
||||
}
|
||||
inline ::google::protobuf::uint32 RequestSearchResults::result_limit() const {
|
||||
return result_limit_;
|
||||
}
|
||||
inline void RequestSearchResults::set_result_limit(::google::protobuf::uint32 value) {
|
||||
set_has_result_limit();
|
||||
result_limit_ = value;
|
||||
}
|
||||
|
||||
// repeated uint32 search_ids = 2;
|
||||
inline int RequestSearchResults::search_ids_size() const {
|
||||
return search_ids_.size();
|
||||
|
@ -26,6 +26,7 @@
|
||||
|
||||
#include <retroshare/rsmsgs.h>
|
||||
#include <retroshare/rspeers.h>
|
||||
#include <retroshare/rshistory.h>
|
||||
|
||||
#include "util/rsstring.h"
|
||||
|
||||
@ -48,6 +49,8 @@ bool fillLobbyInfoFromChatLobbyInfo(const ChatLobbyInfo &cfi, rsctrl::chat::Chat
|
||||
bool fillLobbyInfoFromVisibleChatLobbyRecord(const VisibleChatLobbyRecord &pclr, rsctrl::chat::ChatLobbyInfo *lobby);
|
||||
bool fillLobbyInfoFromChatLobbyInvite(const ChatLobbyInvite &cli, rsctrl::chat::ChatLobbyInfo *lobby);
|
||||
|
||||
bool fillChatMessageFromHistoryMsg(const HistoryMsg &histmsg, rsctrl::chat::ChatMessage *rpcmsg);
|
||||
|
||||
bool createQueuedEventSendMsg(const ChatInfo &chatinfo, rsctrl::chat::ChatType ctype,
|
||||
std::string chat_id, const RpcEventRegister &ereg, RpcQueuedMsg &qmsg);
|
||||
|
||||
@ -127,6 +130,10 @@ int RpcProtoChat::processMsg(uint32_t chan_id, uint32_t msg_id, uint32_t req_id,
|
||||
processReqSendMessage(chan_id, msg_id, req_id, msg);
|
||||
break;
|
||||
|
||||
case rsctrl::chat::MsgId_RequestChatHistory:
|
||||
processReqChatHistory(chan_id, msg_id, req_id, msg);
|
||||
break;
|
||||
|
||||
|
||||
default:
|
||||
std::cerr << "RpcProtoChat::processMsg() ERROR should never get here";
|
||||
@ -349,7 +356,7 @@ int RpcProtoChat::processReqCreateLobby(uint32_t chan_id, uint32_t /*msg_id*/, u
|
||||
std::string lobby_name = req.lobby_name();
|
||||
std::string lobby_topic = req.lobby_topic();
|
||||
std::list<std::string> invited_friends;
|
||||
uint32_t lobby_privacy_type;
|
||||
uint32_t lobby_privacy_type = 0;
|
||||
|
||||
switch(req.privacy_level())
|
||||
{
|
||||
@ -806,6 +813,172 @@ int RpcProtoChat::processReqRegisterEvents(uint32_t chan_id, uint32_t /*msg_id*/
|
||||
|
||||
|
||||
|
||||
|
||||
int RpcProtoChat::processReqChatHistory(uint32_t chan_id, uint32_t /*msg_id*/, uint32_t req_id, const std::string &msg)
|
||||
{
|
||||
std::cerr << "RpcProtoChat::processReqChatHistory()";
|
||||
std::cerr << std::endl;
|
||||
|
||||
// parse msg.
|
||||
rsctrl::chat::RequestChatHistory req;
|
||||
if (!req.ParseFromString(msg))
|
||||
{
|
||||
std::cerr << "RpcProtoChat::processReqChatHistory() ERROR ParseFromString()";
|
||||
std::cerr << std::endl;
|
||||
return 0;
|
||||
}
|
||||
|
||||
// response.
|
||||
rsctrl::chat::ResponseChatHistory resp;
|
||||
bool success = true;
|
||||
std::string errorMsg;
|
||||
|
||||
// Get the Chat History for specified IDs....
|
||||
|
||||
/* switch depending on type */
|
||||
bool private_chat = false;
|
||||
bool lobby_chat = false;
|
||||
std::string chat_id;
|
||||
|
||||
// copy the ID over.
|
||||
rsctrl::chat::ChatId *id = resp.mutable_id();
|
||||
*id = req.id();
|
||||
|
||||
switch(req.id().chat_type())
|
||||
{
|
||||
case rsctrl::chat::TYPE_PRIVATE:
|
||||
{
|
||||
// easy one.
|
||||
chat_id = req.id().chat_id();
|
||||
private_chat = true;
|
||||
|
||||
std::cerr << "RpcProtoChat::processReqChatHistory() Getting Private Chat History for: ";
|
||||
std::cerr << chat_id;
|
||||
std::cerr << std::endl;
|
||||
|
||||
break;
|
||||
}
|
||||
case rsctrl::chat::TYPE_LOBBY:
|
||||
{
|
||||
std::cerr << "RpcProtoChat::processReqChatHistory() Lobby Chat History NOT IMPLEMENTED YET";
|
||||
std::cerr << std::endl;
|
||||
success = false;
|
||||
lobby_chat = true;
|
||||
errorMsg = "Lobby Chat History Not Implemented";
|
||||
|
||||
#if 0
|
||||
/* convert string->ChatLobbyId */
|
||||
ChatLobbyId lobby_id;
|
||||
if (!convertStringToLobbyId(req.msg().id().chat_id(), lobby_id))
|
||||
{
|
||||
std::cerr << "ERROR Failed conversion of Lobby Id";
|
||||
std::cerr << std::endl;
|
||||
|
||||
success = false;
|
||||
errorMsg = "Failed Conversion of Lobby Id";
|
||||
}
|
||||
/* convert lobby id to virtual peer id */
|
||||
else if (!rsMsgs->getVirtualPeerId(lobby_id, chat_id))
|
||||
{
|
||||
std::cerr << "ERROR Invalid Lobby Id";
|
||||
std::cerr << std::endl;
|
||||
|
||||
success = false;
|
||||
errorMsg = "Invalid Lobby Id";
|
||||
}
|
||||
lobby_chat = true;
|
||||
std::cerr << "RpcProtoChat::processReqChatHistory() Getting Lobby Chat History for: ";
|
||||
std::cerr << chat_id;
|
||||
std::cerr << std::endl;
|
||||
#endif
|
||||
|
||||
break;
|
||||
}
|
||||
case rsctrl::chat::TYPE_GROUP:
|
||||
|
||||
std::cerr << "RpcProtoChat::processReqChatHistory() Group Chat History NOT IMPLEMENTED YET";
|
||||
std::cerr << std::endl;
|
||||
success = false;
|
||||
errorMsg = "Group Chat History Not Implemented";
|
||||
|
||||
break;
|
||||
default:
|
||||
|
||||
std::cerr << "ERROR Chat Type invalid";
|
||||
std::cerr << std::endl;
|
||||
|
||||
success = false;
|
||||
errorMsg = "Invalid Chat Type";
|
||||
break;
|
||||
}
|
||||
|
||||
// Should be able to reply using the existing message types.
|
||||
if (success)
|
||||
{
|
||||
if (private_chat)
|
||||
{
|
||||
/* extract the history */
|
||||
std::list<HistoryMsg> msgs;
|
||||
std::list<HistoryMsg>::iterator it;
|
||||
rsHistory->getMessages(chat_id, msgs, 0);
|
||||
|
||||
//rsctrl::chat::ChatId *id = resp.mutable_id();
|
||||
//id->set_chat_type(rsctrl::chat::TYPE_PRIVATE);
|
||||
//id->set_chat_id(chat_id);
|
||||
|
||||
for(it = msgs.begin(); it != msgs.end(); it++)
|
||||
{
|
||||
rsctrl::chat::ChatMessage *msg = resp.add_msgs();
|
||||
fillChatMessageFromHistoryMsg(*it, msg);
|
||||
|
||||
std::cerr << "\t Message: " << it->message;
|
||||
std::cerr << std::endl;
|
||||
}
|
||||
}
|
||||
#if 0
|
||||
else if (lobby_chat)
|
||||
{
|
||||
|
||||
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
/* DONE - Generate Reply */
|
||||
if (success)
|
||||
{
|
||||
rsctrl::core::Status *status = resp.mutable_status();
|
||||
status->set_code(rsctrl::core::Status::SUCCESS);
|
||||
}
|
||||
else
|
||||
{
|
||||
rsctrl::core::Status *status = resp.mutable_status();
|
||||
status->set_code(rsctrl::core::Status::FAILED);
|
||||
status->set_msg(errorMsg);
|
||||
}
|
||||
|
||||
std::string outmsg;
|
||||
if (!resp.SerializeToString(&outmsg))
|
||||
{
|
||||
std::cerr << "RpcProtoChat::processReqChatHistory() ERROR SerialiseToString()";
|
||||
std::cerr << std::endl;
|
||||
return 0;
|
||||
}
|
||||
|
||||
// Correctly Name Message.
|
||||
uint32_t out_msg_id = constructMsgId(rsctrl::core::CORE, rsctrl::core::CHAT,
|
||||
rsctrl::chat::MsgId_ResponseChatHistory, true);
|
||||
|
||||
// queue it.
|
||||
queueResponse(chan_id, out_msg_id, req_id, outmsg);
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
int RpcProtoChat::processReqSendMessage(uint32_t chan_id, uint32_t /*msg_id*/, uint32_t req_id, const std::string &msg)
|
||||
{
|
||||
std::cerr << "RpcProtoChat::processReqSendMessage()";
|
||||
@ -1220,6 +1393,25 @@ bool fillLobbyInfoFromChatLobbyInvite(const ChatLobbyInvite &cli, rsctrl::chat::
|
||||
}
|
||||
|
||||
|
||||
bool fillChatMessageFromHistoryMsg(const HistoryMsg &histmsg, rsctrl::chat::ChatMessage *rpcmsg)
|
||||
{
|
||||
rsctrl::chat::ChatId *id = rpcmsg->mutable_id();
|
||||
|
||||
id->set_chat_type(rsctrl::chat::TYPE_PRIVATE);
|
||||
id->set_chat_id(histmsg.chatPeerId);
|
||||
|
||||
rpcmsg->set_msg(histmsg.message);
|
||||
|
||||
rpcmsg->set_peer_nickname(histmsg.peerName);
|
||||
rpcmsg->set_chat_flags(0);
|
||||
|
||||
rpcmsg->set_send_time(histmsg.sendTime);
|
||||
rpcmsg->set_recv_time(histmsg.recvTime);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
bool createQueuedEventSendMsg(const ChatInfo &chatinfo, rsctrl::chat::ChatType ctype,
|
||||
std::string chat_id, const RpcEventRegister &ereg, RpcQueuedMsg &qmsg)
|
||||
{
|
||||
@ -1266,6 +1458,9 @@ bool createQueuedEventSendMsg(const ChatInfo &chatinfo, rsctrl::chat::ChatType c
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
bool convertUTF8toWString(const std::string &msg_utf8, std::wstring &msg_wstr)
|
||||
{
|
||||
return librs::util::ConvertUtf8ToUtf16(msg_utf8, msg_wstr);
|
||||
|
@ -45,6 +45,9 @@ protected:
|
||||
int processReqRegisterEvents(uint32_t chan_id, uint32_t msg_id, uint32_t req_id, const std::string &msg);
|
||||
int processReqSendMessage(uint32_t chan_id, uint32_t msg_id, uint32_t req_id, const std::string &msg);
|
||||
|
||||
int processReqChatHistory(uint32_t chan_id, uint32_t msg_id, uint32_t req_id, const std::string &msg);
|
||||
|
||||
|
||||
// EVENTS.
|
||||
virtual int locked_checkForEvents(uint32_t event, const std::list<RpcEventRegister> ®istered, std::list<RpcQueuedMsg> &events);
|
||||
};
|
||||
|
@ -216,9 +216,14 @@ int RpcProtoPeers::processRequestPeers(uint32_t chan_id, uint32_t msg_id, uint32
|
||||
{
|
||||
std::cerr << "RpcProtoPeers::processRequestPeers() LISTED";
|
||||
std::cerr << std::endl;
|
||||
/* extract ids from request (TODO) */
|
||||
std::string own_id = rsPeers->getGPGOwnId();
|
||||
ids.push_back(own_id);
|
||||
int no_gpg_ids = reqp.gpg_ids_size();
|
||||
for (int i = 0; i < no_gpg_ids; i++)
|
||||
{
|
||||
std::string listed_id = reqp.gpg_ids(i);
|
||||
std::cerr << "RpcProtoPeers::processRequestPeers() Adding Id: " << listed_id;
|
||||
std::cerr << std::endl;
|
||||
ids.push_back(listed_id);
|
||||
}
|
||||
break;
|
||||
|
||||
}
|
||||
@ -292,6 +297,9 @@ int RpcProtoPeers::processRequestPeers(uint32_t chan_id, uint32_t msg_id, uint32
|
||||
RsPeerDetails details;
|
||||
if (!rsPeers->getGPGDetails(*git, details))
|
||||
{
|
||||
std::cerr << "RpcProtoPeers::processRequestPeers() ERROR Finding GPGID: ";
|
||||
std::cerr << *git;
|
||||
std::cerr << std::endl;
|
||||
continue; /* uhm.. */
|
||||
}
|
||||
|
||||
@ -305,8 +313,17 @@ int RpcProtoPeers::processRequestPeers(uint32_t chan_id, uint32_t msg_id, uint32
|
||||
std::cerr << *git << " name: " << details.name;
|
||||
std::cerr << std::endl;
|
||||
|
||||
if (details.state & RS_PEER_STATE_FRIEND)
|
||||
//if (details.state & RS_PEER_STATE_FRIEND)
|
||||
if (*git == rsPeers->getGPGOwnId())
|
||||
{
|
||||
std::cerr << "RpcProtoPeers::processRequestPeers() Relation YOURSELF";
|
||||
std::cerr << std::endl;
|
||||
person->set_relation(rsctrl::core::Person::YOURSELF);
|
||||
}
|
||||
else if (rsPeers->isGPGAccepted(*git))
|
||||
{
|
||||
std::cerr << "RpcProtoPeers::processRequestPeers() Relation FRIEND";
|
||||
std::cerr << std::endl;
|
||||
person->set_relation(rsctrl::core::Person::FRIEND);
|
||||
}
|
||||
else
|
||||
@ -318,15 +335,21 @@ int RpcProtoPeers::processRequestPeers(uint32_t chan_id, uint32_t msg_id, uint32
|
||||
{
|
||||
if (size > 2)
|
||||
{
|
||||
std::cerr << "RpcProtoPeers::processRequestPeers() Relation FRIEND_OF_MANY_FRIENDS";
|
||||
std::cerr << std::endl;
|
||||
person->set_relation(rsctrl::core::Person::FRIEND_OF_MANY_FRIENDS);
|
||||
}
|
||||
else
|
||||
{
|
||||
std::cerr << "RpcProtoPeers::processRequestPeers() Relation FRIEND_OF_FRIENDS";
|
||||
std::cerr << std::endl;
|
||||
person->set_relation(rsctrl::core::Person::FRIEND_OF_FRIENDS);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
std::cerr << "RpcProtoPeers::processRequestPeers() Relation UNKNOWN";
|
||||
std::cerr << std::endl;
|
||||
person->set_relation(rsctrl::core::Person::UNKNOWN);
|
||||
}
|
||||
}
|
||||
@ -338,6 +361,8 @@ int RpcProtoPeers::processRequestPeers(uint32_t chan_id, uint32_t msg_id, uint32
|
||||
|
||||
if (!rsPeers->getAssociatedSSLIds(*git, ssl_ids))
|
||||
{
|
||||
std::cerr << "RpcProtoPeers::processRequestPeers() No Locations";
|
||||
std::cerr << std::endl;
|
||||
continue; /* end of this peer */
|
||||
}
|
||||
|
||||
@ -356,9 +381,9 @@ int RpcProtoPeers::processRequestPeers(uint32_t chan_id, uint32_t msg_id, uint32
|
||||
|
||||
rsctrl::core::Location *loc = person->add_locations();
|
||||
|
||||
std::cerr << "RpcProtoPeers::processRequestPeers() \t Adding Location: ";
|
||||
std::cerr << *sit << " loc: " << ssldetails.location;
|
||||
std::cerr << std::endl;
|
||||
std::cerr << "RpcProtoPeers::processRequestPeers() \t Adding Location: ";
|
||||
std::cerr << *sit << " loc: " << ssldetails.location;
|
||||
std::cerr << std::endl;
|
||||
|
||||
/* fill in ssl details */
|
||||
loc->set_ssl_id(*sit);
|
||||
|
@ -38,6 +38,9 @@
|
||||
|
||||
#include <set>
|
||||
|
||||
bool condenseSearchResults(const std::list<TurtleFileInfo> &searchResults, uint32_t limit,
|
||||
rsctrl::search::SearchSet *result_set);
|
||||
|
||||
|
||||
RpcProtoSearch::RpcProtoSearch(uint32_t serviceId, NotifyTxt *notify)
|
||||
:RpcQueueService(serviceId), mNotify(notify), searchMtx("RpcProtoSearch")
|
||||
@ -420,21 +423,7 @@ int RpcProtoSearch::processReqSearchResults(uint32_t chan_id, uint32_t /* msg_id
|
||||
std::list<TurtleFileInfo> searchResults;
|
||||
mNotify->getSearchResults(*rit, searchResults);
|
||||
|
||||
/* convert into useful list */
|
||||
for(it = searchResults.begin(); it != searchResults.end(); it++)
|
||||
{
|
||||
/* add to answer */
|
||||
rsctrl::search::SearchHit *hit = set->add_hits();
|
||||
rsctrl::core::File *file = hit->mutable_file();
|
||||
|
||||
file->set_hash(it->hash);
|
||||
file->set_name(it->name);
|
||||
file->set_size(it->size);
|
||||
|
||||
// Uhm not provided for now. default to NETWORK
|
||||
hit->set_loc(rsctrl::search::SearchHit::NETWORK);
|
||||
hit->set_no_hits(1); // No aggregation yet.
|
||||
}
|
||||
condenseSearchResults(searchResults, req.result_limit(), set);
|
||||
}
|
||||
|
||||
/* DONE - Generate Reply */
|
||||
@ -591,3 +580,99 @@ int RpcProtoSearch::clear_searches(uint32_t chan_id)
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
||||
|
||||
class RpcSearchInfo
|
||||
{
|
||||
public:
|
||||
std::string hash;
|
||||
std::string name;
|
||||
uint64_t size;
|
||||
std::map<std::string, uint32_t> name_map;
|
||||
uint32_t hits;
|
||||
};
|
||||
|
||||
|
||||
bool condenseSearchResults(const std::list<TurtleFileInfo> &searchResults, uint32_t limit,
|
||||
rsctrl::search::SearchSet *result_set)
|
||||
{
|
||||
std::map<std::string, RpcSearchInfo> searchMap;
|
||||
std::map<std::string, RpcSearchInfo>::iterator mit;
|
||||
|
||||
std::list<TurtleFileInfo>::const_iterator it;
|
||||
for(it = searchResults.begin(); it != searchResults.end(); it++)
|
||||
{
|
||||
mit = searchMap.find(it->hash);
|
||||
if (mit != searchMap.end())
|
||||
{
|
||||
mit->second.hits++;
|
||||
|
||||
if (mit->second.name_map.find(it->name) == mit->second.name_map.end())
|
||||
{
|
||||
mit->second.name_map[it->name] = 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
mit->second.name_map[it->name]++;
|
||||
}
|
||||
|
||||
if (it->size != mit->second.size)
|
||||
{
|
||||
// ERROR.
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
RpcSearchInfo info;
|
||||
info.hash = it->hash;
|
||||
info.size = it->size;
|
||||
info.name_map[it->name] = 1;
|
||||
info.hits = 1;
|
||||
|
||||
searchMap[it->hash] = info;
|
||||
}
|
||||
}
|
||||
|
||||
unsigned int i = 0;
|
||||
for(mit = searchMap.begin(); (mit != searchMap.end()) && (i < limit); mit++, i++)
|
||||
{
|
||||
std::map<std::string, uint32_t>::reverse_iterator nit;
|
||||
nit = mit->second.name_map.rbegin();
|
||||
|
||||
/* add to answer */
|
||||
rsctrl::search::SearchHit *hit = result_set->add_hits();
|
||||
rsctrl::core::File *file = hit->mutable_file();
|
||||
|
||||
file->set_hash(mit->second.hash);
|
||||
file->set_name(nit->first);
|
||||
file->set_size(mit->second.size);
|
||||
|
||||
// Uhm not provided for now. default to NETWORK
|
||||
hit->set_loc(rsctrl::search::SearchHit::NETWORK);
|
||||
hit->set_no_hits(mit->second.hits); // No aggregation yet.
|
||||
|
||||
// guarenteed to have one item here.
|
||||
for(nit++; nit != mit->second.name_map.rend(); nit++)
|
||||
{
|
||||
hit->add_alt_names(nit->first);
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user