void CoreUserInputHandler::handlePart(const BufferInfo &bufferInfo, const QString &msg)
{
    QList<QByteArray> params;
    QString partReason;

    // msg might contain either a channel name and/or a reaon, so we have to check if the first word is a known channel
    QString channelName = msg.section(' ', 0, 0);
    if (channelName.isEmpty() || !network()->ircChannel(channelName)) {
        channelName = bufferInfo.bufferName();
        partReason = msg;
    }
    else {
        partReason = msg.mid(channelName.length() + 1);
    }

    if (partReason.isEmpty())
        partReason = network()->identityPtr()->partReason();

    params << serverEncode(channelName) << channelEncode(bufferInfo.bufferName(), partReason);
    emit putCmd("PART", params);
}
void CoreUserInputHandler::handlePart(const BufferInfo &bufferInfo, const QString &msg)
{
    QList<QByteArray> params;
    QString partReason;

     
    QString channelName = msg.section(' ', 0, 0);
    if (channelName.isEmpty() || !network()->ircChannel(channelName)) {
        channelName = bufferInfo.bufferName();
        partReason = msg;
    }
    else {
        partReason = msg.mid(channelName.length() + 1);
    }

    if (partReason.isEmpty())
        partReason = network()->identityPtr()->partReason();

    params << serverEncode(channelName) << channelEncode(bufferInfo.bufferName(), partReason);
    emit putCmd("PART", params);
}