Skip to content

Commit

Permalink
Presence: semantical improvments to docs & rpc command name
Browse files Browse the repository at this point in the history
  • Loading branch information
false-vacuum authored and miconda committed Jun 12, 2023
1 parent 5197e7b commit 07f86a5
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 11 deletions.
8 changes: 4 additions & 4 deletions src/modules/presence/doc/presence_admin.xml
Original file line number Diff line number Diff line change
Expand Up @@ -1286,21 +1286,21 @@ pres_update_watchers("sip:test@kamailio.org", "presence");
</section>

<section>
<section id="presence.r.htable_db_restore">
<section id="presence.r.publish_cache_sync">
<title>presence.htable_db_restore</title>
<para>
Manually apply changes to the presenity table to the publ_cache.
Synchronize changes made to the presentity table with the publish cache.
</para>
<para>
Name: <emphasis>presence.htable_db_restore</emphasis>
Name: <emphasis>presence.publish_cache_sync</emphasis>
</para>
<para>Parameters: <emphasis>none</emphasis></para>
<para>
RPC Command Format:
</para>
<programlisting format="linespecific">
...
&kamcmd; presence.htable_db_restore
&kamcmd; presence.publish_cache_sync
...
</programlisting>
</section>
Expand Down
16 changes: 9 additions & 7 deletions src/modules/presence/presence.c
Original file line number Diff line number Diff line change
Expand Up @@ -1855,15 +1855,17 @@ static const char *rpc_presence_cleanup_doc[3] = {
0};


void rpc_presence_htable_db_restore(rpc_t *rpc, void *c)
void rpc_presence_publish_cache_sync(rpc_t *rpc, void *ctx)
{
LM_DBG("Restoring presence publ cache from database.\n");
pres_htable_db_restore();
LM_DBG("Synchronizing presentity table with the publish cache.\n");
if (pres_htable_db_restore() == -1 ) {
rpc->fault(ctx, 500, "Failed to sync presinity table with the publish cache.");
};
return;
}

static const char *rpc_presence_htable_db_restore_doc[4] = {
"Sync publ_cache from database. Syncs changes made to presentity table with the publ_cache.",
static const char *rpc_presence_publish_cache_sync_doc[4] = {
"Syncs changes made to presentity table with the publish cache.",
0
};

Expand Down Expand Up @@ -2133,8 +2135,8 @@ static const char *rpc_presence_watcher_list_doc[2] = {


rpc_export_t presence_rpc[] = {
{"presence.htable_db_restore", rpc_presence_htable_db_restore,
rpc_presence_htable_db_restore_doc, 0},
{"presence.publish_cache_sync", rpc_presence_publish_cache_sync,
rpc_presence_publish_cache_sync_doc, 0},
{"presence.cleanup", rpc_presence_cleanup, rpc_presence_cleanup_doc, 0},
{"presence.refreshWatchers", rpc_presence_refresh_watchers,
rpc_presence_refresh_watchers_doc, 0},
Expand Down

0 comments on commit 07f86a5

Please sign in to comment.