rem: if (!tuple) {
add: if (!tuple && new_tuple_on_publish) {
context: static int publish_presentity_pidf(struct sip_msg* _m, struct pdomain* _d, struct presentity* presentity, int *pchanged){     char *body = get_body(_m);     presence_tuple_t *tuple = NULL;     str contact = { NULL, 0 };     str basic = { NULL, 0 };     str status = { NULL, 0 };     str location = { NULL, 0 };     str site = { NULL, 0 };     str floor = { NULL, 0 };     str room = { NULL, 0 };     str packet_loss = { NULL, 0 };     double x=0, y=0, radius=0;     int flags = 0;     int changed = 0;     int ret = 0;     flags = parse_pidf(body, &contact, &basic, &status, &location, &site, &floor, &room, &x, &y, &radius, &packet_loss);     if (contact.len) {	  find_presence_tuple(&contact, presentity, &tuple);	  if (!tuple) {	       new_presence_tuple(&contact, presentity, &tuple);	       add_presence_tuple(presentity, tuple);	  }     } else {	  tuple = presentity->tuples;     }     if (!tuple) {	  LOG(L_ERR, "publish_presentity: no tuple for %.*s\n", 	      presentity->uri.len, presentity->uri.s);	  return -1;     }     LOG(L_INFO, "publish_presentity_pidf: -1-\n");     if (basic.len && basic.s) {	  int origstate = tuple->state;	  tuple->state =	       (strcmp(basic.s, "online") == 0) ? PS_ONLINE : PS_OFFLINE;	  if (tuple->state != origstate)	       changed = 1;     }     if (status.len && status.s) {	  if (tuple->status.len && strcmp(tuple->status.s, status.s) != 0)	       changed = 1;	  tuple->status.len = status.len;	  strncpy(tuple->status.s, status.s, status.len);	  tuple->status.s[status.len] = 0;     }     LOG(L_INFO, "publish_presentity: -2-\n");     if (location.len && location.s) {	  if (tuple->location.loc.len && strcmp(tuple->location.loc.s, location.s) != 0)	       changed = 1;	  tuple->location.loc.len = location.len;	  strncpy(tuple->location.loc.s, location.s, location.len);	  tuple->location.loc.s[location.len] = 0;     } else if (flags & PARSE_PIDF_LOCATION_MASK) {	  tuple->location.loc.len = 0;     }     if (site.len && site.s) {	  if (tuple->location.site.len && strcmp(tuple->location.site.s, site.s) != 0)	       changed = 1;	  tuple->location.site.len = site.len;	  strncpy(tuple->location.site.s, site.s, site.len);	  tuple->location.site.s[site.len] = 0;     } else if (flags & PARSE_PIDF_LOCATION_MASK) {	  tuple->location.site.len = 0;     }     if (floor.len && floor.s) {	  if (tuple->location.floor.len && strcmp(tuple->location.floor.s, floor.s) != 0)	       changed = 1;	  tuple->location.floor.len = floor.len;	  strncpy(tuple->location.floor.s, floor.s, floor.len);	  tuple->location.floor.s[floor.len] = 0;     }else if (flags & PARSE_PIDF_LOCATION_MASK) {	  tuple->location.floor.len = 0;     }     if (room.len && room.s) {	  if (tuple->location.room.len && strcmp(tuple->location.room.s, room.s) != 0)	       changed = 1;	  tuple->location.room.len = room.len;	  strncpy(tuple->location.room.s, room.s, room.len);	  tuple->location.room.s[room.len] = 0;     } else if (flags & PARSE_PIDF_LOCATION_MASK) {	  tuple->location.room.len = 0;     }     if (packet_loss.len && packet_loss.s) {	  if (tuple->location.packet_loss.len && strcmp(tuple->location.packet_loss.s, packet_loss.s) != 0)	       changed = 1;	  tuple->location.packet_loss.len = packet_loss.len;	  strncpy(tuple->location.packet_loss.s, packet_loss.s, packet_loss.len);	  tuple->location.packet_loss.s[packet_loss.len] = 0;     } else if (flags & PARSE_PIDF_LOCATION_MASK) {	  tuple->location.packet_loss.len = 0;     }     if (x) {	  if (tuple->location.x != x)	       changed = 1;	  tuple->location.x = x;     } else if (flags & PARSE_PIDF_LOCATION_MASK) {	  tuple->location.x = 0;     }     if (y) {	  if (tuple->location.y != y)	       changed = 1;	  tuple->location.y = y;     } else if (flags & PARSE_PIDF_LOCATION_MASK) {	  tuple->location.y = 0;     }     if (radius) {	  if (tuple->location.radius != radius)	       changed = 1;	  tuple->location.radius = radius;     } else if (flags & PARSE_PIDF_LOCATION_MASK) {	  tuple->location.radius = 0;     }     if (use_location_package)	  if (site.len && floor.len && room.len && changed) {	       location_package_location_add_user(_d, &site, &floor, &room, presentity);	  }     changed = 1;     if (changed)	  presentity->flags |= PFLAG_PRESENCE_CHANGED;     LOG(L_INFO, "publish_presentity: -3-: changed=%d\n", changed);     if (pchanged && changed) {	  *pchanged = 1;     }     if ((ret = db_update_presentity(presentity)) < 0) {	  return ret;     }     LOG(L_INFO, "publish_presentity: -4-\n");     return 0;}