Browse code

updated jabber module to pass contact (actually to) to PA

Jamey Hicks authored on 01/04/2004 17:51:15
Showing 4 changed files
... ...
@@ -690,7 +690,7 @@ void xj_register_watcher(str *from, str *to, void *cbf, void *pp)
690 690
 
691 691
 #ifdef XJ_EXTRA_DEBUG
692 692
 	DBG("XJAB:xj_register_watcher: from=[%.*s] to=[%.*s]\n", from->len,
693
-			from->s, to->len, to->s);
693
+	    from->s, to->len, to->s);
694 694
 #endif
695 695
 	from_uri.s = from->s;
696 696
 	from_uri.len = from->len;
... ...
@@ -710,10 +710,10 @@ void xj_register_watcher(str *from, str *to, void *cbf, void *pp)
710 710
 	}
711 711
 	
712 712
 	//putting the SIP message parts in share memory to be accessible by workers
713
-    jsmsg = (xj_sipmsg)shm_malloc(sizeof(t_xj_sipmsg));
713
+	jsmsg = (xj_sipmsg)shm_malloc(sizeof(t_xj_sipmsg));
714 714
 	memset(jsmsg, 0, sizeof(t_xj_sipmsg));
715
-    if(jsmsg == NULL)
716
-    	goto error;
715
+	if(jsmsg == NULL)
716
+		goto error;
717 717
 	
718 718
 	jsmsg->msg.len = 0;
719 719
 	jsmsg->msg.s = NULL;
... ...
@@ -728,7 +728,7 @@ void xj_register_watcher(str *from, str *to, void *cbf, void *pp)
728 728
 	}
729 729
 #ifdef XJ_EXTRA_DEBUG
730 730
 	DBG("XJAB:xj_register_watcher: DESTINATION after correction [%.*s].\n",
731
-				to_uri.len, to_uri.s);
731
+	    to_uri.len, to_uri.s);
732 732
 #endif
733 733
 
734 734
 	jsmsg->to.len = to_uri.len;
... ...
@@ -751,7 +751,7 @@ void xj_register_watcher(str *from, str *to, void *cbf, void *pp)
751 751
 
752 752
 #ifdef XJ_EXTRA_DEBUG
753 753
 	DBG("XJAB:xj_register_watcher:%d: sending <%p> to worker through <%d>\n",
754
-			getpid(), jsmsg, pipe);
754
+	    getpid(), jsmsg, pipe);
755 755
 #endif
756 756
 	// sending the SHM pointer of SIP message to the worker
757 757
 	fl = write(pipe, &jsmsg, sizeof(jsmsg));
... ...
@@ -765,7 +765,7 @@ void xj_register_watcher(str *from, str *to, void *cbf, void *pp)
765 765
 		goto error;
766 766
 	}
767 767
 	
768
-error:
768
+ error:
769 769
 	return;
770 770
 }
771 771
 
... ...
@@ -55,7 +55,7 @@
55 55
 #define XJ_FLAG_OPEN		0
56 56
 #define XJ_FLAG_CLOSE		1
57 57
 
58
-typedef void (*pa_callback_f)(str* _user, int _state, void *p);
58
+typedef void (*pa_callback_f)(str* _user, str* _contact, int _state, void *p);
59 59
 
60 60
 /**********             ***/
61 61
 
... ...
@@ -268,7 +268,7 @@ void xj_pres_list_notifyall(xj_pres_list prl, int s)
268 268
 	while(p)
269 269
 	{
270 270
 		if(p->cbf)
271
-			(*(p->cbf))(&(p->userid),(s==XJ_PS_CHECK)?p->state:s,
271
+			(*(p->cbf))(&(p->userid),&(p->userid), (s==XJ_PS_CHECK)?p->state:s,
272 272
 					p->cbp);
273 273
 		p = p->next;
274 274
 	}
... ...
@@ -1126,7 +1126,7 @@ call_pa_cbf:
1126 1126
 			DBG("XJAB:xj_manage_jab: calling CBF(%.*s,%d)\n",
1127 1127
 				tf.len, tf.s, prc->state);
1128 1128
 #endif
1129
-			(*(prc->cbf))(&tf, prc->state, prc->cbp);
1129
+			(*(prc->cbf))(&tf, &tf, prc->state, prc->cbp);
1130 1130
 		}
1131 1131
 	}
1132 1132
 ready:
... ...
@@ -1476,7 +1476,7 @@ void xj_worker_check_watcher(xj_wlist jwl, xj_jcon_pool jcp,
1476 1476
 			" conference.\n", _xj_pid);
1477 1477
 #endif
1478 1478
 		// set as offline
1479
-		(*(jsmsg->cbf))(&jsmsg->to, XJ_PS_OFFLINE, jsmsg->p);
1479
+		(*(jsmsg->cbf))(&jsmsg->to, &jsmsg->to, XJ_PS_OFFLINE, jsmsg->p);
1480 1480
 		return;
1481 1481
 	}
1482 1482
 			
... ...
@@ -1525,7 +1525,7 @@ void xj_worker_check_watcher(xj_wlist jwl, xj_jcon_pool jcp,
1525 1525
 				_xj_pid, jsmsg->to.len, jsmsg->to.s, prc->state);
1526 1526
 #endif
1527 1527
 			// send presence info to SIP subscriber
1528
-			(*(prc->cbf))(&jsmsg->to, prc->state, prc->cbp);
1528
+			(*(prc->cbf))(&jsmsg->to, &jsmsg->to, prc->state, prc->cbp);
1529 1529
 		}
1530 1530
 	}
1531 1531
 }