mirror of
https://github.com/deltachat/deltachat-android.git
synced 2025-10-03 09:49:21 +02:00
Merge pull request #1107 from deltachat/clippy2
adapt to device-messages api
This commit is contained in:
commit
12a138e85c
7 changed files with 31 additions and 1 deletions
|
@ -656,6 +656,12 @@ JNIEXPORT jint Java_com_b44t_messenger_DcContext_sendTextMsg(JNIEnv *env, jobjec
|
|||
}
|
||||
|
||||
|
||||
JNIEXPORT jint Java_com_b44t_messenger_DcContext_addDeviceMsg(JNIEnv *env, jobject obj, jobject msg)
|
||||
{
|
||||
return dc_add_device_msg(get_dc_context(env, obj), get_dc_msg(env, msg));
|
||||
}
|
||||
|
||||
|
||||
/* DcContext - handle config */
|
||||
|
||||
JNIEXPORT void Java_com_b44t_messenger_DcContext_setConfig(JNIEnv *env, jobject obj, jstring key, jstring value /*may be NULL*/)
|
||||
|
@ -1058,6 +1064,18 @@ JNIEXPORT jboolean Java_com_b44t_messenger_DcChat_isSelfTalk(JNIEnv *env, jobjec
|
|||
}
|
||||
|
||||
|
||||
JNIEXPORT jboolean Java_com_b44t_messenger_DcChat_isDeviceTalk(JNIEnv *env, jobject obj)
|
||||
{
|
||||
return dc_chat_is_device_talk(get_dc_chat(env, obj))!=0;
|
||||
}
|
||||
|
||||
|
||||
JNIEXPORT jboolean Java_com_b44t_messenger_DcChat_canSend(JNIEnv *env, jobject obj)
|
||||
{
|
||||
return dc_chat_can_send(get_dc_chat(env, obj))!=0;
|
||||
}
|
||||
|
||||
|
||||
JNIEXPORT jboolean Java_com_b44t_messenger_DcChat_isVerified(JNIEnv *env, jobject obj)
|
||||
{
|
||||
return dc_chat_is_verified(get_dc_chat(env, obj))!=0;
|
||||
|
|
|
@ -169,6 +169,8 @@
|
|||
<string name="menu_zoom_out">Zoom out</string>
|
||||
<string name="menu_save_log">Save log</string>
|
||||
<string name="title_share_location">Share location with all group members</string>
|
||||
<string name="device_talk">Device Messages</string>
|
||||
<string name="device_talk_subtitle">Locally generated messages</string>
|
||||
|
||||
<string name="mute_for_one_hour">Mute for 1 hour</string>
|
||||
<string name="mute_for_two_hours">Mute for 2 hours</string>
|
||||
|
|
|
@ -27,6 +27,8 @@ public class DcChat {
|
|||
public native int getColor ();
|
||||
public native boolean isUnpromoted ();
|
||||
public native boolean isSelfTalk ();
|
||||
public native boolean isDeviceTalk ();
|
||||
public native boolean canSend ();
|
||||
public native boolean isVerified ();
|
||||
public native boolean isSendingLocations();
|
||||
|
||||
|
|
|
@ -156,6 +156,7 @@ public class DcContext {
|
|||
public native int prepareMsg (int chat_id, DcMsg msg);
|
||||
public native int sendMsg (int chat_id, DcMsg msg);
|
||||
public native int sendTextMsg (int chat_id, String text);
|
||||
public native int addDeviceMsg (DcMsg msg);
|
||||
public native int checkQrCPtr (String qr);
|
||||
public @NonNull DcLot checkQr (String qr) { return new DcLot(checkQrCPtr(qr)); }
|
||||
public native String getSecurejoinQr (int chat_id);
|
||||
|
|
|
@ -840,8 +840,11 @@ public class ConversationActivity extends PassphraseRequiredActionBarActivity
|
|||
conversationContainer.setClipToPadding(true);
|
||||
}
|
||||
|
||||
if(chatId == DcChat.DC_CHAT_ID_DEADDROP) {
|
||||
if (!dcChat.canSend()) {
|
||||
composePanel.setVisibility(View.GONE);
|
||||
}
|
||||
|
||||
if (chatId == DcChat.DC_CHAT_ID_DEADDROP) {
|
||||
titleView.hideAvatar();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -136,6 +136,9 @@ public class ConversationTitleView extends RelativeLayout {
|
|||
if( dcChat.isSelfTalk() ) {
|
||||
subtitle = context.getString(R.string.chat_self_talk_subtitle);
|
||||
}
|
||||
else if( dcChat.isDeviceTalk() ) {
|
||||
subtitle = context.getString(R.string.device_talk_subtitle);
|
||||
}
|
||||
else {
|
||||
subtitle = dcContext.getContact(chatContacts[0]).getAddr();
|
||||
}
|
||||
|
|
|
@ -148,6 +148,7 @@ public class ApplicationDcContext extends DcContext {
|
|||
setStockTranslation(61, context.getString(R.string.login_error_server_response));
|
||||
setStockTranslation(62, context.getString(R.string.systemmsg_action_by_user));
|
||||
setStockTranslation(63, context.getString(R.string.systemmsg_action_by_me));
|
||||
setStockTranslation(68, context.getString(R.string.device_talk));
|
||||
}
|
||||
|
||||
public File getImexDir() {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue