bool ctcphandler::getctcp(const usermessage u){
    if (u.msg().startsWith("away")) {
        if (!awayusers.contains(u.user(), Qt::CaseInsensitive)){
            awayusers << u.user();
            foreach(chatwindow *w, ::window::chatwindows){
                if(w->chatpartner == u.user()){
                    w->setaway(1,u.msg());
                    break;
                }
            }
        }
    } else if (u.msg()=="back") {
Example #2
0
QTextCharFormat chathandlerprv::getRightFormat(const usermessage u) {
    QTextCharFormat format;
    if (!containsCI(S_S.buddylist, u.user()))
        format = hash[e_hash_chat];
    else
        format = hash[e_hash_buddy];
    if(u.user()==netc->nick)
        format=hash[e_hash_myself];
    if(u.has_type(e_PRIVMSG) && u.has_type(e_ACTION))
        format=hash[e_hash_action];
    else if(u.has_type(e_CTCP))
        format=hash[e_hash_ctcp];
    else if(u.has_type(e_NOTICE)) {
        if(u.has_type(e_ACTION))
            format=hash[e_hash_noticeaction];
        else
            format=hash[e_hash_notice];
    } else if(u.has_type(e_RAWCOMMAND) || u.has_type(e_SCRIPTCOMMAND))
        format=hash[e_hash_raw];
    return format;
}