Skip to content

Commit

Permalink
Merge origin/master
Browse files Browse the repository at this point in the history
  • Loading branch information
VictorTrapenok committed Aug 9, 2017
2 parents e7097c2 + 3d0334a commit 9079ca7
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ BUG FIXES:
BUG FIXES:
* Js Api version 3.28 (Fix bug in auth callbacks)
* Fix bug in auth callbacks
* complete api function getTrackPipeUsers

## v3.1

Expand Down
11 changes: 7 additions & 4 deletions src/Client_connection.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -987,7 +987,7 @@ int Client_connection::track_pipe_users(thread_data* local_buf, char* event_data
}


std::string usersstr("{\"event_name\":\"answer\",\"data\":{");
std::string usersstr("{\"event_name\":\"answer\",\"data\":{\"users\":[");

char strtmp[200];
TagLoger::log(Log_ClientServer, 0, "track_pipe_users pipe:%s\n", name);
Expand All @@ -1003,8 +1003,9 @@ int Client_connection::track_pipe_users(thread_data* local_buf, char* event_data
CP<Client_connection> r = tcpServer <Client_connection>::instance()->get(conection_id);
if(r)
{
// @todo отдавать всем не uuid а его солёный хеш.
bzero(strtmp, 200);
snprintf(strtmp, 200, "{\"user_id\":\"%d\",\"uuid\":\"%s\"}", r->web_user_id, r->web_user_uuid);
snprintf(strtmp, 200, "{\"user_id\":%d,\"uuid\":\"%s\"}", r->web_user_id, r->web_user_uuid);
usersstr.append(strtmp);
}

Expand All @@ -1016,13 +1017,15 @@ int Client_connection::track_pipe_users(thread_data* local_buf, char* event_data
}
}

usersstr.append("},\"marker\":\"").append(marker).append("\"");
usersstr.append("]}}");

std::string rdname("_answer_to_");
rdname.append(name);
std::string addData("\"marker\":\"");
addData.append(marker).append("\"");

TagLoger::log(Log_ClientServer, 0, "answer:%s\n", usersstr.data());
if(message(local_buf, base64_encode( (const char*)usersstr.data()).data() , rdname.data()) < 0)
if(message(local_buf, base64_encode( (const char*)usersstr.data()).data() , rdname.data(), MESSAGE_TEXT, addData.data()) < 0)
{
return -1;
}
Expand Down

0 comments on commit 9079ca7

Please sign in to comment.