stage four unchecked (bridge with teams and self dm). undocumented

This commit is contained in:
Ivan I. Ovchinnikov
2026-11-18 12:57:06 +03:00
parent 5c3a1473e3
commit 6296a3a719
24 changed files with 2616 additions and 471 deletions
+3 -1
View File
@@ -8,4 +8,6 @@ pub mod model;
pub use error::{BridgeError, ErrorKind};
pub use ids::{ChannelId, PostId, ServerId, TeamId, UserId};
pub use model::{BridgeInfo, BridgeState, BridgeStatus, ServerSummary};
pub use model::{
BridgeInfo, BridgeState, BridgeStatus, Post, ServerConfig, ServerSummary, Team, User,
};
+42 -2
View File
@@ -1,5 +1,5 @@
use crate::ids::ServerId;
use serde::Serialize;
use crate::ids::{ChannelId, PostId, ServerId, TeamId, UserId};
use serde::{Deserialize, Serialize};
#[derive(Debug, Clone, Serialize)]
#[serde(rename_all = "snake_case")]
@@ -11,6 +11,7 @@ pub enum BridgeState {
pub struct ServerSummary {
pub server_id: ServerId,
pub state: String,
pub has_token: bool,
}
#[derive(Debug, Clone, Serialize)]
@@ -36,3 +37,42 @@ impl BridgeStatus {
}
}
}
/// Normalized Mattermost user. Only fields needed by the MVP UI.
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct User {
pub id: UserId,
pub username: String,
#[serde(default)]
pub nickname: String,
#[serde(default)]
pub first_name: String,
#[serde(default)]
pub last_name: String,
}
/// Persisted per-server configuration (no secrets).
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct ServerConfig {
pub server_id: ServerId,
pub url: String,
}
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct Team {
pub id: TeamId,
pub name: String,
pub display_name: String,
}
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct Post {
pub id: PostId,
pub channel_id: ChannelId,
pub user_id: UserId,
pub root_id: Option<PostId>,
pub message: String,
pub create_at: i64,
pub update_at: i64,
pub delete_at: i64,
}