if (!CC->logged_in) return;
for (cptr = ContextList; cptr != NULL; cptr = cptr->next) {
- if (!strcasecmp(cptr->cs_inet_email, message_to)) {
- recp = cptr->user.fullname;
+ if (cptr->logged_in) {
+ if (!strcasecmp(cptr->cs_inet_email, message_to)) {
+ recp = cptr->user.fullname;
+ }
}
}
int aide = (CC->user.axlevel >= 6);
for (cptr = ContextList; cptr != NULL; cptr = cptr->next) {
- if (
- (((cptr->cs_flags&CS_STEALTH)==0) || (aide)) /* aides can see everyone */
- && (cptr->user.usernum != CC->user.usernum) /* don't tell me about myself */
- ) {
- cprintf("<presence type=\"available\" from=\"%s\"></presence>", cptr->cs_inet_email);
+ if (cptr->logged_in) {
+ if (
+ (((cptr->cs_flags&CS_STEALTH)==0) || (aide)) /* aides see everyone */
+ && (cptr->user.usernum != CC->user.usernum) /* don't show myself */
+ ) {
+ cprintf("<presence type=\"available\" from=\"%s\"></presence>",
+ cptr->cs_inet_email);
+ }
}
}
}
/* Count the visible sessions for this user */
for (cptr = ContextList; cptr != NULL; cptr = cptr->next) {
- if ( (!strcasecmp(cptr->cs_inet_email, presence_jid))
- && (((cptr->cs_flags&CS_STEALTH)==0) || (aide))
- ) {
- ++visible_sessions;
+ if (cptr->logged_in) {
+ if ( (!strcasecmp(cptr->cs_inet_email, presence_jid))
+ && (((cptr->cs_flags&CS_STEALTH)==0) || (aide))
+ ) {
+ ++visible_sessions;
+ }
}
}
/* Do an unsolicited roster update that adds a new contact. */
for (cptr = ContextList; cptr != NULL; cptr = cptr->next) {
- if (!strcasecmp(cptr->cs_inet_email, presence_jid)) {
- cprintf("<iq id=\"unsolicited_%x\" type=\"result\">", ++unsolicited_id);
- cprintf("<query xmlns=\"jabber:iq:roster\">");
- jabber_roster_item(cptr);
- cprintf("</query>"
- "</iq>");
+ if (cptr->logged_in) {
+ if (!strcasecmp(cptr->cs_inet_email, presence_jid)) {
+ cprintf("<iq id=\"unsolicited_%x\" type=\"result\">",
+ ++unsolicited_id);
+ cprintf("<query xmlns=\"jabber:iq:roster\">");
+ jabber_roster_item(cptr);
+ cprintf("</query>"
+ "</iq>");
+ }
}
}
cprintf("<query xmlns=\"jabber:iq:roster\">");
for (cptr = ContextList; cptr != NULL; cptr = cptr->next) {
-
- if (
- (((cptr->cs_flags&CS_STEALTH)==0) || (aide))
- && (cptr->user.usernum != CC->user.usernum)
- ) {
- jabber_roster_item(cptr);
+ if (cptr->logged_in) {
+ if (
+ (((cptr->cs_flags&CS_STEALTH)==0) || (aide))
+ && (cptr->user.usernum != CC->user.usernum)
+ ) {
+ jabber_roster_item(cptr);
+ }
}
}