Add support for merge request events
This commit is contained in:
@ -22,6 +22,8 @@ use matrix_sdk::{
|
||||
};
|
||||
use warp::Filter;
|
||||
|
||||
use crate::event::MergeRequestAction;
|
||||
|
||||
async fn build_sync_settings(matrix_client: &Client) -> SyncSettings {
|
||||
let mut settings = SyncSettings::default().timeout(Duration::from_secs(30));
|
||||
if let Some(token) = matrix_client.sync_token().await {
|
||||
@ -125,6 +127,12 @@ async fn handle_gitlab_event(
|
||||
room_id: &OwnedRoomOrAliasId,
|
||||
matrix_client: &Client,
|
||||
) -> anyhow::Result<()> {
|
||||
if let GitlabEvent::MergeRequest { object_attributes, .. } = &event {
|
||||
if object_attributes.action == MergeRequestAction::Other {
|
||||
return Ok(());
|
||||
}
|
||||
}
|
||||
|
||||
let room = ensure_matrix_room_joined(matrix_client, room_id).await?;
|
||||
let msg = build_gitlab_message(&event);
|
||||
debug!("Sending message to {}: {}", room_id, msg);
|
||||
|
Reference in New Issue
Block a user