Add topic_data.get_server_history().

This isn't connected to anything yet, but you can now get
all the historical topics for a stream by calling
topic_data.get_server_history().
This commit is contained in:
Steve Howell
2017-08-08 13:54:07 -04:00
committed by showell
parent 9bbcb712ec
commit 3b88e592d0
2 changed files with 47 additions and 0 deletions

View File

@@ -156,6 +156,20 @@ exports.add_history = function (stream_id, server_history) {
history.add_history(server_history);
};
exports.get_server_history = function (stream_id, on_success) {
var url = '/json/users/me/' + stream_id + '/topics';
channel.get({
url: url,
data: {},
success: function (data) {
var server_history = data.topics;
exports.add_history(stream_id, server_history);
on_success();
},
});
};
exports.get_recent_names = function (stream_id) {
var history = stream_dict.get(stream_id);