summaryrefslogtreecommitdiff
path: root/agent/agent.c
diff options
context:
space:
mode:
authorOlivier CrĂȘte <olivier.crete@collabora.com>2017-06-21 16:55:32 -0400
committerOlivier CrĂȘte <olivier.crete@collabora.com>2017-06-21 16:55:32 -0400
commite3ddaa285e389baf3f26cfb6964919718a8f6a00 (patch)
tree763884d5cc7a6e926d55718ea234c5484c1fe494 /agent/agent.c
parentc7a5a92b66f9b83baf2aa446966bdfb2cf39ecd1 (diff)
downloadlibnice-e3ddaa285e389baf3f26cfb6964919718a8f6a00.tar.gz
agent: Adjust the nice_agent_new_full() to use flags
This makes it easier to read and more extensible.
Diffstat (limited to 'agent/agent.c')
-rw-r--r--agent/agent.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/agent/agent.c b/agent/agent.c
index 27e6193..8fd8ead 100644
--- a/agent/agent.c
+++ b/agent/agent.c
@@ -1168,14 +1168,15 @@ nice_agent_new_reliable (GMainContext *ctx, NiceCompatibility compat)
NICEAPI_EXPORT NiceAgent *
nice_agent_new_full (GMainContext *ctx,
NiceCompatibility compat,
- gboolean reliable,
- NiceNominationMode nomination)
+ NiceAgentOption flags)
{
NiceAgent *agent = g_object_new (NICE_TYPE_AGENT,
"compatibility", compat,
"main-context", ctx,
- "reliable", reliable,
- "nomination-mode", nomination,
+ "reliable", (flags & NICE_AGENT_OPTION_RELIABLE) ? TRUE : FALSE,
+ "nomination-mode", (flags & NICE_AGENT_OPTION_REGULAR_NOMINATION) ?
+ NICE_NOMINATION_MODE_REGULAR : NICE_NOMINATION_MODE_AGGRESSIVE,
+ "full-mode", (flags & NICE_AGENT_OPTION_LITE_MODE) ? FALSE : TRUE,
NULL);
return agent;