mirror of
https://github.com/ArcaneChat/android.git
synced 2026-07-03 14:05:24 +02:00
717777f628
* Rename "broadcast list" to "channel"/"broadcast channel" both in UI and code * feat: Add new channel types * Update CHANGELOG.md * adb's review * refactor: Rename BroadcastChannel to Broadcast * Revert accidental change * Make it possible to leave channels - In a chat, if the chat is an InBroadcast, and it's not a contact request, then the `Leave` menu option is shown with the translated stock string `menu_leave_channel` as its label. - If the user clicks on it, the confirmation dialog has `menu_leave_channel` (rather than `menu_leave_group`) as its positive option. Counterpart of https://github.com/chatmail/core/pull/6984. --------- Co-authored-by: adbenitez <asieldbenitez@gmail.com> Co-authored-by: adb <adb@merlinux.eu>
68 lines
2.3 KiB
Java
68 lines
2.3 KiB
Java
package com.b44t.messenger;
|
|
|
|
public class DcContact {
|
|
|
|
public final static int DC_CONTACT_ID_SELF = 1;
|
|
public final static int DC_CONTACT_ID_INFO = 2;
|
|
public final static int DC_CONTACT_ID_DEVICE = 5;
|
|
public final static int DC_CONTACT_ID_LAST_SPECIAL = 9;
|
|
public final static int DC_CONTACT_ID_NEW_CLASSIC_CONTACT= -1; // used by the UI, not valid to the core
|
|
public final static int DC_CONTACT_ID_NEW_GROUP = -2; // - " -
|
|
public final static int DC_CONTACT_ID_ADD_MEMBER = -3; // - " -
|
|
public final static int DC_CONTACT_ID_QR_INVITE = -4; // - " -
|
|
public final static int DC_CONTACT_ID_NEW_BROADCAST = -5; // - " -
|
|
public final static int DC_CONTACT_ID_ADD_ACCOUNT = -6; // - " -
|
|
|
|
public DcContact(long contactCPtr) {
|
|
this.contactCPtr = contactCPtr;
|
|
}
|
|
|
|
@Override
|
|
protected void finalize() throws Throwable {
|
|
super.finalize();
|
|
unrefContactCPtr();
|
|
contactCPtr = 0;
|
|
}
|
|
|
|
|
|
@Override
|
|
public boolean equals(Object other) {
|
|
if (other == null || !(other instanceof DcContact)) {
|
|
return false;
|
|
}
|
|
|
|
DcContact that = (DcContact) other;
|
|
return this.getId()==that.getId();
|
|
}
|
|
|
|
@Override
|
|
public int hashCode() {
|
|
return this.getId();
|
|
}
|
|
|
|
@Override
|
|
public String toString() {
|
|
return getAddr();
|
|
}
|
|
|
|
public native int getId ();
|
|
public native String getName ();
|
|
public native String getAuthName ();
|
|
public native String getDisplayName ();
|
|
public native String getAddr ();
|
|
public native String getProfileImage();
|
|
public native int getColor ();
|
|
public native String getStatus ();
|
|
public native long getLastSeen ();
|
|
public native boolean wasSeenRecently();
|
|
public native boolean isBlocked ();
|
|
public native boolean isVerified ();
|
|
public native boolean isKeyContact ();
|
|
public native int getVerifierId ();
|
|
public native boolean isBot ();
|
|
|
|
// working with raw c-data
|
|
private long contactCPtr; // CAVE: the name is referenced in the JNI
|
|
private native void unrefContactCPtr();
|
|
}
|