forked from jmug/stoatchat
Add january support.
This commit is contained in:
@@ -95,9 +95,7 @@ pub async fn req(user: User, target: Ref) -> Result<()> {
|
||||
id: id.clone(),
|
||||
user: user.id.clone(),
|
||||
}
|
||||
.publish(id.clone())
|
||||
.await
|
||||
.ok();
|
||||
.publish(id.clone());
|
||||
|
||||
Message::create(
|
||||
"00000000000000000000000000".to_string(),
|
||||
|
||||
@@ -101,9 +101,7 @@ pub async fn req(user: User, target: Ref, data: Json<Data>) -> Result<()> {
|
||||
data: json!(set),
|
||||
clear: data.remove
|
||||
}
|
||||
.publish(id.clone())
|
||||
.await
|
||||
.ok();
|
||||
.publish(id.clone());
|
||||
|
||||
if let Some(name) = data.name {
|
||||
Message::create(
|
||||
|
||||
@@ -52,9 +52,7 @@ pub async fn req(user: User, target: Ref, member: Ref) -> Result<()> {
|
||||
id: id.clone(),
|
||||
user: member.id.clone(),
|
||||
}
|
||||
.publish(id.clone())
|
||||
.await
|
||||
.ok();
|
||||
.publish(id.clone());
|
||||
|
||||
Message::create(
|
||||
"00000000000000000000000000".to_string(),
|
||||
|
||||
@@ -49,9 +49,7 @@ pub async fn req(user: User, target: Ref, member: Ref) -> Result<()> {
|
||||
id: id.clone(),
|
||||
user: member.id.clone(),
|
||||
}
|
||||
.publish(id.clone())
|
||||
.await
|
||||
.ok();
|
||||
.publish(id.clone());
|
||||
|
||||
Message::create(
|
||||
"00000000000000000000000000".to_string(),
|
||||
|
||||
@@ -74,21 +74,19 @@ pub async fn req(user: User, username: String) -> Result<JsonValue> {
|
||||
.from_override(&target_user, RelationshipStatus::Friend)
|
||||
.await?;
|
||||
|
||||
try_join!(
|
||||
ClientboundNotification::UserRelationship {
|
||||
id: user.id.clone(),
|
||||
user: target_user,
|
||||
status: RelationshipStatus::Friend
|
||||
}
|
||||
.publish(user.id.clone()),
|
||||
ClientboundNotification::UserRelationship {
|
||||
id: target_id.to_string(),
|
||||
user,
|
||||
status: RelationshipStatus::Friend
|
||||
}
|
||||
.publish(target_id.to_string())
|
||||
)
|
||||
.ok();
|
||||
ClientboundNotification::UserRelationship {
|
||||
id: user.id.clone(),
|
||||
user: target_user,
|
||||
status: RelationshipStatus::Friend
|
||||
}
|
||||
.publish(user.id.clone());
|
||||
|
||||
ClientboundNotification::UserRelationship {
|
||||
id: target_id.to_string(),
|
||||
user,
|
||||
status: RelationshipStatus::Friend
|
||||
}
|
||||
.publish(target_id.to_string());
|
||||
|
||||
Ok(json!({ "status": "Friend" }))
|
||||
}
|
||||
@@ -136,21 +134,20 @@ pub async fn req(user: User, username: String) -> Result<JsonValue> {
|
||||
let user = user
|
||||
.from_override(&target_user, RelationshipStatus::Incoming)
|
||||
.await?;
|
||||
try_join!(
|
||||
ClientboundNotification::UserRelationship {
|
||||
id: user.id.clone(),
|
||||
user: target_user,
|
||||
status: RelationshipStatus::Outgoing
|
||||
}
|
||||
.publish(user.id.clone()),
|
||||
ClientboundNotification::UserRelationship {
|
||||
id: target_id.to_string(),
|
||||
user,
|
||||
status: RelationshipStatus::Incoming
|
||||
}
|
||||
.publish(target_id.to_string())
|
||||
)
|
||||
.ok();
|
||||
|
||||
ClientboundNotification::UserRelationship {
|
||||
id: user.id.clone(),
|
||||
user: target_user,
|
||||
status: RelationshipStatus::Outgoing
|
||||
}
|
||||
.publish(user.id.clone());
|
||||
|
||||
ClientboundNotification::UserRelationship {
|
||||
id: target_id.to_string(),
|
||||
user,
|
||||
status: RelationshipStatus::Incoming
|
||||
}
|
||||
.publish(target_id.to_string());
|
||||
|
||||
Ok(json!({ "status": "Outgoing" }))
|
||||
}
|
||||
|
||||
@@ -38,9 +38,7 @@ pub async fn req(user: User, target: Ref) -> Result<JsonValue> {
|
||||
user: target,
|
||||
status: RelationshipStatus::Blocked,
|
||||
}
|
||||
.publish(user.id.clone())
|
||||
.await
|
||||
.ok();
|
||||
.publish(user.id.clone());
|
||||
|
||||
Ok(json!({ "status": "Blocked" }))
|
||||
}
|
||||
@@ -84,21 +82,19 @@ pub async fn req(user: User, target: Ref) -> Result<JsonValue> {
|
||||
.await?;
|
||||
let target_id = target.id.clone();
|
||||
|
||||
try_join!(
|
||||
ClientboundNotification::UserRelationship {
|
||||
id: user.id.clone(),
|
||||
user: target,
|
||||
status: RelationshipStatus::Blocked
|
||||
}
|
||||
.publish(user.id.clone()),
|
||||
ClientboundNotification::UserRelationship {
|
||||
id: target_id.clone(),
|
||||
user,
|
||||
status: RelationshipStatus::BlockedOther
|
||||
}
|
||||
.publish(target_id)
|
||||
)
|
||||
.ok();
|
||||
ClientboundNotification::UserRelationship {
|
||||
id: user.id.clone(),
|
||||
user: target,
|
||||
status: RelationshipStatus::Blocked
|
||||
}
|
||||
.publish(user.id.clone());
|
||||
|
||||
ClientboundNotification::UserRelationship {
|
||||
id: target_id.clone(),
|
||||
user,
|
||||
status: RelationshipStatus::BlockedOther
|
||||
}
|
||||
.publish(target_id);
|
||||
|
||||
Ok(json!({ "status": "Blocked" }))
|
||||
}
|
||||
@@ -146,21 +142,19 @@ pub async fn req(user: User, target: Ref) -> Result<JsonValue> {
|
||||
.await?;
|
||||
let target_id = target.id.clone();
|
||||
|
||||
try_join!(
|
||||
ClientboundNotification::UserRelationship {
|
||||
id: user.id.clone(),
|
||||
user: target,
|
||||
status: RelationshipStatus::Blocked
|
||||
}
|
||||
.publish(user.id.clone()),
|
||||
ClientboundNotification::UserRelationship {
|
||||
id: target_id.clone(),
|
||||
user,
|
||||
status: RelationshipStatus::BlockedOther
|
||||
}
|
||||
.publish(target_id)
|
||||
)
|
||||
.ok();
|
||||
ClientboundNotification::UserRelationship {
|
||||
id: user.id.clone(),
|
||||
user: target,
|
||||
status: RelationshipStatus::Blocked
|
||||
}
|
||||
.publish(user.id.clone());
|
||||
|
||||
ClientboundNotification::UserRelationship {
|
||||
id: target_id.clone(),
|
||||
user,
|
||||
status: RelationshipStatus::BlockedOther
|
||||
}
|
||||
.publish(target_id);
|
||||
|
||||
Ok(json!({ "status": "Blocked" }))
|
||||
}
|
||||
|
||||
@@ -60,9 +60,7 @@ pub async fn req(
|
||||
data: json!(data.0),
|
||||
clear: None
|
||||
}
|
||||
.publish(user.id.clone())
|
||||
.await
|
||||
.ok();
|
||||
.publish(user.id.clone());
|
||||
|
||||
Ok(())
|
||||
}
|
||||
|
||||
@@ -135,9 +135,7 @@ pub async fn req(user: User, data: Json<Data>, _ignore_id: String) -> Result<()>
|
||||
data: json!({ "status": status }),
|
||||
clear: None
|
||||
}
|
||||
.publish(user.id.clone())
|
||||
.await
|
||||
.ok();
|
||||
.publish(user.id.clone());
|
||||
}
|
||||
|
||||
if let Some(avatar) = attachment {
|
||||
@@ -146,9 +144,7 @@ pub async fn req(user: User, data: Json<Data>, _ignore_id: String) -> Result<()>
|
||||
data: json!({ "avatar": avatar }),
|
||||
clear: None
|
||||
}
|
||||
.publish(user.id.clone())
|
||||
.await
|
||||
.ok();
|
||||
.publish(user.id.clone());
|
||||
}
|
||||
|
||||
if let Some(clear) = data.remove {
|
||||
@@ -157,9 +153,7 @@ pub async fn req(user: User, data: Json<Data>, _ignore_id: String) -> Result<()>
|
||||
data: json!({}),
|
||||
clear: Some(clear)
|
||||
}
|
||||
.publish(user.id.clone())
|
||||
.await
|
||||
.ok();
|
||||
.publish(user.id.clone());
|
||||
}
|
||||
|
||||
if remove_avatar {
|
||||
|
||||
@@ -53,21 +53,19 @@ pub async fn req(user: User, target: Ref) -> Result<JsonValue> {
|
||||
.await?;
|
||||
let target_id = target.id.clone();
|
||||
|
||||
try_join!(
|
||||
ClientboundNotification::UserRelationship {
|
||||
id: user.id.clone(),
|
||||
user: target,
|
||||
status: RelationshipStatus::None
|
||||
}
|
||||
.publish(user.id.clone()),
|
||||
ClientboundNotification::UserRelationship {
|
||||
id: target_id.clone(),
|
||||
user,
|
||||
status: RelationshipStatus::None
|
||||
}
|
||||
.publish(target_id)
|
||||
)
|
||||
.ok();
|
||||
ClientboundNotification::UserRelationship {
|
||||
id: user.id.clone(),
|
||||
user: target,
|
||||
status: RelationshipStatus::None
|
||||
}
|
||||
.publish(user.id.clone());
|
||||
|
||||
ClientboundNotification::UserRelationship {
|
||||
id: target_id.clone(),
|
||||
user,
|
||||
status: RelationshipStatus::None
|
||||
}
|
||||
.publish(target_id);
|
||||
|
||||
Ok(json!({ "status": "None" }))
|
||||
}
|
||||
|
||||
@@ -40,9 +40,7 @@ pub async fn req(user: User, target: Ref) -> Result<JsonValue> {
|
||||
user: target,
|
||||
status: RelationshipStatus::BlockedOther,
|
||||
}
|
||||
.publish(user.id.clone())
|
||||
.await
|
||||
.ok();
|
||||
.publish(user.id.clone());
|
||||
|
||||
Ok(json!({ "status": "BlockedOther" }))
|
||||
}
|
||||
@@ -84,21 +82,19 @@ pub async fn req(user: User, target: Ref) -> Result<JsonValue> {
|
||||
.await?;
|
||||
let target_id = target.id.clone();
|
||||
|
||||
try_join!(
|
||||
ClientboundNotification::UserRelationship {
|
||||
id: user.id.clone(),
|
||||
user: target,
|
||||
status: RelationshipStatus::None
|
||||
}
|
||||
.publish(user.id.clone()),
|
||||
ClientboundNotification::UserRelationship {
|
||||
id: target_id.clone(),
|
||||
user: user,
|
||||
status: RelationshipStatus::None
|
||||
}
|
||||
.publish(target_id)
|
||||
)
|
||||
.ok();
|
||||
ClientboundNotification::UserRelationship {
|
||||
id: user.id.clone(),
|
||||
user: target,
|
||||
status: RelationshipStatus::None
|
||||
}
|
||||
.publish(user.id.clone());
|
||||
|
||||
ClientboundNotification::UserRelationship {
|
||||
id: target_id.clone(),
|
||||
user: user,
|
||||
status: RelationshipStatus::None
|
||||
}
|
||||
.publish(target_id);
|
||||
|
||||
Ok(json!({ "status": "None" }))
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user