Add last_message to channels, mark DMs as active.

This commit is contained in:
Paul Makles
2021-01-24 10:24:44 +00:00
parent cb882ce1b2
commit 11f7092fcd
8 changed files with 69 additions and 13 deletions

View File

@@ -17,7 +17,7 @@ pub async fn req(user: User, target: Ref, member: Ref) -> Result<()> {
Err(Error::LabelMe)?
}
if let Channel::Group { id, recipients, .. } = channel {
if let Channel::Group { id, recipients, .. } = &channel {
if recipients.len() >= *MAX_GROUP_SIZE {
Err(Error::GroupTooLarge {
max: *MAX_GROUP_SIZE,
@@ -56,10 +56,10 @@ pub async fn req(user: User, target: Ref, member: Ref) -> Result<()> {
Message::create(
"00000000000000000000000000".to_string(),
id,
id.clone(),
format!("<@{}> added <@{}> to the group.", user.id, member.id),
)
.publish()
.publish(&channel)
.await
.ok();