fix(android): show password action only for locked channels
This commit is contained in:
@@ -355,6 +355,8 @@ pub struct BridgeChannel {
|
||||
pub name: String,
|
||||
/// Server-side ordering hint.
|
||||
pub order: i64,
|
||||
/// True when the server marks the channel as password-protected.
|
||||
pub has_password: bool,
|
||||
}
|
||||
|
||||
/// Client as seen by Dart.
|
||||
@@ -406,6 +408,7 @@ impl From<chanora_protocol::ServerSnapshot> for BridgeSnapshot {
|
||||
parent: c.parent.0,
|
||||
name: c.name,
|
||||
order: c.order,
|
||||
has_password: c.has_password,
|
||||
})
|
||||
.collect(),
|
||||
clients: s
|
||||
|
||||
@@ -1275,11 +1275,13 @@ impl SseDecode for crate::api::BridgeChannel {
|
||||
let mut var_parent = <u64>::sse_decode(deserializer);
|
||||
let mut var_name = <String>::sse_decode(deserializer);
|
||||
let mut var_order = <i64>::sse_decode(deserializer);
|
||||
let mut var_has_password = <bool>::sse_decode(deserializer);
|
||||
return crate::api::BridgeChannel {
|
||||
id: var_id,
|
||||
parent: var_parent,
|
||||
name: var_name,
|
||||
order: var_order,
|
||||
has_password: var_has_password,
|
||||
};
|
||||
}
|
||||
}
|
||||
@@ -1800,6 +1802,7 @@ impl flutter_rust_bridge::IntoDart for crate::api::BridgeChannel {
|
||||
self.parent.into_into_dart().into_dart(),
|
||||
self.name.into_into_dart().into_dart(),
|
||||
self.order.into_into_dart().into_dart(),
|
||||
self.has_password.into_into_dart().into_dart(),
|
||||
]
|
||||
.into_dart()
|
||||
}
|
||||
@@ -2180,6 +2183,7 @@ impl SseEncode for crate::api::BridgeChannel {
|
||||
<u64>::sse_encode(self.parent, serializer);
|
||||
<String>::sse_encode(self.name, serializer);
|
||||
<i64>::sse_encode(self.order, serializer);
|
||||
<bool>::sse_encode(self.has_password, serializer);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -864,6 +864,7 @@ fn build_snapshot(con: &Connection) -> Result<ServerSnapshot, ProtocolError> {
|
||||
parent: ChannelId(c.parent.0),
|
||||
name: sanitize(&c.name),
|
||||
order: c.order.0 as i64,
|
||||
has_password: c.has_password.unwrap_or(false),
|
||||
})
|
||||
.collect();
|
||||
|
||||
|
||||
@@ -23,6 +23,8 @@ pub struct ChannelInfo {
|
||||
pub name: String,
|
||||
/// Server-side ordering hint.
|
||||
pub order: i64,
|
||||
/// True when the server marks the channel as password-protected.
|
||||
pub has_password: bool,
|
||||
}
|
||||
|
||||
/// One connected client on the server.
|
||||
|
||||
Reference in New Issue
Block a user