Пример #1
0
void ext_yahoo_conf_userjoin(int id, const char*, const char *who, const char *room)
{
	CYahooProto* ppro = getProtoById(id);
	if (!ppro) return;

	CYahooProto::ChatRoom *cm = ppro->m_chatrooms.find((CYahooProto::ChatRoom*)&room);
	if (!cm) return;
	for (YList *l = cm->members; l; l = l->next) {
		if (!mir_strcmp(who, (char*)l->data))
			return;
	}

	cm->members = y_list_append(cm->members, strdup(who));
	ppro->ChatEvent(room, who, GC_EVENT_JOIN);
}
Пример #2
0
void ext_yahoo_conf_userleave(int id, const char*, const char *who, const char *room)
{
	CYahooProto* ppro = getProtoById(id);
	if (!ppro) return;

	CYahooProto::ChatRoom *cm = ppro->m_chatrooms.find((CYahooProto::ChatRoom*)&room);
	if (!cm) return;

	for (YList *l = cm->members; l; l = l->next) {
		if (mir_strcmp((char*)l->data, who) == 0) {
			free(l->data);
			y_list_remove_link(cm->members, l);
			y_list_free_1(l);
			break;
		}
	}

	ppro->ChatEvent(room, who, GC_EVENT_PART);
}