Skip to content
Snippets Groups Projects
Commit f6a48f89 authored by Olivier Dion's avatar Olivier Dion Committed by Adrien Béraud
Browse files

agent/bindings/account: Add bindings

Change-Id: Ifc363fee36bd10fba9211cddaa03d6fbd8e99d49
parent d1829197
No related branches found
No related tags found
No related merge requests found
......@@ -23,6 +23,7 @@
/* Jami */
#include "jami/callmanager_interface.h"
#include "jami/configurationmanager_interface.h"
#include "jami/presencemanager_interface.h"
/* Agent */
#include "utils.h"
......@@ -67,7 +68,8 @@ static SCM export_to_file_binding(SCM accountID_str, SCM path_str, SCM passwd_st
from_guile(passwd_str_optional)));
}
static SCM add_account_binding(SCM details_alist, SCM accountID_str_optional)
static SCM
add_account_binding(SCM details_alist, SCM accountID_str_optional)
{
LOG_BINDING();
......@@ -79,6 +81,50 @@ static SCM add_account_binding(SCM details_alist, SCM accountID_str_optional)
from_guile(accountID_str_optional)));
}
static SCM
accept_trust_request_binding(SCM accountID_str, SCM from_uri_str)
{
LOG_BINDING();
return to_guile(DRing::acceptTrustRequest(from_guile(accountID_str),
from_guile(from_uri_str)));
}
static SCM
send_trust_request_binding(SCM accountID_str, SCM to_uri_str, SCM payload_vector_uint8_optional)
{
LOG_BINDING();
if (SCM_UNBNDP(payload_vector_uint8_optional)) {
payload_vector_uint8_optional = scm_c_make_vector(0, SCM_UNDEFINED);
}
DRing::sendTrustRequest(from_guile(accountID_str),
from_guile(to_uri_str),
from_guile(payload_vector_uint8_optional));
return SCM_UNDEFINED;
}
static SCM
get_contacts_binding(SCM accountID_str)
{
LOG_BINDING();
return to_guile(DRing::getContacts(from_guile(accountID_str)));
}
static SCM
subscribe_buddy_binding(SCM accountID_str, SCM peer_uri_str, SCM flag_bool)
{
LOG_BINDING();
DRing::subscribeBuddy(from_guile(accountID_str),
from_guile(peer_uri_str),
from_guile(flag_bool));
return SCM_UNDEFINED;
}
static void
install_account_primitives(void *)
{
......@@ -87,4 +133,8 @@ install_account_primitives(void *)
define_primitive("send-register", 2, 0, 0, (void*) send_register_binding);
define_primitive("account->archive", 2, 1, 0, (void*) export_to_file_binding);
define_primitive("add", 1, 1, 0, (void*) add_account_binding);
define_primitive("accept-trust-request", 2, 0, 0, (void*) accept_trust_request_binding);
define_primitive("send-trust-request", 2, 1, 0, (void*) send_trust_request_binding);
define_primitive("get-contacts", 1, 0, 0, (void*) get_contacts_binding);
define_primitive("subscribe-buddy", 3, 0, 0, (void*) subscribe_buddy_binding);
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment