Logo Search packages:      
Sourcecode: kmess version File versions  Download package

void NetworkWindow::addOutgoingServerMessage ( const QString &  msg  )  [slot]

Logs outgoing traffic. Logs outgoing messages to the server. A shortcut to display an inbound server message, but with the ability to filter separately. Also, any tag-like things are replaced with entities so they can be displayed.

Parameters:
msg Raw buffer of what you intend to send.

Definition at line 126 of file networkwindow.cpp.

{
#ifdef KMESS_NETWORK_WINDOW
  // Filter if neccessary
  if(showOutgoing_)
  {
    // We're going to have to strip <> tags.
    QString ourMsg= msg;
    ourMsg.replace(QChar('<'), QString("&lt;"));
    ourMsg.replace(QChar('>'), QString("&gt;"));
    ourMsg.prepend(QString("--> "));

    // Outgoing messages tend to have extra \n on them (we must strip them)
    QChar endch= ourMsg.at(ourMsg.length() - 1);
    while(endch.latin1() == '\n' || endch.latin1() == '\r')
    {
      ourMsg.truncate(ourMsg.length() - 1);
      endch= ourMsg.at(ourMsg.length() - 1);
    }

    addMessage(ourMsg);
  } // End if(showOutgoing_)
#endif
}


Generated by  Doxygen 1.6.0   Back to index