diff --git a/src/IRCConnection.h b/src/IRCConnection.h index 03ae94d..7e355bd 100644 --- a/src/IRCConnection.h +++ b/src/IRCConnection.h @@ -70,6 +70,7 @@ inChannel: (IRCChannel*)channel; - (void)connection: (IRCConnection*)connection didReceiveNamesForChannel: (IRCChannel*)channel; +- (void)connectionWasClosed: (IRCConnection*)connection; @end @interface IRCConnection: OFObject diff --git a/src/IRCConnection.m b/src/IRCConnection.m index 75baec5..1108f36 100644 --- a/src/IRCConnection.m +++ b/src/IRCConnection.m @@ -170,6 +170,14 @@ OFArray *split; OFString *action = nil; + if (sock.atEndOfStream) { + if ([delegate respondsToSelector: + @selector(connectionWasClosed:)]) + [delegate connectionWasClosed: self]; + + return; + } + @try { line = [sock tryReadLine]; } @catch (OFInvalidEncodingException *e) { diff --git a/src/Makefile b/src/Makefile index 3c84679..0a086e3 100644 --- a/src/Makefile +++ b/src/Makefile @@ -3,3 +3,7 @@ all: clean: rm -f *.o *.so *.dylib *.dll + +install: + cp *.h /usr/local/include/ObjIRC/ + cp libobjirc.dylib /usr/local/lib/