Exemplo n.º 1
0
void Entry::sendMsg(const ustring& msg)
{
    if (!_tab->getConn()->Session.isConnected) {
        _tab->getText() << _("Not connected to server. Try `/SERVER <hostname / ip>'.\n");
    } else if (!_tab->isActive()) {
        _tab->getText() << _("No channel joined. Try `/JOIN #channel-name'\n");
    } else {
        std::istringstream ss(msg.raw());

        if (ss.peek() == '\n')
              ss.ignore();

        // FIXME - ustring
        string line;
        while (getline(ss, line))
              _tab->getConn()->sendMsg(_tab->getName(), line);
    }
}