Files
arcanechat-android/src/com/b44t/messenger/DcChat.java
T
bjoern c814885f5c mailinglists3 (#1781)
* Adapt to mailing lists

* Change the question if this is a mailing list (untested)

* rm unused fn

* Adapt to getSenderName -> getOverrideSenderName (untested)

* Use dc_msg_get_sender_first_name() because sometimes the first name was not correctly shown in mailing lists

* Don't let the user modify mailing list groups

* Fix crash

* Make Unnamed newsletter translatable, make the subtitle of mailing lists "Mailing list"

* tweak and hide some controls for mailing lists

* Update src/com/b44t/messenger/DcChat.java

Co-authored-by: bjoern <r10s@b44t.com>

* adapt to new dc_msg_get_real_chat() api, remove dc_msg_get_sender_first_name()

* remove now dead code

* add mailing list name to contact-request-question

move question-creation to a helper class
to avoid duplicated code.

* fix DcMsg.getOverrideSenderName()

* adapt to new dc_decide_on_contact_request() api

* re-allow changing name+image for mailinglists, see recent discussions on PRs

* remove memberlist- and settings-tab from mailinglist profile until there is some use for them

* adapt to new DC_CHAT_TYPE_MAILINGLIST type

Co-authored-by: Hocuri <hocuri@gmx.de>
2021-02-07 23:39:48 +01:00

70 lines
2.3 KiB
Java

package com.b44t.messenger;
public class DcChat {
public static final int DC_CHAT_TYPE_UNDEFINED = 0;
public static final int DC_CHAT_TYPE_SINGLE = 100;
public static final int DC_CHAT_TYPE_GROUP = 120;
public static final int DC_CHAT_TYPE_MAILINGLIST = 140;
public static final int DC_CHAT_NO_CHAT = 0;
public final static int DC_CHAT_ID_DEADDROP = 1;
public final static int DC_CHAT_ID_ARCHIVED_LINK = 6;
public final static int DC_CHAT_ID_ALLDONE_HINT = 7;
public final static int DC_CHAT_ID_LAST_SPECIAL = 9;
public final static int DC_CHAT_VISIBILITY_NORMAL = 0;
public final static int DC_CHAT_VISIBILITY_ARCHIVED = 1;
public final static int DC_CHAT_VISIBILITY_PINNED = 2;
public DcChat(long chatCPtr) {
this.chatCPtr = chatCPtr;
}
@Override protected void finalize() throws Throwable {
super.finalize();
unrefChatCPtr();
chatCPtr = 0;
}
public native int getId ();
public native int getType ();
public native int getVisibility ();
public native String getName ();
public native String getProfileImage ();
public native int getColor ();
public native boolean isUnpromoted ();
public native boolean isSelfTalk ();
public native boolean isDeviceTalk ();
public native boolean canSend ();
public native boolean isProtected ();
public native boolean isSendingLocations();
public native boolean isMuted ();
// aliases and higher-level tools
public boolean isGroup() {
// isMultiUser() might fit better,
// however, would result in lots of code changes, so we leave this as is for now.
int type = getType();
return type == DC_CHAT_TYPE_GROUP || type == DC_CHAT_TYPE_MAILINGLIST;
}
public boolean isMailingList() {
return getType() == DC_CHAT_TYPE_MAILINGLIST;
}
public boolean canVideochat() {
return canSend() && !isGroup() && !isSelfTalk();
}
// working with raw c-data
private long chatCPtr; // CAVE: the name is referenced in the JNI
private native void unrefChatCPtr();
public long getChatCPtr () { return chatCPtr; }
}