Commit 90bd63e2 authored by Daniel Henninger's avatar Daniel Henninger Committed by dhenninger

[GATE-189] Adapted yahoo transport to accept email like accounts.

[GATE-192] Auto-logout sessions upon password update.
[GATE-191] Auto-logout sessions upon registration delete.
[GATE-186] Some tweaks to try to get proper encoding for ICQ offline messages.
[GATE-118] Little more work on "buddy added me" stuff.
Moved ICQ to "experimental" transports section.

git-svn-id: http://svn.igniterealtime.org/svn/repos/wildfire/trunk/src/plugins/gateway@7483 b35dd754-fafc-0310-a699-88a17e54d16e
parent b3b77f22
...@@ -1298,6 +1298,13 @@ public abstract class BaseTransport implements Component, RosterEventListener { ...@@ -1298,6 +1298,13 @@ public abstract class BaseTransport implements Component, RosterEventListener {
registration.setPassword(password); registration.setPassword(password);
foundReg = true; foundReg = true;
} }
try {
TransportSession relatedSession = sessionManager.getSession(registration.getJID().getNode());
this.registrationLoggedOut(relatedSession);
}
catch (NotFoundException e) {
// No worries, move on.
}
} }
if (!foundReg) { if (!foundReg) {
......
...@@ -143,11 +143,13 @@ public class BOSConnection extends BasicFlapConnection { ...@@ -143,11 +143,13 @@ public class BOSConnection extends BasicFlapConnection {
String sn = String.valueOf(omic.getFromUIN()); String sn = String.valueOf(omic.getFromUIN());
//String msg = "Offline message sent at "+new Date(omic.getDate().getTime()).toString()+"\n"+OscarTools.stripHtml(omic.getContents()).trim(); //String msg = "Offline message sent at "+new Date(omic.getDate().getTime()).toString()+"\n"+OscarTools.stripHtml(omic.getContents()).trim();
String msg = "Offline message received:\n"+ StringUtils.unescapeFromXML(OscarTools.stripHtml(omic.getContents()).trim()); String msg = "Offline message received:\n"+ StringUtils.unescapeFromXML(OscarTools.stripHtml(omic.getContents()).trim());
EncodedStringInfo encmsg = MinimalEncoder.encodeMinimally(msg);
InstantMessage imsg = new InstantMessage(encmsg.getImEncoding().getCharsetCode(), ByteBlock.wrap(encmsg.getData()));
oscarSession.getTransport().sendMessage( oscarSession.getTransport().sendMessage(
oscarSession.getJIDWithHighestPriority(), oscarSession.getJIDWithHighestPriority(),
oscarSession.getTransport().convertIDToJID(sn), oscarSession.getTransport().convertIDToJID(sn),
msg imsg.getMessage()
); );
} }
else if (cmd instanceof OfflineMsgDoneCmd) { else if (cmd instanceof OfflineMsgDoneCmd) {
......
...@@ -41,6 +41,7 @@ import net.kano.joscar.snaccmd.*; ...@@ -41,6 +41,7 @@ import net.kano.joscar.snaccmd.*;
import net.kano.joscar.snaccmd.icbm.RecvImIcbm; import net.kano.joscar.snaccmd.icbm.RecvImIcbm;
import net.kano.joscar.snaccmd.icbm.InstantMessage; import net.kano.joscar.snaccmd.icbm.InstantMessage;
import net.kano.joscar.snaccmd.icbm.TypingCmd; import net.kano.joscar.snaccmd.icbm.TypingCmd;
import net.kano.joscar.snaccmd.icbm.OldIcbm;
import net.kano.joscar.snaccmd.buddy.BuddyStatusCmd; import net.kano.joscar.snaccmd.buddy.BuddyStatusCmd;
import net.kano.joscar.snaccmd.buddy.BuddyOfflineCmd; import net.kano.joscar.snaccmd.buddy.BuddyOfflineCmd;
import net.kano.joscar.ratelim.RateLimitingQueueMgr; import net.kano.joscar.ratelim.RateLimitingQueueMgr;
...@@ -112,6 +113,20 @@ public abstract class BasicFlapConnection extends BaseFlapConnection { ...@@ -112,6 +113,20 @@ public abstract class BasicFlapConnection extends BaseFlapConnection {
msg msg
); );
} }
else if (cmd instanceof OldIcbm) {
OldIcbm oicbm = (OldIcbm) cmd;
if (oicbm.getMessageType() == OldIcbm.MTYPE_PLAIN) {
String uin = String.valueOf(oicbm.getSender());
InstantMessage message = oicbm.getMessage();
String msg = StringUtils.unescapeFromXML(OscarTools.stripHtml(message.getMessage()));
oscarSession.getTransport().sendMessage(
oscarSession.getJIDWithHighestPriority(),
oscarSession.getTransport().convertIDToJID(uin),
msg
);
}
}
else if (cmd instanceof WarningNotification) { else if (cmd instanceof WarningNotification) {
WarningNotification wn = (WarningNotification) cmd; WarningNotification wn = (WarningNotification) cmd;
MiniUserInfo warner = wn.getWarner(); MiniUserInfo warner = wn.getWarner();
......
...@@ -69,7 +69,7 @@ public class YahooTransport extends BaseTransport { ...@@ -69,7 +69,7 @@ public class YahooTransport extends BaseTransport {
* @see org.jivesoftware.wildfire.gateway.BaseTransport#isUsernameValid(String) * @see org.jivesoftware.wildfire.gateway.BaseTransport#isUsernameValid(String)
*/ */
public Boolean isUsernameValid(String username) { public Boolean isUsernameValid(String username) {
return username.matches("[\\w\\.]+"); return username.matches("[^ \\p{Cntrl}()@,;:\\\\\"\\[\\]]+@?[^ \\p{Cntrl}()@,;:\\\\\"\\[\\]]+");
} }
/** /**
......
...@@ -606,7 +606,6 @@ ...@@ -606,7 +606,6 @@
<form action="" name="gatewayForm"> <form action="" name="gatewayForm">
<% aimSettings.printSettingsDialog(); %> <% aimSettings.printSettingsDialog(); %>
<% icqSettings.printSettingsDialog(); %>
<% ircSettings.printSettingsDialog(); %> <% ircSettings.printSettingsDialog(); %>
<% msnSettings.printSettingsDialog(); %> <% msnSettings.printSettingsDialog(); %>
...@@ -616,6 +615,7 @@ ...@@ -616,6 +615,7 @@
<p><fmt:message key="gateway.web.settings.unstable.notice" /></p> <p><fmt:message key="gateway.web.settings.unstable.notice" /></p>
<% icqSettings.printSettingsDialog(); %>
<% sipSettings.printSettingsDialog(); %> <% sipSettings.printSettingsDialog(); %>
<% yahooSettings.printSettingsDialog(); %> <% yahooSettings.printSettingsDialog(); %>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment