Send message "quit" when disconnecting from WeeChat (before closing socket)
This commit is contained in:
parent
d1b4884dfd
commit
eafb7aebb2
1 changed files with 4 additions and 1 deletions
|
@ -114,7 +114,10 @@ class Network(QtCore.QObject):
|
|||
|
||||
def disconnect_weechat(self):
|
||||
if self._socket.state() != QtNetwork.QAbstractSocket.UnconnectedState:
|
||||
if self._socket.state() != QtNetwork.QAbstractSocket.ConnectedState:
|
||||
if self._socket.state() == QtNetwork.QAbstractSocket.ConnectedState:
|
||||
self._socket.write('quit\n')
|
||||
self._socket.waitForBytesWritten(1000)
|
||||
else:
|
||||
self.statusChanged.emit(self.status_disconnected, None)
|
||||
self._socket.abort()
|
||||
|
||||
|
|
Loading…
Reference in a new issue