浏览代码

presence: return on having a full match on states in xml document

- better handling after previous commit, related to GH #1427
Daniel-Constantin Mierla 7 年之前
父节点
当前提交
92451536a0
共有 1 个文件被更改,包括 3 次插入2 次删除
  1. 3 2
      src/modules/presence/presentity.c

+ 3 - 2
src/modules/presence/presentity.c

@@ -338,6 +338,7 @@ int ps_match_dialog_state_from_body(str body, int *is_dialog, char *vstate)
 		if (tmp_state != NULL)
 		{
 			if(strcmp(tmp_state, vstate)!=0) {
+				/* state not matched */
 				xmlFree(tmp_state);
 				rmatch = 0;
 				goto done;
@@ -550,8 +551,8 @@ int ps_match_dialog_state(presentity_t* presentity, char* vstate)
 		rmatch = ps_match_dialog_state_from_body(tmp_db_body,
 				&db_is_dialog, vstate);
 
-		if(rmatch<=0) {
-			/* failure or not a match */
+		if(rmatch==1) {
+			/* having a full match */
 			pa_dbf.free_result(pa_db, result);
 			result = NULL;
 			return rmatch;