this->status->showMessage("<font color=\"#ff0000\">Don't forget almost all features are not implemented!</font>",default_status_interval);
event->accept();
}
-bool mainWindow::isInMember(const AddressAndPort &peer,bool matchIPOnly){
- QList<AddressAndPort> iplist=this->memberList->addressPortList();
- foreach(AddressAndPort addressPort,iplist){
- if(matchIPOnly&&peer.first==addressPort.first) return true;
- else if(peer==addressPort) return true;
- }
- return false;
-}
//Client behavior
void mainWindow::on_sendButton_clicked(){
#ifdef DEBUG
qDebug()<<"Pending:"<<socket.peerAddress().toString()<<" Port:"<<socket.peerPort();
#endif
- if(!this->isInMember(AddressAndPort(socket.peerAddress(),0),true)) return false;
+ if(this->memberList->isInMember(AddressAndPort(socket.peerAddress(),0),true)<0) return false;
connect(&socket,
SIGNAL(msg_received(const QString &)),
SLOT(tcpserver_msg_received(const QString &)));