Ejemplo n.º 1
0
void Groups::refreshMessage(not_null<HistoryItem*> item) {
	if (!isGrouped(item)) {
		unregisterMessage(item);
		return;
	}
	if (!IsServerMsgId(item->id)) {
		return;
	}
	const auto groupId = item->groupId();
	const auto i = _groups.find(groupId);
	if (i == end(_groups)) {
		registerMessage(item);
		return;
	}
	auto &items = i->second.items;
	const auto position = findPositionForItem(items, item);
	auto current = ranges::find(items, item);
	if (current == end(items)) {
		items.insert(position, item);
	} else if (position == current + 1) {
		return;
	} else if (position > current + 1) {
		for (++current; current != position; ++current) {
			std::swap(*(current - 1), *current);
		}
	} else if (position < current) {
		for (; current != position; --current) {
			std::swap(*(current - 1), *current);
		}
	} else {
		Unexpected("Position of item in Groups::refreshMessage().");
	}
	refreshViews(items);
}
Ejemplo n.º 2
0
void AccountClient::unregisterAccount(const QString &username,
                                      const QString &password)
{
    MessageOut unregisterMessage(PAMSG_UNREGISTER);
    unregisterMessage.writeString(username);
    unregisterMessage.writeString(passwordHash(username, password));
    send(unregisterMessage);
}
Ejemplo n.º 3
0
GpgPlugin::~GpgPlugin()
{
    unregisterMessage();
    free_data(gpgData, &data);
    list<DecryptMsg>::iterator it;
    for (it = m_decrypt.begin(); it != m_decrypt.end(); ++it){
        if ((*it).msg)
            delete (*it).msg;
        delete (*it).exec;
    }
    for (it = m_import.begin(); it != m_import.end(); ++it){
        if ((*it).msg)
            delete (*it).msg;
        delete (*it).exec;
    }
    for (it = m_public.begin(); it != m_public.end(); ++it)
        delete (*it).exec;
    getContacts()->unregisterUserData(user_data_id);
}
Ejemplo n.º 4
0
//-----------------------------------------------------------
DatabaserServer::~DatabaserServer()
{
	unregisterMessage();
}