Cleaned up old pircbot library. Added irc-api sources. Some formatting.

fix-message-formatting
Danny van Heumen 12 years ago
parent 800d4f0e75
commit 4d80d859e9

@ -64,7 +64,6 @@
<classpathentry kind="lib" path="lib/installer-exclude/mac_widgets-0.9.5.jar"/>
<classpathentry kind="lib" path="lib/installer-exclude/objenesis-1.2.jar"/>
<classpathentry kind="lib" path="lib/installer-exclude/otr4j.jar"/>
<classpathentry kind="lib" path="lib/installer-exclude/pircbot.jar"/>
<classpathentry kind="lib" path="lib/installer-exclude/profiler4j-1.0-beta3-SC.jar"/>
<classpathentry kind="lib" path="lib/installer-exclude/libphonenumber-5.9.jar"/>
<classpathentry kind="lib" path="lib/installer-exclude/sdes4j.jar"/>
@ -84,10 +83,6 @@
<classpathentry kind="lib" path="lib/installer-exclude/zrtp4j-light.jar"/>
<classpathentry kind="lib" path="lib/installer-exclude/jcalendar-1.4.jar"/>
<classpathentry kind="lib" path="lib/installer-exclude/hsqldb.jar"/>
<classpathentry kind="lib" path="lib/installer-exclude/irc-api-1.0.jar" sourcepath="lib/installer-exclude/irc-api-1.0-sources.jar">
<attributes>
<attribute name="javadoc_location" value="jar:platform:/resource/jitsi/lib/installer-exclude/irc-api-1.0-javadoc.jar!/"/>
</attributes>
</classpathentry>
<classpathentry kind="lib" path="lib/installer-exclude/irc-api-1.0.jar" sourcepath="lib/installer-exclude/irc-api-1.0-sources.jar"/>
<classpathentry kind="output" path="classes"/>
</classpath>

Binary file not shown.

@ -21,7 +21,9 @@
import com.ircclouds.irc.api.state.*;
/**
* An implementation of the PircBot IRC stack.
* An implementation of IRC using the irc-api library.
*
* @author Danny van Heumen
*/
public class IrcStack
{
@ -132,18 +134,21 @@ public void connect(String host, int port, String password,
final Exception[] exceptionContainer = new Exception[1];
this.irc = new IRCApiImpl(true);
// FIXME Currently, the secure connection is created by
// explicitly creating an SSLContext for 'SSL'. According
// to Ingo (in a mailing list conversation) it is better to
// use the CertificateService for this. This should be
// implemented in the irc-api library, though.
this.params.setServer(new IRCServer(host, port, password, secureConnection));
// FIXME Currently, the secure connection is created by
// explicitly creating an SSLContext for 'SSL'. According
// to Ingo (in a mailing list conversation) it is better to
// use the CertificateService for this. This should be
// implemented in the irc-api library, though.
this.params.setServer(new IRCServer(host, port, password,
secureConnection));
synchronized (this.irc)
{
// register a server listener in order to catch server and cross-/multi-channel messages
// register a server listener in order to catch server and
// cross-/multi-channel messages
this.irc.addListener(new ServerListener());
// start connecting to the specified server ...
// TODO Catch IOException/SocketException in case of early failure in call to connect()
// TODO Catch IOException/SocketException in case of early failure
// in call to connect()
this.irc.connect(this.params, new Callback<IIRCState>()
{
@ -175,7 +180,8 @@ public void onFailure(Exception e)
// wait while the irc connection is being established ...
try
{
System.out.println("Waiting for the connection to be established ...");
System.out
.println("Waiting for the connection to be established ...");
this.irc.wait();
if (this.connectionState != null
&& this.connectionState.isConnected())

Loading…
Cancel
Save