mirror of
https://github.com/deltachat/deltachat-android.git
synced 2025-10-03 09:49:21 +02:00
mark bots in chat title and profile as such
This commit is contained in:
parent
2c5bbcf75e
commit
50e66c7e66
5 changed files with 15 additions and 2 deletions
|
@ -1857,6 +1857,11 @@ JNIEXPORT jint Java_com_b44t_messenger_DcContact_getVerifierId(JNIEnv *env, jobj
|
|||
return dc_contact_get_verifier_id(get_dc_contact(env, obj));
|
||||
}
|
||||
|
||||
JNIEXPORT jboolean Java_com_b44t_messenger_DcContact_isBot(JNIEnv *env, jobject obj)
|
||||
{
|
||||
return dc_contact_is_bot(get_dc_contact(env, obj)) != 0;
|
||||
}
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
* DcLot
|
||||
|
|
|
@ -58,6 +58,7 @@ public class DcContact {
|
|||
public native boolean isBlocked ();
|
||||
public native boolean isVerified ();
|
||||
public native int getVerifierId ();
|
||||
public native boolean isBot ();
|
||||
|
||||
// working with raw c-data
|
||||
private long contactCPtr; // CAVE: the name is referenced in the JNI
|
||||
|
|
|
@ -104,7 +104,9 @@ public class ConversationTitleView extends RelativeLayout {
|
|||
}
|
||||
else {
|
||||
DcContact dcContact = dcContext.getContact(chatContacts[0]);
|
||||
if (profileView || !dcChat.isProtected()) {
|
||||
if (!profileView && dcContact.isBot()) {
|
||||
subtitleStr = context.getString(R.string.bot);
|
||||
} else if (profileView || !dcChat.isProtected()) {
|
||||
subtitleStr = dcContact.getAddr();
|
||||
}
|
||||
isOnline = dcContact.wasSeenRecently();
|
||||
|
|
|
@ -368,8 +368,12 @@ public class ProfileActivity extends PassphraseRequiredActionBarActivity
|
|||
if (chatIsDeviceTalk) {
|
||||
return getString(R.string.profile);
|
||||
} else if(isContactProfile()) {
|
||||
if (dcContext.getContact(contactId).isBot()) {
|
||||
return getString(R.string.bot);
|
||||
} else {
|
||||
return getString(R.string.tab_contact);
|
||||
}
|
||||
}
|
||||
else if (chatIsBroadcast) {
|
||||
return getString(R.string.broadcast_list);
|
||||
}
|
||||
|
|
|
@ -162,6 +162,7 @@
|
|||
<string name="video">Video</string>
|
||||
<string name="documents">Documents</string>
|
||||
<string name="contact">Contact</string>
|
||||
<string name="bot">Bot</string>
|
||||
<string name="camera">Camera</string>
|
||||
<!-- As in "start a video recording" or "take a photo"; eg. the description of the "shutter button" in cameras -->
|
||||
<string name="capture">Capture</string>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue