remove 'description' parameter from webxdc's sendUpdate()

the 'description' parameter is about to be deprecated,
see https://github.com/deltachat/deltachat-core-rust/issues/6245
This commit is contained in:
adbenitez 2024-11-24 21:34:22 +01:00
parent d5ea043893
commit fbf88e102b
4 changed files with 7 additions and 9 deletions

View file

@ -729,12 +729,10 @@ JNIEXPORT jint Java_com_b44t_messenger_DcContext_sendVideochatInvitation(JNIEnv
}
JNIEXPORT jboolean Java_com_b44t_messenger_DcContext_sendWebxdcStatusUpdate(JNIEnv *env, jobject obj, jint msg_id, jstring payload, jstring descr)
JNIEXPORT jboolean Java_com_b44t_messenger_DcContext_sendWebxdcStatusUpdate(JNIEnv *env, jobject obj, jint msg_id, jstring payload)
{
CHAR_REF(payload);
CHAR_REF(descr);
jboolean ret = dc_send_webxdc_status_update(get_dc_context(env, obj), msg_id, payloadPtr, descrPtr) != 0;
CHAR_UNREF(descr);
jboolean ret = dc_send_webxdc_status_update(get_dc_context(env, obj), msg_id, payloadPtr, NULL) != 0;
CHAR_UNREF(payload);
return ret;
}

View file

@ -203,7 +203,7 @@ public class DcContext {
public native int sendMsg (int chat_id, DcMsg msg);
public native int sendTextMsg (int chat_id, String text);
public native int sendVideochatInvitation(int chat_id);
public native boolean sendWebxdcStatusUpdate(int msg_id, String payload, String descr);
public native boolean sendWebxdcStatusUpdate(int msg_id, String payload);
public native String getWebxdcStatusUpdates(int msg_id, int last_known_serial);
public native void setWebxdcIntegration (String file);
public native int initWebxdcIntegration(int chat_id);

View file

@ -486,9 +486,9 @@ public class WebxdcActivity extends WebViewActivity implements DcEventCenter.DcE
/** @noinspection unused*/
@JavascriptInterface
public boolean sendStatusUpdate(String payload, String descr) {
public boolean sendStatusUpdate(String payload) {
Log.i(TAG, "sendStatusUpdate");
if (!WebxdcActivity.this.dcContext.sendWebxdcStatusUpdate(WebxdcActivity.this.dcAppMsg.getId(), payload, descr)) {
if (!WebxdcActivity.this.dcContext.sendWebxdcStatusUpdate(WebxdcActivity.this.dcAppMsg.getId(), payload)) {
DcChat dcChat = WebxdcActivity.this.dcContext.getChat(WebxdcActivity.this.dcAppMsg.getChatId());
Toast.makeText(WebxdcActivity.this,
dcChat.isContactRequest() ?

View file

@ -68,8 +68,8 @@ window.webxdc = (() => {
return Promise.resolve([]);
},
sendUpdate: (payload, descr) => {
InternalJSApi.sendStatusUpdate(JSON.stringify(payload), descr);
sendUpdate: (payload) => {
InternalJSApi.sendStatusUpdate(JSON.stringify(payload));
},
sendToChat: async (message) => {