Beispiel #1
0
void
notify_set_online_list (server * serv, char *users,
						 const message_tags_data *tags_data)
{
	struct notify_per_server *servnot;
	char nick[NICKLEN];
	char *token, *chr;
	int pos;

	token = strtok (users, ",");
	while (token != NULL)
	{
		chr = strchr (token, '!');
		if (!chr)
			goto end;

		pos = chr - token;
		if (pos + 1 >= sizeof(nick))
			goto end;

		memset (nick, 0, sizeof(nick));
		strncpy (nick, token, pos);

		servnot = notify_find (serv, nick);
		if (servnot)
			notify_announce_online (serv, servnot, nick, tags_data);
end:
		token = strtok (NULL, ",");
	}
}
Beispiel #2
0
void
notify_set_online (server * serv, char *nick)
{
	struct notify_per_server *servnot;

	servnot = notify_find (serv, nick);
	if (!servnot)
		return;

	notify_announce_online (serv, servnot, nick);
}
Beispiel #3
0
void
notify_set_online (server * serv, char *nick,
						 const message_tags_data *tags_data)
{
	struct notify_per_server *servnot;

	servnot = notify_find (serv, nick);
	if (!servnot)
		return;

	notify_announce_online (serv, servnot, nick, tags_data);
}
Beispiel #4
0
void
notify_markonline (server *serv, char *word[])
{
	struct notify *notify;
	struct notify_per_server *servnot;
	GSList *list = notify_list;
	int i, seen;

	while (list)
	{
		notify = (struct notify *) list->data;
		servnot = notify_find_server_entry (notify, serv);
		if (!servnot)
		{
			list = list->next;
			continue;
		}
		i = 4;
		seen = FALSE;
		while (*word[i])
		{
			if (!serv->p_cmp (notify->name, word[i]))
			{
				seen = TRUE;
				notify_announce_online (serv, servnot, notify->name);
				break;
			}
			i++;
			/* FIXME: word[] is only a 32 element array, limits notify list to
			   about 27 people */
			if (i > PDIWORDS - 5)
			{
				/*fprintf (stderr, _("*** XCHAT WARNING: notify list too large.\n"));*/
				break;
			}
		}
		if (!seen && servnot->ison)
		{
			notify_announce_offline (serv, servnot, notify->name, FALSE);
		}
		list = list->next;
	}
	fe_notify_update (0);
}