mirror of
https://github.com/zed-industries/zed.git
synced 2024-12-27 19:02:07 +00:00
Drop the word 'recent' from get_channel_messages db method name
This commit is contained in:
parent
fbc88d5f88
commit
b3d5f01ba8
2 changed files with 5 additions and 8 deletions
|
@ -376,7 +376,7 @@ impl Db {
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
pub async fn get_recent_channel_messages(
|
pub async fn get_channel_messages(
|
||||||
&self,
|
&self,
|
||||||
channel_id: ChannelId,
|
channel_id: ChannelId,
|
||||||
count: usize,
|
count: usize,
|
||||||
|
@ -518,17 +518,14 @@ pub mod tests {
|
||||||
.unwrap();
|
.unwrap();
|
||||||
}
|
}
|
||||||
|
|
||||||
let messages = db
|
let messages = db.get_channel_messages(channel, 5, None).await.unwrap();
|
||||||
.get_recent_channel_messages(channel, 5, None)
|
|
||||||
.await
|
|
||||||
.unwrap();
|
|
||||||
assert_eq!(
|
assert_eq!(
|
||||||
messages.iter().map(|m| &m.body).collect::<Vec<_>>(),
|
messages.iter().map(|m| &m.body).collect::<Vec<_>>(),
|
||||||
["5", "6", "7", "8", "9"]
|
["5", "6", "7", "8", "9"]
|
||||||
);
|
);
|
||||||
|
|
||||||
let prev_messages = db
|
let prev_messages = db
|
||||||
.get_recent_channel_messages(channel, 4, Some(messages[0].id))
|
.get_channel_messages(channel, 4, Some(messages[0].id))
|
||||||
.await
|
.await
|
||||||
.unwrap();
|
.unwrap();
|
||||||
assert_eq!(
|
assert_eq!(
|
||||||
|
|
|
@ -595,7 +595,7 @@ impl Server {
|
||||||
let messages = self
|
let messages = self
|
||||||
.app_state
|
.app_state
|
||||||
.db
|
.db
|
||||||
.get_recent_channel_messages(channel_id, MESSAGE_COUNT_PER_PAGE, None)
|
.get_channel_messages(channel_id, MESSAGE_COUNT_PER_PAGE, None)
|
||||||
.await?
|
.await?
|
||||||
.into_iter()
|
.into_iter()
|
||||||
.map(|msg| proto::ChannelMessage {
|
.map(|msg| proto::ChannelMessage {
|
||||||
|
@ -716,7 +716,7 @@ impl Server {
|
||||||
let messages = self
|
let messages = self
|
||||||
.app_state
|
.app_state
|
||||||
.db
|
.db
|
||||||
.get_recent_channel_messages(
|
.get_channel_messages(
|
||||||
channel_id,
|
channel_id,
|
||||||
MESSAGE_COUNT_PER_PAGE,
|
MESSAGE_COUNT_PER_PAGE,
|
||||||
Some(MessageId::from_proto(request.payload.before_message_id)),
|
Some(MessageId::from_proto(request.payload.before_message_id)),
|
||||||
|
|
Loading…
Reference in a new issue