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

void ChatView::slotSendAppCommand (  )  [private, slot]

The user clicked a kmess internal link in the ChatMessageView

Definition at line 862 of file chatview.cpp.

{
  // Ignore non-internal links and non-application internal links
  if( ! chatViewClickedUrl_.isValid() || chatViewClickedUrl_.protocol() != "kmess" || chatViewClickedUrl_.host() != "application" )
  {
#ifdef KMESSDEBUG_CHATVIEW
    kdDebug() << "ChatView::slotSendAppCommand() - Not sending invalid application link: " << chatViewClickedUrl_.url() << endl;
#endif

    return;
  }

/*
 * KMess' internal application URLs are in the form
 * kmess://application/responseType/accountHandle?cookieId
 */

  QString path  = chatViewClickedUrl_.path().mid( 1 );  // remove first /
  QString query = chatViewClickedUrl_.query().mid( 1 ); // Remove the ?

  QString method  = path.section( "/", 0, 0 );   // First parameter: response type
  QString contact = path.section( "/", 1, 1 );   // Second parameter: contact handle
  QString cookie  = query;                       // Third parameter: transfer cookie ID

#ifdef KMESSTEST
  ASSERT( ! path.isEmpty() );
  ASSERT( ! query.isEmpty() );
#endif

#ifdef KMESSDEBUG_CHATVIEW
  kdDebug() << "ChatView::slotSendAppCommand() - Sending application link - method=" << method << " contact=" << contact << " cookie=" << cookie << endl;
#endif

  emit appCommand( cookie, contact, method );
}


Generated by  Doxygen 1.6.0   Back to index