<commit_before>/*
* Copyright (C) 2008-2013 The Communi Project
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
* GNU General Public License for more details.
*/

#include "ignoreplugin.h"
#include "ignoremanager.h"

IgnorePlugin::IgnorePlugin(QObject* parent) : QObject(parent)
{
}

void IgnorePlugin::initConnection(IrcConnection* connection)
{
    IgnoreManager::instance()->addConnection(connection);
}

void IgnorePlugin::cleanupConnection(IrcConnection* connection)
{
    IgnoreManager::instance()->removeConnection(connection);
}

#if QT_VERSION < 0x050000
Q_EXPORT_STATIC_PLUGIN(IgnorePlugin)
#endif
<commit_msg>IgnorePlugin: add TODO notes<commit_after>/*
* Copyright (C) 2008-2013 The Communi Project
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
* GNU General Public License for more details.
*/

#include "ignoreplugin.h"
#include "ignoremanager.h"

IgnorePlugin::IgnorePlugin(QObject* parent) : QObject(parent)
{
    // TODO:
    // parser->addCommand(IrcCommand::Custom, "IGNORE (<mask>)");
    // parser->addCommand(IrcCommand::Custom, "UNIGNORE <mask>");

//    if (command == "IGNORE") {
//        MessageFormatter::Options options;
//        options.timeStampFormat = d.timeStampFormat;
//        options.timeStamp = QDateTime::currentDateTime();
//        QString ignore  = params.value(0);
//        if (ignore.isEmpty()) {
//            const QStringList ignores = IgnoreManager::instance()->ignores();
//            if (!ignores.isEmpty()) {
//                foreach (const QString& ignore, ignores)
//                    d.textBrowser->append(MessageFormatter::formatLine("! " + ignore, options));
//            } else {
//                d.textBrowser->append(MessageFormatter::formatLine("! no ignores", options));
//            }
//        } else {
//            QString mask = IgnoreManager::instance()->addIgnore(ignore);
//            d.textBrowser->append(MessageFormatter::formatLine("! ignored: " + mask));
//        }
//    } else if (command == "UNIGNORE") {
//        QString mask = IgnoreManager::instance()->removeIgnore(params.value(0));
//        d.textBrowser->append(MessageFormatter::formatLine("! unignored: " + mask));
//    }
}

void IgnorePlugin::initConnection(IrcConnection* connection)
{
    IgnoreManager::instance()->addConnection(connection);
}

void IgnorePlugin::cleanupConnection(IrcConnection* connection)
{
    IgnoreManager::instance()->removeConnection(connection);
}

#if QT_VERSION < 0x050000
Q_EXPORT_STATIC_PLUGIN(IgnorePlugin)
#endif

{'fraction_non_alphanumeric': 0.12124886329190664, 'fraction_numerical': 0.010306153379812064, 'mean_word_length': 3.838709677419355, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 18, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5611226', 'n_tokens_mistral': 932, 'n_tokens_neox': 887, 'n_words': 272}