Skip to content

Instantly share code, notes, and snippets.

@oppahero
Created November 9, 2018 04:58
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save oppahero/74175228618ff6ea2e3508d79eb06217 to your computer and use it in GitHub Desktop.
Save oppahero/74175228618ff6ea2e3508d79eb06217 to your computer and use it in GitHub Desktop.
//match con la expresión de chat privado
match = regex_private.match(data);
if(match.hasMatch()){
QString senderName = match.captured(2);
QString time = match.captured(1);
QString text = match.captured(3);
//Si la ventana ya esta abierta solo agrega
if(!privateChatList.contains(senderName)){
privateChatList[senderName] = new PrivateDialog(this->username,senderName,this);
connect(privateChatList[senderName],SIGNAL(finished(int)),this,SLOT(privateFinished(int)));
connect(privateChatList[senderName],SIGNAL(messageSent(QString,QString)),this,
SLOT(privateMessageSent(QString,QString)));
connect(privateChatList[senderName],SIGNAL(fileSend(QString,QString,QString)),
this,SLOT(privateFileSent(QString,QString,QString)));
privateChatList[senderName]->show();
}
privateChatList[senderName]->addNewMessage(time,text);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment