rem: pdomain_t *pdomain = NULL; presentity_t *presentity = NULL; str domain, uri, presence; int origstate, newstate; int allocated_presentity = 0;
add: str domain, uri, presence;
context: static int pa_presence(str* msg){	pdomain_t *pdomain = NULL;	presentity_t *presentity = NULL;	str domain, uri, presence;	int origstate, newstate;	int allocated_presentity = 0;	if (unixsock_read_line(&domain, msg) != 0) {		unixsock_reply_asciiz("400 Domain expected\n");		goto err;	}	if (unixsock_read_line(&uri, msg) != 0) {		unixsock_reply_asciiz("400 URI Expected\n");		goto err;	}	if (unixsock_read_line(&presence, msg) != 0) {		unixsock_reply_asciiz("400 Presence Expected\n");		goto err;	}#if 0	domain.s[domain.len] = '\0'; /* We can safely zero-terminate here */	register_pdomain(domain.s, &pdomain);	if (!pdomain) {		unixsock_reply_asciiz("500 Could not register domain\n");		goto err;	}	find_presentity(pdomain, &uri, &presentity);	if (!presentity) {		new_presentity(pdomain, &uri, &presentity);		add_presentity(pdomain, presentity);		allocated_presentity = 1;	}	if (!presentity) {		unixsock_reply_asciiz("500 Could not find presentity %.*s\n", uri.len, ZSW(uri.s));		goto err;	}	origstate = presentity->state;	if ((presence.len == 6) && !memcmp(presence.s, "online", 6)) {		presentity->state = newstate = PS_ONLINE;	} else {		presentity->state = newstate = PS_OFFLINE;	}	if (origstate != newstate || allocated_presentity) {		presentity->flags |= PFLAG_PRESENCE_CHANGED;	}	db_update_presentity(presentity);#endif	unixsock_reply_printf("200 Published\n(%.*s %.*s)\n", 			      uri.len, ZSW(uri.s), presence.len, ZSW(presence.s));	unixsock_reply_send();	return 1; err:	unixsock_reply_send();	return -1;}