Skip to content

Commit

Permalink
cffi & jsonrpc
Browse files Browse the repository at this point in the history
  • Loading branch information
Septias authored and Septias committed Apr 1, 2024
1 parent be63b56 commit 136db10
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 4 deletions.
10 changes: 7 additions & 3 deletions deltachat-ffi/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -566,6 +566,7 @@ pub unsafe extern "C" fn dc_event_get_id(event: *mut dc_event_t) -> libc::c_int
EventType::ConfigSynced { .. } => 2111,
EventType::WebxdcStatusUpdate { .. } => 2120,
EventType::WebxdcInstanceDeleted { .. } => 2121,
EventType::WebxdcEphemeralStatusUpdate { .. } => 2150,
EventType::AccountsBackgroundFetchDone => 2200,
}
}
Expand Down Expand Up @@ -618,8 +619,9 @@ pub unsafe extern "C" fn dc_event_get_data1_int(event: *mut dc_event_t) -> libc:
| EventType::SecurejoinJoinerProgress { contact_id, .. } => {
contact_id.to_u32() as libc::c_int
}
EventType::WebxdcStatusUpdate { msg_id, .. } => msg_id.to_u32() as libc::c_int,
EventType::WebxdcInstanceDeleted { msg_id, .. } => msg_id.to_u32() as libc::c_int,
EventType::WebxdcEphemeralStatusUpdate { msg_id, .. }
| EventType::WebxdcStatusUpdate { msg_id, .. }
| EventType::WebxdcInstanceDeleted { msg_id, .. } => msg_id.to_u32() as libc::c_int,
}
}

Expand Down Expand Up @@ -653,7 +655,8 @@ pub unsafe extern "C" fn dc_event_get_data2_int(event: *mut dc_event_t) -> libc:
| EventType::MsgsNoticed(_)
| EventType::ConnectivityChanged
| EventType::WebxdcInstanceDeleted { .. }
| EventType::IncomingMsgBunch { .. }
| EventType::WebxdcEphemeralStatusUpdate { .. } => 0,
EventType::IncomingMsgBunch { .. }
| EventType::SelfavatarChanged
| EventType::AccountsBackgroundFetchDone
| EventType::ConfigSynced { .. } => 0,
Expand Down Expand Up @@ -718,6 +721,7 @@ pub unsafe extern "C" fn dc_event_get_data2_str(event: *mut dc_event_t) -> *mut
| EventType::SelfavatarChanged
| EventType::WebxdcStatusUpdate { .. }
| EventType::WebxdcInstanceDeleted { .. }
| EventType::WebxdcEphemeralStatusUpdate { .. }
| EventType::AccountsBackgroundFetchDone
| EventType::ChatEphemeralTimerModified { .. }
| EventType::IncomingMsgBunch { .. } => ptr::null_mut(),
Expand Down
2 changes: 1 addition & 1 deletion deltachat-jsonrpc/src/api.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1730,7 +1730,7 @@ impl CommandApi {
instance_msg_id: u32,
) -> Result<()> {
let ctx = self.get_context(account_id).await?;
ctx.send_gossip_advertisement(&MsgId::new(instance_msg_id))
ctx.send_gossip_advertisement(MsgId::new(instance_msg_id))
.await
}

Expand Down
4 changes: 4 additions & 0 deletions deltachat-jsonrpc/src/api/types/message.rs
Original file line number Diff line number Diff line change
Expand Up @@ -360,6 +360,9 @@ pub enum SystemMessageType {

/// Webxdc info added with `info` set in `send_webxdc_status_update()`.
WebxdcInfoMessage,

/// This message contains a users iroh public key.
IrohGossipAdvertisement,
}

impl From<deltachat::mimeparser::SystemMessage> for SystemMessageType {
Expand All @@ -382,6 +385,7 @@ impl From<deltachat::mimeparser::SystemMessage> for SystemMessageType {
SystemMessage::WebxdcStatusUpdate => SystemMessageType::WebxdcStatusUpdate,
SystemMessage::WebxdcInfoMessage => SystemMessageType::WebxdcInfoMessage,
SystemMessage::InvalidUnencryptedMail => SystemMessageType::InvalidUnencryptedMail,
SystemMessage::IrohGossipAdvertisement => SystemMessageType::IrohGossipAdvertisement,
}
}
}
Expand Down

0 comments on commit 136db10

Please sign in to comment.