diff --git a/CHANGELOG.md b/CHANGELOG.md index 7334ebd..1d19345 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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 diff --git a/src/Client_connection.cpp b/src/Client_connection.cpp index 2623f02..437c281 100644 --- a/src/Client_connection.cpp +++ b/src/Client_connection.cpp @@ -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); @@ -1003,8 +1003,9 @@ int Client_connection::track_pipe_users(thread_data* local_buf, char* event_data CP r = tcpServer ::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); } @@ -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; }