From bc25f25bbb0458c79b833182c7f4edb3ea96e1e1 Mon Sep 17 00:00:00 2001 From: Hylke Bons Date: Fri, 18 Nov 2011 21:40:42 +0000 Subject: [PATCH] remove smartirc and related code. Closes #435 --- .gitmodules | 3 - Makefile.am | 2 +- SparkleLib/SparkleListenerIrc.cs | 219 -------------------------- autogen.sh | 10 -- build/build.environment.mk | 2 - build/m4/sparkleshare/smartirc4net.m4 | 16 -- configure.ac | 12 -- 7 files changed, 1 insertion(+), 263 deletions(-) delete mode 100644 .gitmodules delete mode 100755 SparkleLib/SparkleListenerIrc.cs delete mode 100755 build/m4/sparkleshare/smartirc4net.m4 diff --git a/.gitmodules b/.gitmodules deleted file mode 100644 index 2d9ee5ea..00000000 --- a/.gitmodules +++ /dev/null @@ -1,3 +0,0 @@ -[submodule "SmartIrc4net"] - path = SmartIrc4net - url = git://git.qnetp.net/smartirc4net.git diff --git a/Makefile.am b/Makefile.am index 1ca9d1da..b4293c03 100755 --- a/Makefile.am +++ b/Makefile.am @@ -1,4 +1,4 @@ -basedirs = build help SmartIrc4net SparkleLib data po +basedirs = build help SparkleLib data po SUBDIRS = $(basedirs) $(GUISUBDIRS) DIST_SUBDIRS = $(basedirs) SparkleShare diff --git a/SparkleLib/SparkleListenerIrc.cs b/SparkleLib/SparkleListenerIrc.cs deleted file mode 100755 index 9f9a79cb..00000000 --- a/SparkleLib/SparkleListenerIrc.cs +++ /dev/null @@ -1,219 +0,0 @@ -// SparkleShare, a collaboration and sharing tool. -// Copyright (C) 2010 Hylke Bons -// -// This program is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with this program. If not, see . - - -using System; -using System.Text; -using System.Threading; -using System.Security.Cryptography; - -using Meebey.SmartIrc4net; - -namespace SparkleLib { - - public class SparkleListenerIrc : SparkleListenerBase { - - private Thread thread; - private IrcClient client; - private string nick; - private string announcements_password; - private bool allow_passwordless_join; - - - public SparkleListenerIrc (Uri server, string folder_identifier) : - base (server, folder_identifier) - { - // Try to get a uniqueish nickname - this.nick = SHA1 (DateTime.Now.ToString ("ffffff") + "sparkles"); - - // Most irc servers don't allow nicknames starting - // with a number, so prefix an alphabetic character - this.nick = "s" + this.nick.Substring (0, 7); - - // Optional password to make the channel access more safe - this.announcements_password = - SparkleConfig.DefaultConfig.GetConfigOption ("announcements_password"); - - // Option to allow access to channel when no password is defined - try { - string option = SparkleConfig.DefaultConfig.GetConfigOption ("allow_passwordless_join"); - this.allow_passwordless_join = (option == null || Convert.ToBoolean (option)); - } catch (Exception) { - this.allow_passwordless_join = true; - } - - base.channels.Add ("#" + folder_identifier); - - this.client = new IrcClient () { - PingTimeout = 180, - PingInterval = 60 - }; - - string proxy = Environment.GetEnvironmentVariable ("http_proxy"); - Uri proxy_uri = null; - if (!String.IsNullOrEmpty (proxy) && - Uri.TryCreate (proxy, UriKind.Absolute, out proxy_uri)) { - - if (proxy_uri.Scheme == "http") { - this.client.ProxyType = ProxyType.Http; - this.client.ProxyHost = proxy_uri.Host; - this.client.ProxyPort = proxy_uri.Port; - } - } - - this.client.OnConnected += delegate { - base.is_connecting = false; - OnConnected (); - }; - - this.client.OnDisconnected += delegate { - base.is_connecting = false; - OnDisconnected (); - }; - - this.client.OnError += delegate { - base.is_connecting = false; - OnDisconnected (); - }; - - this.client.OnChannelMessage += delegate (object o, IrcEventArgs args) { - string message = args.Data.Message.Trim (); - string folder_id = args.Data.Channel.Substring (1); // remove the starting hash - OnAnnouncement (new SparkleAnnouncement (folder_id, message)); - }; - } - - - public override bool IsConnected { - get { - return this.client.IsConnected; - } - } - - - // Starts a new thread and listens to the channel - public override void Connect () - { - SparkleHelpers.DebugInfo ("ListenerIrc", "Connecting to " + Server); - - base.is_connecting = true; - - this.thread = new Thread ( - new ThreadStart (delegate { - try { - // Connect, login, and join the channel - int port = base.server.Port; - - if (port < 0) - port = 6667; - - this.client.Connect (base.server.Host, port); - this.client.Login (this.nick, this.nick, 8, this.nick); - - foreach (string channel in base.channels) { - SparkleHelpers.DebugInfo ("ListenerIrc", "Joining channel " + channel); - - if (!string.IsNullOrEmpty (this.announcements_password)) { - SparkleHelpers.DebugInfo ("ListenerIrc", "Password set to access the channel"); - this.client.RfcJoin (channel, this.announcements_password); - this.client.RfcMode (channel, "+k " + this.announcements_password); - - } else { - if (this.allow_passwordless_join) { - SparkleHelpers.DebugInfo ("ListenerIrc", "Accessing unprotected channel, change the setting to not access"); - this.client.RfcJoin (channel); - - } else { - SparkleHelpers.DebugInfo ("ListenerIrc", "Unprotected channel, change the setting to access"); - base.is_connecting = false; - OnDisconnected (); - throw new ConnectionException ("Unprotected channel, change the setting to access"); - } - } - - this.client.RfcMode (channel, "+s"); - } - - // List to the channel, this blocks the thread - this.client.Listen (); - - // Disconnect when we time out - this.client.Disconnect (); - - } catch (ConnectionException e) { - SparkleHelpers.DebugInfo ("ListenerIrc", "Could not connect to " + Server + ": " + e.Message); - } - }) - ); - - this.thread.Start (); - } - - - public override void AlsoListenTo (string folder_identifier) - { - string channel = "#" + folder_identifier; - if (!base.channels.Contains (channel)) { - base.channels.Add (channel); - - if (IsConnected) { - SparkleHelpers.DebugInfo ("ListenerIrc", "Joining channel " + channel); - if (this.announcements_password != null) { - SparkleHelpers.DebugInfo ("ListenerIrc", "Password set to access the channel"); - this.client.RfcJoin (channel, this.announcements_password); - this.client.RfcMode (channel, "+k " + this.announcements_password); - } else { - if (allow_passwordless_join) { - SparkleHelpers.DebugInfo ("ListenerIrc", "Accessing a dangerous channel change the setting to not access"); - this.client.RfcJoin (channel); - } else { - SparkleHelpers.DebugInfo ("ListenerIrc", "Dangerous channel, change the setting to access"); - } - } - this.client.RfcMode (channel, "+s"); - } - } - } - - - public override void Announce (SparkleAnnouncement announcement) - { - string channel = "#" + announcement.FolderIdentifier; - this.client.SendMessage (SendType.Message, channel, announcement.Message); - - // Also announce to ourselves for debugging purposes - // base.OnAnnouncement (announcement); - } - - - public override void Dispose () - { - this.thread.Abort (); - this.thread.Join (); - base.Dispose (); - } - - - // Creates a SHA-1 hash of input - private string SHA1 (string s) - { - SHA1 sha1 = new SHA1CryptoServiceProvider (); - Byte[] bytes = ASCIIEncoding.Default.GetBytes (s); - Byte[] encoded_bytes = sha1.ComputeHash (bytes); - return BitConverter.ToString (encoded_bytes).ToLower ().Replace ("-", ""); - } - } -} diff --git a/autogen.sh b/autogen.sh index 41a48155..3af42db6 100755 --- a/autogen.sh +++ b/autogen.sh @@ -73,10 +73,6 @@ else touch gnome-doc-utils.make fi -if git --help &>/dev/null; then - git submodule update --init -fi - run intltoolize --force --copy run $LIBTOOLIZE --force --copy --automake run aclocal -I build/m4/sparkleshare -I build/m4/shamrock -I build/m4/shave $ACLOCAL_FLAGS @@ -85,12 +81,6 @@ run autoconf run automake --gnu --add-missing --force --copy \ -Wno-portability -Wno-portability -if test -d $srcdir/SmartIrc4net; then - echo Running SmartIrc4net/autogen.sh ... - (cd $srcdir/SmartIrc4net; NOCONFIGURE=1 ./autogen.sh "$@") - echo Done running SmartIrc4net/autogen.sh ... -fi - if [ ! -z "$NOCONFIGURE" ]; then echo "Done. ./configure skipped." exit $? diff --git a/build/build.environment.mk b/build/build.environment.mk index a76b32ff..e59b6fd1 100755 --- a/build/build.environment.mk +++ b/build/build.environment.mk @@ -15,8 +15,6 @@ LINK_GTK = $(GTKSHARP_LIBS) LINK_GNOME = $(GNOME_SHARP_LIBS) LINK_DBUS = $(NDESK_DBUS_LIBS) $(NDESK_DBUS_GLIB_LIBS) LINK_DBUS_NO_GLIB = $(NDESK_DBUS_LIBS) -LINK_SMARTIRC4NET_SYSTEM = $(SMARTIRC4NET_LIBS) -LINK_SMARTIRC4NET_LOCAL = -r:$(abs_top_builddir)/$(SMARTIRC4NET_ASSEMBLY) LINK_APP_INDICATOR = $(APP_INDICATOR_LIBS) REF_NOTIFY_SHARP = $(LINK_SYSTEM) $(LINK_DBUS) $(GTKSHARP_LIBS) $(GLIBSHARP_LIBS) diff --git a/build/m4/sparkleshare/smartirc4net.m4 b/build/m4/sparkleshare/smartirc4net.m4 deleted file mode 100755 index 9cb1099b..00000000 --- a/build/m4/sparkleshare/smartirc4net.m4 +++ /dev/null @@ -1,16 +0,0 @@ -AC_DEFUN([SPARKLESHARE_SMARTIRC4NET], -[ - if test ! -d "$srcdir/SmartIrc4net"; then - AC_MSG_ERROR([SmartIrc4net folder not found]) - fi - ac_configure_args="$ac_configure_args --disable-pkg-config --disable-pkg-lib --disable-pkg-gac" - AC_CONFIG_SUBDIRS([SmartIrc4net]) - asm="SmartIrc4net/bin/Meebey.SmartIrc4net.dll" - SMARTIRC4NET_ASSEMBLY="$asm" - SMARTIRC4NET_FILES="$asm" - [[ -r "$asm.mdb" ]] && SMARTIRC4NET_FILES="$SMARTIRC4NET_FILES $asm.mdb" - - AC_SUBST([SMARTIRC4NET_ASSEMBLY]) - AC_SUBST([SMARTIRC4NET_FILES]) -]) - diff --git a/configure.ac b/configure.ac index 2116eb11..2e682cec 100755 --- a/configure.ac +++ b/configure.ac @@ -87,18 +87,6 @@ dnl package checks, common for all configs SPARKLESHARE_CHECK_GTK_SHARP -SPARKLESHARE_SMARTIRC4NET -PKG_CHECK_MODULES([SMARTIRC4NET], [smartirc4net >= 0.5], - SMARTIRC4NET_ASSEMBLY="" - AC_SUBST(SMARTIRC4NET_ASSEMBLY) - , - SMARTIRC4NET_LIBS="" - AC_SUBST(SMARTIRC4NET_LIBS) - SPARKLE_SMARTIRC4NETDIR=SmartIrc4Net - AC_SUBST(SPARKLE_SMARTIRC4NETDIR) -) -AM_CONDITIONAL([HAVE_SMARTIRC4NET], test x$SPARKLE_SMARTIRC4NETDIR = x) - AC_ARG_ENABLE(gtkui, AS_HELP_STRING([--disable-gtkui], [Do not build the Gtk+ user interface]), [ enable_gtkui=no ], [ enable_gtkui=yes ])