Example #1
0
void HighlightFilter::filterMessage(KTp::Message &message,
                                    const KTp::MessageContext &context)
{
    QString msg = message.mainMessagePart();

    if (msg.contains(context.account()->nickname(), Qt::CaseInsensitive)) {
        message.setProperty("highlight", true);
    }

    if (msg.contains(d->user.loginName(), Qt::CaseInsensitive)) {
        message.setProperty("highlight", true);
    }
}
Example #2
0
void FormatFilter::filterMessage (KTp::Message& message, const KTp::MessageContext &context)
{
    Q_UNUSED(context)
    message.setMainMessagePart(d->filterString(message.mainMessagePart()));
}