Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SPARK-2342 Remove unsupported gateway transports #878

Merged
merged 4 commits into from
Aug 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 0 additions & 10 deletions core/src/main/java/org/jivesoftware/resource/SparkRes.java
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,6 @@ public class SparkRes {
public static final String ADD_LINK_TO_CHAT = "ADD_LINK_TO_CHAT";
public static final String ADD_TO_CHAT = "ADD_TO_CHAT";
public static final String ADD_TO_KB = "ADD_TO_KB";
public static final String AIM_TRANSPORT_ACTIVE_IMAGE = "AIM_TRANSPORT_ACTIVE_IMAGE";
public static final String AIM_TRANSPORT_INACTIVE_IMAGE = "AIM_TRANSPORT_INACTIVE_IMAGE";
public static final String ALERT = "ALERT";
public static final String ALL_CHATS = "ALL_CHATS";
public static final String APP_NAME = "APP_NAME";
Expand Down Expand Up @@ -131,14 +129,10 @@ public class SparkRes {
public static final String GO = "GO";
public static final String GREEN_BALL = "GREEN_BALL";
public static final String GREEN_FLAG_16x16 = "GREEN_FLAG_16x16";
public static final String GTALK_TRANSPORT_ACTIVE_IMAGE = "GTALK_TRANSPORT_ACTIVE_IMAGE";
public static final String GTALK_TRANSPORT_INACTIVE_IMAGE = "GTALK_TRANSPORT_INACTIVE_IMAGE";
public static final String HEADSET_IMAGE = "HEADSET_IMAGE";
public static final String HELP2_24x24 = "HELP2_24x24";
public static final String HISTORY_16x16 = "HISTORY_16x16";
public static final String HISTORY_24x24_IMAGE = "HISTORY_24x24";
public static final String ICQ_TRANSPORT_ACTIVE_IMAGE = "ICQ_TRANSPORT_ACTIVE_IMAGE";
public static final String ICQ_TRANSPORT_INACTIVE_IMAGE = "ICQ_TRANSPORT_INACTIVE_IMAGE";
public static final String ID_CARD_48x48 = "ID_CARD_48x48";
public static final String IM_AVAILABLE_STALE_IMAGE = "IM_AVAILABLE_STALE_IMAGE";
public static final String IM_AWAY = "IM_AWAY";
Expand Down Expand Up @@ -189,8 +183,6 @@ public class SparkRes {
public static final String MINUS_SIGN = "MINUS_SIGN";
public static final String MOBILE_PHONE_IMAGE = "MOBILE_PHONE_IMAGE";
public static final String MODERATOR_IMAGE = "MODERATOR_IMAGE";
public static final String MSN_TRANSPORT_ACTIVE_IMAGE = "MSN_TRANSPORT_ACTIVE_IMAGE";
public static final String MSN_TRANSPORT_INACTIVE_IMAGE = "MSN_TRANSPORT_INACTIVE_IMAGE";
public static final String MYSPACE_TRANSPORT_ACTIVE_IMAGE = "MYSPACE_TRANSPORT_ACTIVE_IMAGE";
public static final String MYSPACE_TRANSPORT_INACTIVE_IMAGE = "MYSPACE_TRANSPORT_INACTIVE_IMAGE";
public static final String NOTEBOOK_IMAGE = "NOTEBOOK_IMAGE";
Expand Down Expand Up @@ -330,8 +322,6 @@ public class SparkRes {
public static final String WORKGROUP_QUEUE = "WORKGROUP_QUEUE";
public static final String XMPP_TRANSPORT_ACTIVE_IMAGE = "XMPP_TRANSPORT_ACTIVE_IMAGE";
public static final String XMPP_TRANSPORT_INACTIVE_IMAGE = "XMPP_TRANSPORT_INACTIVE_IMAGE";
public static final String YAHOO_TRANSPORT_ACTIVE_IMAGE = "YAHOO_TRANSPORT_ACTIVE_IMAGE";
public static final String YAHOO_TRANSPORT_INACTIVE_IMAGE = "YAHOO_TRANSPORT_INACTIVE_IMAGE";
public static final String YELLOW_BALL = "YELLOW_BALL";
public static final String YELLOW_FLAG_16x16 = "YELLOW_FLAG_16x16";
public static final String EXECUTABLE_NAME = "EXECUTABLE_NAME";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@

import org.jivesoftware.spark.plugin.Plugin;
import org.jivesoftware.spark.ui.*;
import org.jivesoftware.spark.util.StringUtils;
import org.jivesoftware.spark.util.SwingWorker;
import org.jivesoftware.spark.util.log.Log;
import org.jivesoftware.sparkimpl.plugin.gateways.transports.*;
Expand Down Expand Up @@ -128,66 +129,50 @@ public void uninstall() {

private void populateTransports() {
DiscoverItems discoItems = SparkManager.getSessionManager().getDiscoveredItems();

for (DiscoverItems.Item item : discoItems.getItems() ) {

for (DiscoverItems.Item item : discoItems.getItems()) {
String entityName = item.getEntityID().toString();
if (entityName != null) {
if (entityName.startsWith("aim.")) {
AIMTransport aim = new AIMTransport(item.getEntityID().asDomainBareJid());
TransportUtils.addTransport(item.getEntityID().asDomainBareJid(), aim);
}
else if (entityName.startsWith("msn.")) {
MSNTransport msn = new MSNTransport(item.getEntityID().asDomainBareJid());
TransportUtils.addTransport(item.getEntityID().asDomainBareJid(), msn);
}
else if (entityName.startsWith("yahoo.")) {
YahooTransport yahoo = new YahooTransport(item.getEntityID().asDomainBareJid());
TransportUtils.addTransport(item.getEntityID().asDomainBareJid(), yahoo);
}
else if (entityName.startsWith("icq.")) {
ICQTransport icq = new ICQTransport(item.getEntityID().asDomainBareJid());
TransportUtils.addTransport(item.getEntityID().asDomainBareJid(), icq);
}
else if (entityName.startsWith("gtalk.")) {
GTalkTransport gtalk = new GTalkTransport(item.getEntityID().asDomainBareJid());
TransportUtils.addTransport(item.getEntityID().asDomainBareJid(), gtalk);
}
else if (entityName.startsWith("xmpp.")) {
int dotPos = entityName.indexOf('.');
if (dotPos == -1) {
continue;
}
String transportPrefix = entityName.substring(0, dotPos);
switch (transportPrefix) {
case "xmpp":
XMPPTransport xmppTransport = new XMPPTransport(item.getEntityID().asDomainBareJid());
TransportUtils.addTransport(item.getEntityID().asDomainBareJid(), xmppTransport);
}
else if (entityName.startsWith("irc.")) {
break;
case "irc":
IRCTransport ircTransport = new IRCTransport(item.getEntityID().asDomainBareJid());
TransportUtils.addTransport(item.getEntityID().asDomainBareJid(), ircTransport);
}
else if (entityName.startsWith("sip.") || entityName.startsWith("simple.")) {
break;
case "sip":
case "simple":
SimpleTransport simpleTransport = new SimpleTransport(item.getEntityID().asDomainBareJid());
TransportUtils.addTransport(item.getEntityID().asDomainBareJid(), simpleTransport);
}
else if (entityName.startsWith("gadugadu.")) {
break;
case "gadugadu":
GaduGaduTransport gadugaduTransport = new GaduGaduTransport(item.getEntityID().asDomainBareJid());
TransportUtils.addTransport(item.getEntityID().asDomainBareJid(), gadugaduTransport);
}
else if (entityName.startsWith("qq.")) {
break;
case "qq":
QQTransport qqTransport = new QQTransport(item.getEntityID().asDomainBareJid());
TransportUtils.addTransport(item.getEntityID().asDomainBareJid(), qqTransport);
}
else if (entityName.startsWith("sametime.")) {
SametimeTransport sametimeTransport = new SametimeTransport(item.getEntityID().asDomainBareJid());
break;
case "sametime":
SametimeTransport sametimeTransport = new SametimeTransport(item.getEntityID().asDomainBareJid());
TransportUtils.addTransport(item.getEntityID().asDomainBareJid(), sametimeTransport);
}
else if (entityName.startsWith("facebook.")) {
FacebookTransport facebookTransport = new FacebookTransport(item.getEntityID().asDomainBareJid());
break;
case "facebook":
FacebookTransport facebookTransport = new FacebookTransport(item.getEntityID().asDomainBareJid());
TransportUtils.addTransport(item.getEntityID().asDomainBareJid(), facebookTransport);
}
else if (entityName.startsWith("myspace.") || entityName.startsWith("myspaceim.")) {
MySpaceTransport myspaceTransport = new MySpaceTransport(item.getEntityID().asDomainBareJid());
break;
case "myspace":
case "myspaceim":
MySpaceTransport myspaceTransport = new MySpaceTransport(item.getEntityID().asDomainBareJid());
TransportUtils.addTransport(item.getEntityID().asDomainBareJid(), myspaceTransport);
}
break;
}
}

}

private void addTransport(final Transport transport) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ public void invoke() {
dialog = new JDialog(SparkManager.getMainWindow(), transport.getTitle(), false);
dialog.add(this);
dialog.pack();
dialog.setSize(400, 200);
dialog.setSize(400, 250);
dialog.setDefaultCloseOperation(JDialog.DO_NOTHING_ON_CLOSE);

GraphicUtils.centerWindowOnComponent(dialog, SparkManager.getMainWindow());
Expand Down

This file was deleted.

This file was deleted.

Loading
Loading