Skip to content

Commit

Permalink
Merge pull request #77 from pstjuste/fix/get_state_uid
Browse files Browse the repository at this point in the history
Ability to lookup friends by uid
  • Loading branch information
kyuhojeong committed Jun 30, 2014
2 parents e9a69d2 + d168d9e commit 371da1b
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/controlleraccess.cc
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,15 @@ void ControllerAccess::SendToPeer(int overlay_id, const std::string& uid,
void ControllerAccess::SendState(const std::string& uid, bool get_stats,
const talk_base::SocketAddress& addr) {
ASSERT(signal_thread_->Current());
Json::Value state = manager_.GetState(network_.friends(), get_stats);
Json::Value state;
if (uid != "") {
std::map<std::string, uint32> friends;
friends[uid] = talk_base::Time();
state = manager_.GetState(friends, get_stats);
}
else {
state = manager_.GetState(network_.friends(), get_stats);
}
Json::Value local_state;
local_state["_uid"] = manager_.uid();
local_state["_ip4"] = manager_.ipv4();
Expand Down

0 comments on commit 371da1b

Please sign in to comment.