add: } else { et = EVENT_PRESENCE;
context: static int update_presentity(struct sip_msg* _m, struct pdomain* _d, 			     struct presentity* _p, struct watcher** _w){	time_t e;	dlg_t* dialog;	str watch_uri;	event_t *event = (event_t*)(_m->event->parsed);	int et = 0;	if (_m->event) {		et = event->parsed;	}	if (_m->expires) {		e = ((exp_body_t*)_m->expires->parsed)->val;	} else {		e = default_expires;	}	if (get_watch_uri(_m, &watch_uri) < 0) {		LOG(L_ERR, "update_presentity(): Error while extracting watcher URI\n");		return -1;	}	if (find_watcher(_p, &watch_uri, _w) == 0) {		if (e == 0) {			if (et == EVENT_PRESENCE) {				if (remove_watcher(_p, *_w) < 0) {					LOG(L_ERR, "update_presentity(): Error while deleting winfo watcher\n");					return -2;				} 			} else {				if (remove_winfo_watcher(_p, *_w) < 0) {					LOG(L_ERR, "update_presentity(): Error while deleting winfo watcher\n");					return -2;				} 			}						(*_w)->expires = 0;   /* The watcher will be freed after NOTIFY is sent */			if (!_p->watchers && !_p->winfo_watchers) {				remove_presentity(_d, _p);			}		} else {			e += act_time;			if (update_watcher(*_w, e) < 0) {				LOG(L_ERR, "update_presentity(): Error while updating watcher\n");				return -3;			}		}	} else {		if (e) {			e += act_time;			if (tmb.new_dlg_uas(_m, 200, &dialog) < 0) {				paerrno = PA_DIALOG_ERR;				LOG(L_ERR, "update_presentity(): Error while creating dialog state\n");				return -4;			}			if (et == EVENT_PRESENCE) {				if (add_watcher(_p, &watch_uri, e, acc, dialog, _w) < 0) {					LOG(L_ERR, "update_presentity(): Error while creating presentity\n");					tmb.free_dlg(dialog);					return -5;				}			} else {				if (add_winfo_watcher(_p, &watch_uri, e, acc, dialog, _w) < 0) {					LOG(L_ERR, "update_presentity(): Error while creating winfo watcher\n");					tmb.free_dlg(dialog);					return -5;				}						}		} else {			DBG("update_presentity(): expires = 0 but no watcher found\n");			*_w = 0;		}	}	return 0;}