rem: new_presentity(pdomain, &p_uri, EVENT_PRESENCE, &presentity);
add: new_presentity(pdomain, &p_uri, &presentity);
context: int fifo_pa_location(FILE *fifo, char *response_file){     char pdomain_s[MAX_P_URI];     char p_uri_s[MAX_P_URI];     char location_s[MAX_LOCATION];     pdomain_t *pdomain = NULL;     presentity_t *presentity = NULL;     presence_tuple_t *tuple = NULL;     str pdomain_name, p_uri, location;     int changed = 0;     if (!read_line(pdomain_s, MAX_PDOMAIN, fifo, &pdomain_name.len) || pdomain_name.len == 0) {	  fifo_reply(response_file,		     "400 pa_location: pdomain expected\n");	  LOG(L_ERR, "ERROR: pa_location: pdomain expected\n");	  return 1;     }     pdomain_name.s = pdomain_s;     if (!read_line(p_uri_s, MAX_P_URI, fifo, &p_uri.len) || p_uri.len == 0) {	  fifo_reply(response_file,		     "400 pa_location: p_uri expected\n");	  LOG(L_ERR, "ERROR: pa_location: p_uri expected\n");	  return 1;     }     p_uri.s = p_uri_s;     if (!read_line(location_s, MAX_LOCATION, fifo, &location.len) || location.len == 0) {	  fifo_reply(response_file,		     "400 pa_location: location expected\n");	  LOG(L_ERR, "ERROR: pa_location: location expected\n");	  return 1;     }     location.s = location_s;#if 1     register_pdomain(pdomain_s, &pdomain);     if (!pdomain) {	  fifo_reply(response_file, "400 could not register pdomain\n");	  LOG(L_ERR, "ERROR: pa_location: could not register pdomain %.*s\n",	      pdomain_name.len, pdomain_name.s);	  return 1;     }     find_presentity(pdomain, &p_uri, &presentity);     if (!presentity) {	  new_presentity(pdomain, &p_uri, EVENT_PRESENCE, &presentity);	  add_presentity(pdomain, presentity);	  changed = 1;     }     if (!presentity) {	  fifo_reply(response_file, "400 could not find presentity\n");	  LOG(L_ERR, "ERROR: pa_location: could not find presentity %.*s\n",	      p_uri.len, p_uri.s);	  return 1;     }     changed = 1;     for (tuple = presentity->tuples; tuple; tuple = tuple->next) {	  if (tuple->location.loc.len && strcmp(tuple->location.room.s, location.s) != 0)	       changed = 1;	  LOG(L_ERR, "Setting room of contact=%.*s to %.*s\n",	      tuple->contact.len, tuple->contact.s,	      tuple->location.room.len, tuple->location.room.s);	  strncpy(tuple->location.room.s, location.s, location.len);	  tuple->location.room.len = location.len;	  strncpy(tuple->location.loc.s, location.s, location.len);	  tuple->location.loc.len = location.len;     }     if (changed) {	  presentity->flags |= PFLAG_PRESENCE_CHANGED;     }     db_update_presentity(presentity);#endif     fifo_reply(response_file, "200 published\n",		"(%.*s %.*s)\n",		p_uri.len, ZSW(p_uri.s),		location.len, ZSW(location.s));     return 1;}