listener base: code cleanup
This commit is contained in:
parent
3a42d1c1de
commit
5002e19fa0
|
@ -98,36 +98,21 @@ namespace SparkleLib {
|
||||||
public abstract bool IsConnected { get; }
|
public abstract bool IsConnected { get; }
|
||||||
|
|
||||||
|
|
||||||
// Announcements that weren't sent off
|
protected List<string> channels = new List<string> ();
|
||||||
// because we were disconnected
|
|
||||||
protected List<SparkleAnnouncement> queue_up = new List<SparkleAnnouncement> ();
|
protected List<SparkleAnnouncement> queue_up = new List<SparkleAnnouncement> ();
|
||||||
protected List<SparkleAnnouncement> queue_down = new List<SparkleAnnouncement> ();
|
protected List<SparkleAnnouncement> queue_down = new List<SparkleAnnouncement> ();
|
||||||
protected string server;
|
|
||||||
protected List<string> channels = new List<string> ();
|
|
||||||
protected bool is_connecting;
|
protected bool is_connecting;
|
||||||
|
protected string server;
|
||||||
|
|
||||||
|
|
||||||
public SparkleListenerBase (string server, string folder_identifier, NotificationServerType type) { }
|
public SparkleListenerBase (string server, string folder_identifier, NotificationServerType type) { }
|
||||||
|
|
||||||
|
|
||||||
public string Server {
|
|
||||||
get {
|
|
||||||
return this.server;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
public bool IsConnecting {
|
|
||||||
get {
|
|
||||||
return this.is_connecting;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
public void AnnounceBase (SparkleAnnouncement announcement) {
|
public void AnnounceBase (SparkleAnnouncement announcement) {
|
||||||
if (IsConnected) {
|
if (IsConnected) {
|
||||||
SparkleHelpers.DebugInfo ("Listener", "Announcing to " + announcement.FolderIdentifier + " on " + this.server);
|
SparkleHelpers.DebugInfo ("Listener", "Announcing to " + announcement.FolderIdentifier + " on " + this.server);
|
||||||
Announce (announcement);
|
Announce (announcement);
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
SparkleHelpers.DebugInfo ("Listener", "Not connected to " + this.server + ". Queuing message");
|
SparkleHelpers.DebugInfo ("Listener", "Not connected to " + this.server + ". Queuing message");
|
||||||
this.queue_up.Add (announcement);
|
this.queue_up.Add (announcement);
|
||||||
|
@ -183,5 +168,19 @@ namespace SparkleLib {
|
||||||
if (RemoteChange != null)
|
if (RemoteChange != null)
|
||||||
RemoteChange (announcement);
|
RemoteChange (announcement);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public string Server {
|
||||||
|
get {
|
||||||
|
return this.server;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public bool IsConnecting {
|
||||||
|
get {
|
||||||
|
return this.is_connecting;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue