No need for contact related API functions

This commit is contained in:
Juha Heinanen
2021-04-03 17:42:20 +03:00
parent 27c3796fe6
commit 10a09d15f3
3 changed files with 0 additions and 26 deletions

View File

@ -1575,28 +1575,6 @@ Java_com_tutpro_baresip_Api_video_1codecs(JNIEnv *env, jobject thiz)
return (*env)->NewStringUTF(env, codec_buf);
}
JNIEXPORT void JNICALL
Java_com_tutpro_baresip_Api_contact_1add(JNIEnv *env, jobject thiz, jstring javaContact) {
struct pl pl_addr;
const char *native_contact = (*env)->GetStringUTFChars(env, javaContact, 0);
pl_set_str(&pl_addr, native_contact);
if (contact_add(baresip_contacts(), NULL, &pl_addr) != 0) {
LOGE("failed to add contact %s\n", native_contact);
} else {
LOGD("added contact %s\n", native_contact);
}
(*env)->ReleaseStringUTFChars(env, javaContact, native_contact);
}
JNIEXPORT void JNICALL
Java_com_tutpro_baresip_Api_contacts_1remove(JNIEnv *env, jobject thiz) {
struct le *le;
while ((le = list_head(contact_list(baresip_contacts())))) {
struct contact *c = le->data;
contact_remove(baresip_contacts(), c);
}
}
JNIEXPORT void JNICALL
Java_com_tutpro_baresip_Api_log_1level_1set(JNIEnv *env, jobject thiz, jint level) {
const enum log_level native_level = (enum log_level)level;

View File

@ -68,9 +68,6 @@ object Api {
external fun message_send(uap: String, peer_uri: String, message: String, time: String): Int
external fun contact_add(contact: String)
external fun contacts_remove()
external fun audio_codecs(): String
external fun video_codecs(): String

View File

@ -31,7 +31,6 @@ class Contact(var name: String, var uri: String, var color: Int, val id: Long) {
val content = Utils.getFileContents(BaresipService.filesPath + "/contacts")
?: return false
val contacts = String(content)
Api.contacts_remove()
BaresipService.contacts.clear()
var contactNo = 0
val baseId = System.currentTimeMillis()