send VCard request to backend
This commit is contained in:
parent
098f6a995a
commit
56c45b9e3d
2 changed files with 23 additions and 1 deletions
|
@ -487,7 +487,19 @@ void NetworkPluginServer::handleMessageReceived(NetworkConversation *conv, boost
|
|||
}
|
||||
|
||||
void NetworkPluginServer::handleVCardRequired(User *user, const std::string &name, unsigned int id) {
|
||||
|
||||
std::cout << "VCARD REQUIRED " << name << " " << id << "\n";
|
||||
pbnetwork::VCard vcard;
|
||||
vcard.set_username(user->getJID().toBare());
|
||||
vcard.set_buddyname(name);
|
||||
vcard.set_id(id);
|
||||
|
||||
std::string message;
|
||||
vcard.SerializeToString(&message);
|
||||
|
||||
WRAP(message, pbnetwork::WrapperMessage_Type_TYPE_VCARD);
|
||||
|
||||
Client *c = (Client *) user->getData();
|
||||
send(c->connection, message);
|
||||
}
|
||||
|
||||
void NetworkPluginServer::sendPing(Client *c) {
|
||||
|
|
|
@ -57,6 +57,15 @@ message Participant {
|
|||
optional string newname = 7;
|
||||
}
|
||||
|
||||
message VCard {
|
||||
required string userName = 1;
|
||||
required string buddyName = 2;
|
||||
required int32 id = 3;
|
||||
optional string fullname = 4;
|
||||
optional string nickname = 5;
|
||||
optional bytes photo = 6;
|
||||
}
|
||||
|
||||
message WrapperMessage {
|
||||
enum Type {
|
||||
TYPE_CONNECTED = 1;
|
||||
|
@ -73,6 +82,7 @@ message WrapperMessage {
|
|||
TYPE_PARTICIPANT_CHANGED = 13;
|
||||
TYPE_ROOM_NICKNAME_CHANGED = 14;
|
||||
TYPE_ROOM_SUBJECT_CHANGED = 15;
|
||||
TYPE_VCARD = 16;
|
||||
}
|
||||
required Type type = 1;
|
||||
optional bytes payload = 2;
|
||||
|
|
Loading…
Add table
Reference in a new issue