Skip to content

Commit

Permalink
shared tags: report them as active/backup, not 1/0
Browse files Browse the repository at this point in the history
  • Loading branch information
razvancrainea committed Oct 10, 2018
1 parent 00f6d23 commit 2401a0c
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
6 changes: 5 additions & 1 deletion modules/dialog/dlg_replication.c
Expand Up @@ -1590,7 +1590,11 @@ struct mi_root *mi_list_sharing_tags(struct mi_root *cmd_tree, void *param)
MI_SSTR("Tag"), tag->name.s, tag->name.len);
if (!node) goto error;

val.s = int2str(tag->state, &val.len);
if (tag->state == SHTAG_STATE_ACTIVE)
val.s = "active";
else
val.s = "backup";
val.len = strlen(val.s); /* or 6, but most likely it will get optimized */
attr = add_mi_attr(node, MI_DUP_VALUE,
MI_SSTR("State"), val.s, val.len);
if (!attr) goto error;
Expand Down
6 changes: 5 additions & 1 deletion modules/presence/sharing_tags.c
Expand Up @@ -318,7 +318,11 @@ int list_shtags(struct mi_node *rpl)
MI_SSTR("Tag"), tag->name.s, tag->name.len);
if (!node) goto error;

val.s = int2str(tag->state, &val.len);
if (tag->state == SHTAG_STATE_ACTIVE)
val.s = "active";
else
val.s = "backup";
val.len = strlen(val.s); /* or 6, but most likely it will get optimized */
attr = add_mi_attr(node, MI_DUP_VALUE,
MI_SSTR("State"), val.s, val.len);
if (!attr) goto error;
Expand Down

0 comments on commit 2401a0c

Please sign in to comment.