Add pm_conversations.recent.get_strings().

We will use this method for hotkey navigation through recent
pms.
This commit is contained in:
Steve Howell 2018-02-09 15:13:38 -05:00 committed by Tim Abbott
parent 4f52e095e8
commit 9f8526ce29
2 changed files with 8 additions and 0 deletions

View File

@ -25,5 +25,7 @@ var pmc = zrequire('pm_conversations');
{user_ids_string: '1', timestamp: 3001},
{user_ids_string: '2', timestamp: 2001},
]);
assert.deepEqual(pmc.recent.get_strings(), ['1', '2']);
}());

View File

@ -51,6 +51,12 @@ exports.recent = (function () {
return recent_private_messages;
};
self.get_strings = function () {
// returns array of structs with user_ids_string and
// timestamp
return _.pluck(recent_private_messages, 'user_ids_string');
};
return self;
}());