refactor(bridge): split handlers.rs into modules
- handlers/mod.rs: public handler functions - handlers/helpers.rs: utility functions (get_client, get_token, etc.) - handlers/enrich.rs: post enrichment (display names, files) - Fix FileInfo export in mm-core feat(ui): preserve collapsed state on dashboard refresh - Track collapsed team IDs in buffer-local mattermost--collapsed-teams - Save collapse state before re-rendering (define-derived-mode resets locals) - Restore collapse state after re-rendering - Reset dashboard buffer on mattermost-reset-state
This commit is contained in:
@@ -9,5 +9,6 @@ pub mod model;
|
||||
pub use error::{BridgeError, ErrorKind};
|
||||
pub use ids::{ChannelId, PostId, ServerId, TeamId, UserId};
|
||||
pub use model::{
|
||||
BridgeInfo, BridgeState, BridgeStatus, Channel, Post, ServerConfig, ServerSummary, Team, User,
|
||||
BridgeInfo, BridgeState, BridgeStatus, Channel, FileInfo, Post, ServerConfig, ServerSummary,
|
||||
Team, User,
|
||||
};
|
||||
|
||||
@@ -93,6 +93,16 @@ pub struct Channel {
|
||||
pub last_post_at: i64,
|
||||
}
|
||||
|
||||
/// File metadata attached to a post.
|
||||
#[derive(Debug, Clone, Serialize, Deserialize)]
|
||||
pub struct FileInfo {
|
||||
pub id: String,
|
||||
pub name: String,
|
||||
pub size: i64,
|
||||
#[serde(default)]
|
||||
pub mime_type: String,
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, Serialize, Deserialize)]
|
||||
pub struct Post {
|
||||
pub id: PostId,
|
||||
@@ -108,4 +118,7 @@ pub struct Post {
|
||||
/// Populated by the bridge after resolving user_id via /users/ids.
|
||||
#[serde(default, skip_deserializing)]
|
||||
pub user_display_name: String,
|
||||
/// Populated by the bridge after fetching file metadata.
|
||||
#[serde(default, skip_deserializing)]
|
||||
pub files: Vec<FileInfo>,
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user