Skip to content

Commit

Permalink
complete function track_pipe_users
Browse files Browse the repository at this point in the history
  • Loading branch information
VictorTrapenok committed Aug 7, 2017
1 parent 7d2e62c commit e655121
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 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
9 changes: 6 additions & 3 deletions src/Client_connection.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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 e655121

Please sign in to comment.