* messages.recent_messages now uses the /message/recent
This should be more clear in its intentions and basically gives the behavior you expect when looking at this method
This commit is contained in:
parent
e0d5b8b5f7
commit
32eb669f96
@ -109,16 +109,28 @@ function push_message(message) {
|
|||||||
* @param {u64} auth.id user | id required by most/all endpoints
|
* @param {u64} auth.id user | id required by most/all endpoints
|
||||||
*
|
*
|
||||||
* @param {String} server.url | HTTP URL
|
* @param {String} server.url | HTTP URL
|
||||||
* @param {String} server.wsurl | Websocket URL
|
|
||||||
*
|
*
|
||||||
* @param {String} channel.description | Description of channel
|
* @params {u64} channel_id | channel id to query
|
||||||
* @params {u64} channel.id | channel id to query
|
|
||||||
* @returns void
|
* @returns void
|
||||||
*/
|
*/
|
||||||
exports.recent_messages = async function (auth, server, channel, start_time, end_time, limit) {
|
exports.recent_messages = async function recent_messages(auth, server, channel_id, limit) {
|
||||||
$('#messages-list').html('')
|
$('#messages-list').html('')
|
||||||
|
|
||||||
const messages = await get_range(auth, server, channel['id'], start_time, end_time, limit)
|
try {
|
||||||
|
const response = await got(server.url + '/message/recent',{
|
||||||
|
searchParams: {
|
||||||
|
jwt: auth.jwt,
|
||||||
|
channel_id: channel_id,
|
||||||
|
limit: 80
|
||||||
|
},
|
||||||
|
responseType: 'json'
|
||||||
|
})
|
||||||
|
const messages = response.body['messages']
|
||||||
|
for(const message of messages) {
|
||||||
|
}
|
||||||
|
} catch (err) {
|
||||||
|
}
|
||||||
|
const messages = await get_range(auth, server, channel['id'], limit)
|
||||||
|
|
||||||
for(const message of messages) {
|
for(const message of messages) {
|
||||||
console.log(message)
|
console.log(message)
|
||||||
|
Loading…
Reference in New Issue
Block a user