Skip to content

Commit a6db7ba

Browse files
authored
api: deprecate webxdc descr parameter (#6255)
this PR removes most usages of the `descr` parameter. - to avoid noise in different branches etc. (as annoying on similar, at a first glance simple changes), i left the external API stable - also, the effort to do a database migration seems to be over the top, so the column is left and set to empty strings on future updates - maybe we can recycle the column at some point ;) closes #6245
1 parent 703cad9 commit a6db7ba

File tree

7 files changed

+63
-112
lines changed

7 files changed

+63
-112
lines changed

deltachat-ffi/deltachat.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1161,8 +1161,7 @@ uint32_t dc_send_videochat_invitation (dc_context_t* context, uint32_t chat_id);
11611161
* - `document`: optional document name. shown eg. in title bar.
11621162
* - `summary`: optional summary. shown beside app icon.
11631163
* - `notify`: optional array of other users `selfAddr` to be notified e.g. by a sound about `info` or `summary`.
1164-
* @param descr The user-visible description of JSON data,
1165-
* in case of a chess game, e.g. the move.
1164+
* @param descr Deprecated, set to NULL
11661165
* @return 1=success, 0=error
11671166
*/
11681167
int dc_send_webxdc_status_update (dc_context_t* context, uint32_t msg_id, const char* json, const char* descr);

deltachat-ffi/src/lib.rs

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1065,22 +1065,18 @@ pub unsafe extern "C" fn dc_send_webxdc_status_update(
10651065
context: *mut dc_context_t,
10661066
msg_id: u32,
10671067
json: *const libc::c_char,
1068-
descr: *const libc::c_char,
1068+
_descr: *const libc::c_char,
10691069
) -> libc::c_int {
10701070
if context.is_null() {
10711071
eprintln!("ignoring careless call to dc_send_webxdc_status_update()");
10721072
return 0;
10731073
}
10741074
let ctx = &*context;
10751075

1076-
block_on(ctx.send_webxdc_status_update(
1077-
MsgId::new(msg_id),
1078-
&to_string_lossy(json),
1079-
&to_string_lossy(descr),
1080-
))
1081-
.context("Failed to send webxdc update")
1082-
.log_err(ctx)
1083-
.is_ok() as libc::c_int
1076+
block_on(ctx.send_webxdc_status_update(MsgId::new(msg_id), &to_string_lossy(json)))
1077+
.context("Failed to send webxdc update")
1078+
.log_err(ctx)
1079+
.is_ok() as libc::c_int
10841080
}
10851081

10861082
#[no_mangle]

deltachat-jsonrpc/src/api.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1767,10 +1767,10 @@ impl CommandApi {
17671767
account_id: u32,
17681768
instance_msg_id: u32,
17691769
update_str: String,
1770-
description: String,
1770+
_descr: String,
17711771
) -> Result<()> {
17721772
let ctx = self.get_context(account_id).await?;
1773-
ctx.send_webxdc_status_update(MsgId::new(instance_msg_id), &update_str, &description)
1773+
ctx.send_webxdc_status_update(MsgId::new(instance_msg_id), &update_str)
17741774
.await
17751775
}
17761776

deltachat-repl/src/cmdline.rs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -969,9 +969,7 @@ pub async fn cmdline(context: Context, line: &str, chat_id: &mut ChatId) -> Resu
969969
"Arguments <msg-id> <json status update> expected"
970970
);
971971
let msg_id = MsgId::new(arg1.parse()?);
972-
context
973-
.send_webxdc_status_update(msg_id, arg2, "this is a webxdc status update")
974-
.await?;
972+
context.send_webxdc_status_update(msg_id, arg2).await?;
975973
}
976974
"videochat" => {
977975
ensure!(sel_chat.is_some(), "No chat selected.");

src/download.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -440,7 +440,7 @@ mod tests {
440440
let _sent1 = alice.send_msg(chat_id, &mut instance).await;
441441

442442
alice
443-
.send_webxdc_status_update(instance.id, r#"{"payload":7}"#, "d")
443+
.send_webxdc_status_update(instance.id, r#"{"payload":7}"#)
444444
.await?;
445445
alice.flush_status_updates().await?;
446446
let sent2 = alice.pop_sent_msg().await;

0 commit comments

Comments
 (0)