adapt to new c-api

This commit is contained in:
B. Petersen
2017-11-22 14:34:41 +01:00
parent 1c77b0bf4e
commit ba1c32fe05
5 changed files with 17 additions and 10 deletions
+10 -4
View File
@@ -767,9 +767,9 @@ JNIEXPORT jstring Java_com_b44t_messenger_MrChat_getProfileImage(JNIEnv *env, jo
}
JNIEXPORT jboolean Java_com_b44t_messenger_MrChat_getUnpromoted(JNIEnv *env, jobject obj)
JNIEXPORT jboolean Java_com_b44t_messenger_MrChat_isUnpromoted(JNIEnv *env, jobject obj)
{
return mrchat_get_unpromoted(get_mrchat_t(env, obj)) != 0;
return mrchat_is_unpromoted(get_mrchat_t(env, obj)) != 0;
}
@@ -1010,9 +1010,15 @@ JNIEXPORT jlong Java_com_b44t_messenger_MrMsg_getMediainfoCPtr(JNIEnv *env, jobj
}
JNIEXPORT jint Java_com_b44t_messenger_MrMsg_isIncreation(JNIEnv *env, jobject obj)
JNIEXPORT jboolean Java_com_b44t_messenger_MrMsg_isIncreation(JNIEnv *env, jobject obj)
{
return (jint)mrmsg_is_increation(get_mrmsg_t(env, obj));
return mrmsg_is_increation(get_mrmsg_t(env, obj)) != 0;
}
JNIEXPORT jboolean Java_com_b44t_messenger_MrMsg_isSystemcmd(JNIEnv *env, jobject obj)
{
return mrmsg_is_systemcmd(get_mrmsg_t(env, obj)) != 0;
}
@@ -1052,7 +1052,7 @@ public class ChatMessageCell extends BaseCell implements SeekBar.SeekBarDelegate
int minutes = duration / 60;
int seconds = duration - minutes * 60;
String infoString = String.format("%d:%02d, %s", minutes, seconds, formatFileSize(documentAttach.size));
if( MrMailbox.getMsg(messageObject.getId()).isIncreation()!=0 ) {
if( MrMailbox.getMsg(messageObject.getId()).isIncreation() ) {
infoString = ApplicationLoader.applicationContext.getString(R.string.OneMoment);
}
infoWidth = (int) Math.ceil(infoPaint.measureText(infoString));
@@ -848,7 +848,7 @@ public class ChatActivity extends BaseFragment implements NotificationCenter.Not
TextView emptyView = new TextView(context);
if( m_mrChat.getUnpromoted() ) {
if( m_mrChat.isUnpromoted() ) {
emptyView.setText(context.getString(R.string.MsgNewGroupDraftHint));
emptyView.setGravity(Gravity.START);
}
@@ -2760,7 +2760,7 @@ public class ChatActivity extends BaseFragment implements NotificationCenter.Not
public void didPressedImage(ChatMessageCell cell) {
MessageObject message = cell.getMessageObject();
if( message.type == MessageObject.MO_TYPE3_VIDEO && MrMailbox.getMsg(message.getId()).isIncreation()!=0 ) {
if( message.type == MessageObject.MO_TYPE3_VIDEO && MrMailbox.getMsg(message.getId()).isIncreation() ) {
return; // we're not ready (still compressing), a hint is already shown in the message itself
}
@@ -55,7 +55,7 @@ public class MrChat {
public native String getSubtitle();
public native String getProfileImage();
public native boolean getUnpromoted();
public native boolean isUnpromoted();
public String getDraft() {
return MrChatGetDraft(m_hChat);
@@ -108,7 +108,8 @@ public class MrMsg {
public MrPoortext getMediainfo() { return new MrPoortext(getMediainfoCPtr()); }
private native long getMediainfoCPtr();
public native String getFilename();
public native int isIncreation();
public native boolean isIncreation();
public native boolean isSystemcmd();
private long m_hMsg; // must not be renamed as referenced by JNI under the name "m_hMsg"
private native static void MrMsgUnref (long hMsg);
@@ -152,7 +153,7 @@ public class MrMsg {
ret.out = ret.from_id==MrContact.MR_CONTACT_ID_SELF; // true=outgoing message, read eg. in MessageObject.isOutOwner()
ret.created_by_mr = true;
ret.show_padlock = showPadlock()!=0;
ret.is_system_cmd = getMsgParamInt('S', 0)!=0;
ret.is_system_cmd = isSystemcmd();
if( type == MR_MSG_TEXT ) {
ret.message = getText();