Browse Source

presence(k): dynamic support for new event package

- patch by Aymeric Moizard
- events can be given as EVENT_OTHER, matching being done on string
  value
Daniel-Constantin Mierla 15 years ago
parent
commit
147e776d7a
3 changed files with 4 additions and 9 deletions
  1. 4 1
      modules_k/presence/event_list.c
  2. 0 4
      modules_k/presence/publish.c
  3. 0 4
      modules_k/presence/subscribe.c

+ 4 - 1
modules_k/presence/event_list.c

@@ -350,7 +350,10 @@ pres_ev_t* search_event(event_t* event)
 
 	while(pres_ev)
 	{
-		if(pres_ev->evp->type== event->type)
+		if((pres_ev->evp->type== event->type && event->type!=EVENT_OTHER)
+			|| (pres_ev->evp->name.len== event->name.len &&
+				strncasecmp(pres_ev->evp->name.s,event->name.s,
+					pres_ev->evp->name.len)== 0))
 		{
 			if(event->params.list== NULL && pres_ev->evp->params.list== NULL)
 			{

+ 0 - 4
modules_k/presence/publish.c

@@ -325,10 +325,6 @@ int handle_publish(struct sip_msg* msg, char* sender_uri, char* str2)
 			reply_str= pu_400a_rpl;
 			goto error;
 		}
-		if(((event_t*)msg->event->parsed)->type == EVENT_OTHER)
-		{	
-			goto unsupported_event;
-		}
 	}
 	else
 		goto unsupported_event;

+ 0 - 4
modules_k/presence/subscribe.c

@@ -544,10 +544,6 @@ int handle_subscribe(struct sip_msg* msg, char* str1, char* str2)
 			reply_str= pu_400_rpl;
 			goto error;
 		}
-		if(((event_t*)msg->event->parsed)->type == EVENT_OTHER)
-		{	
-			goto bad_event;
-		}
 	}
 	else
 		goto bad_event;