Commit a096afa1 authored by Daniel Henninger's avatar Daniel Henninger Committed by dhenninger

Committing new openymsg base for Yahoo transport.

Added new Russian translation from Kolbasenko Andrey.
Added in exclude for redhat rpm related stuff for build.

git-svn-id: http://svn.igniterealtime.org/svn/repos/openfire/trunk@8069 b35dd754-fafc-0310-a699-88a17e54d16e
parent 1f760e41
...@@ -1554,7 +1554,7 @@ ...@@ -1554,7 +1554,7 @@
<copy todir="${mac.pkg.dir}/usr/local/openfire"> <copy todir="${mac.pkg.dir}/usr/local/openfire">
<fileset dir="${target.dir}/openfire"> <fileset dir="${target.dir}/openfire">
<exclude name="**/openfired"/> <exclude name="**/openfired"/>
<exclude name="**/openfire-sysconfig"/> <exclude name="**/redhat"/>
<exclude name="**/embedded-db*"/> <exclude name="**/embedded-db*"/>
<exclude name="**/redhat-postinstall.sh"/> <exclude name="**/redhat-postinstall.sh"/>
</fileset> </fileset>
......
...@@ -239,6 +239,24 @@ ...@@ -239,6 +239,24 @@
<SOURCES /> <SOURCES />
</library> </library>
</orderEntry> </orderEntry>
<orderEntry type="module-library">
<library>
<CLASSES>
<root url="jar://$MODULE_DIR$/../../src/plugins/gateway/lib/openymsg_support.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</orderEntry>
<orderEntry type="module-library">
<library>
<CLASSES>
<root url="jar://$MODULE_DIR$/../../src/plugins/gateway/lib/openymsg_network.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</orderEntry>
<orderEntryProperties /> <orderEntryProperties />
</component> </component>
</module> </module>
......
...@@ -10,6 +10,8 @@ jml.jar | svn-20070225 ...@@ -10,6 +10,8 @@ jml.jar | svn-20070225
joscar-client.jar | svn-20070204 (patched [#2]) joscar-client.jar | svn-20070204 (patched [#2])
joscar-common.jar | svn-20070204 joscar-common.jar | svn-20070204
joscar-protocol.jar | svn-20070204 (patched [#2]) joscar-protocol.jar | svn-20070204 (patched [#2])
openymsg_network | svn-20070419
openymsg_support | svn-20070419
picocontainer.jar | 1.2.0 picocontainer.jar | 1.2.0
saaj.jar | 1.3 saaj.jar | 1.3
smack.jar | 3.0.1 smack.jar | 3.0.1
......
This diff is collapsed.
...@@ -20,7 +20,7 @@ import org.xmpp.packet.JID; ...@@ -20,7 +20,7 @@ import org.xmpp.packet.JID;
import org.xmpp.packet.Message; import org.xmpp.packet.Message;
import org.xmpp.packet.PacketError; import org.xmpp.packet.PacketError;
import org.xmpp.packet.Presence; import org.xmpp.packet.Presence;
import ymsg.network.*; import org.openymsg.network.*;
import java.io.IOException; import java.io.IOException;
import java.util.*; import java.util.*;
...@@ -101,7 +101,7 @@ public class YahooSession extends TransportSession { ...@@ -101,7 +101,7 @@ public class YahooSession extends TransportSession {
public void run() { public void run() {
try { try {
loginAttempts++; loginAttempts++;
yahooSession.setStatus(StatusConstants.STATUS_AVAILABLE); yahooSession.setStatus(Status.AVAILABLE);
yahooSession.login(registration.getUsername(), registration.getPassword()); yahooSession.login(registration.getUsername(), registration.getPassword());
setLoginStatus(TransportLoginStatus.LOGGED_IN); setLoginStatus(TransportLoginStatus.LOGGED_IN);
...@@ -119,14 +119,14 @@ public class YahooSession extends TransportSession { ...@@ -119,14 +119,14 @@ public class YahooSession extends TransportSession {
catch (LoginRefusedException e) { catch (LoginRefusedException e) {
yahooSession.reset(); yahooSession.reset();
String reason = LocaleUtils.getLocalizedString("gateway.yahoo.loginrefused", "gateway"); String reason = LocaleUtils.getLocalizedString("gateway.yahoo.loginrefused", "gateway");
switch((int)e.getStatus()) { AuthenticationState state = e.getStatus();
case (int)StatusConstants.STATUS_BADUSERNAME: if (state.equals(AuthenticationState.BADUSERNAME)) {
reason = LocaleUtils.getLocalizedString("gateway.yahoo.unknownuser", "gateway"); reason = LocaleUtils.getLocalizedString("gateway.yahoo.unknownuser", "gateway");
break; }
case (int)StatusConstants.STATUS_BAD: else if (state.equals(AuthenticationState.BAD)) {
reason = LocaleUtils.getLocalizedString("gateway.yahoo.badpassword", "gateway"); reason = LocaleUtils.getLocalizedString("gateway.yahoo.badpassword", "gateway");
break; }
case (int)StatusConstants.STATUS_LOCKED: else if (state.equals(AuthenticationState.LOCKED)) {
AccountLockedException e2 = (AccountLockedException)e; AccountLockedException e2 = (AccountLockedException)e;
if(e2.getWebPage() != null) { if(e2.getWebPage() != null) {
reason = LocaleUtils.getLocalizedString("gateway.yahoo.accountlockedwithurl", "gateway", Arrays.asList(e2.getWebPage().toString())); reason = LocaleUtils.getLocalizedString("gateway.yahoo.accountlockedwithurl", "gateway", Arrays.asList(e2.getWebPage().toString()));
...@@ -134,7 +134,6 @@ public class YahooSession extends TransportSession { ...@@ -134,7 +134,6 @@ public class YahooSession extends TransportSession {
else { else {
reason = LocaleUtils.getLocalizedString("gateway.yahoo.accountlocked", "gateway"); reason = LocaleUtils.getLocalizedString("gateway.yahoo.accountlocked", "gateway");
} }
break;
} }
Log.warn("Yahoo login failed for "+getJID()+": "+reason); Log.warn("Yahoo login failed for "+getJID()+": "+reason);
...@@ -189,8 +188,7 @@ public class YahooSession extends TransportSession { ...@@ -189,8 +188,7 @@ public class YahooSession extends TransportSession {
// First we need to get a good mapping of users to what groups they are in. // First we need to get a good mapping of users to what groups they are in.
HashMap<String,ArrayList<String>> userToGroups = new HashMap<String,ArrayList<String>>(); HashMap<String,ArrayList<String>> userToGroups = new HashMap<String,ArrayList<String>>();
for (YahooGroup group : yahooSession.getGroups()) { for (YahooGroup group : yahooSession.getGroups()) {
for (Enumeration e = group.getMembers().elements(); e.hasMoreElements();) { for (YahooUser user : group.getMembers()) {
YahooUser user = (YahooUser)e.nextElement();
ArrayList<String> groups; ArrayList<String> groups;
if (userToGroups.containsKey(user.getId())) { if (userToGroups.containsKey(user.getId())) {
groups = userToGroups.get(user.getId()); groups = userToGroups.get(user.getId());
...@@ -271,9 +269,10 @@ public class YahooSession extends TransportSession { ...@@ -271,9 +269,10 @@ public class YahooSession extends TransportSession {
*/ */
public void removeContact(RosterItem item) { public void removeContact(RosterItem item) {
String contact = getTransport().convertJIDToID(item.getJid()); String contact = getTransport().convertJIDToID(item.getJid());
YahooUser yUser = new YahooUser(contact);
lockRoster(item.getJid().toString()); lockRoster(item.getJid().toString());
for (YahooGroup yahooGroup : yahooSession.getGroups()) { for (YahooGroup yahooGroup : yahooSession.getGroups()) {
if (yahooGroup.getIndexOfFriend(contact) != -1) { if (yahooGroup.contains(yUser)) {
try { try {
yahooSession.removeFriend(contact, yahooGroup.getName()); yahooSession.removeFriend(contact, yahooGroup.getName());
pseudoRoster.removeItem(contact); pseudoRoster.removeItem(contact);
...@@ -311,6 +310,7 @@ public class YahooSession extends TransportSession { ...@@ -311,6 +310,7 @@ public class YahooSession extends TransportSession {
* @param groups List of groups contact should be in. * @param groups List of groups contact should be in.
*/ */
public void syncContactGroups(String contact, List<String> groups) { public void syncContactGroups(String contact, List<String> groups) {
YahooUser yUser = new YahooUser(contact);
if (groups.size() == 0) { if (groups.size() == 0) {
groups.add("Transport Buddies"); groups.add("Transport Buddies");
} }
...@@ -334,7 +334,7 @@ public class YahooSession extends TransportSession { ...@@ -334,7 +334,7 @@ public class YahooSession extends TransportSession {
// Now we handle adds and removes, syncing the two lists. // Now we handle adds and removes, syncing the two lists.
for (YahooGroup yahooGroup : yahooSession.getGroups()) { for (YahooGroup yahooGroup : yahooSession.getGroups()) {
if (groups.contains(yahooGroup.getName())) { if (groups.contains(yahooGroup.getName())) {
if (yahooGroup.getIndexOfFriend(contact) == -1) { if (yahooGroup.contains(yUser)) {
try { try {
Log.debug("Yahoo: Adding contact "+contact+" to existing group "+yahooGroup.getName()); Log.debug("Yahoo: Adding contact "+contact+" to existing group "+yahooGroup.getName());
yahooSession.addFriend(contact, yahooGroup.getName()); yahooSession.addFriend(contact, yahooGroup.getName());
...@@ -345,7 +345,7 @@ public class YahooSession extends TransportSession { ...@@ -345,7 +345,7 @@ public class YahooSession extends TransportSession {
} }
} }
else { else {
if (yahooGroup.getIndexOfFriend(contact) != -1) { if (yahooGroup.contains(yUser)) {
try { try {
Log.debug("Yahoo: Removing contact "+contact+" from group "+yahooGroup.getName()); Log.debug("Yahoo: Removing contact "+contact+" from group "+yahooGroup.getName());
yahooSession.removeFriend(contact, yahooGroup.getName()); yahooSession.removeFriend(contact, yahooGroup.getName());
......
...@@ -15,7 +15,7 @@ import org.jivesoftware.util.LocaleUtils; ...@@ -15,7 +15,7 @@ import org.jivesoftware.util.LocaleUtils;
import org.jivesoftware.openfire.gateway.*; import org.jivesoftware.openfire.gateway.*;
import org.xmpp.packet.JID; import org.xmpp.packet.JID;
import org.xmpp.packet.Presence; import org.xmpp.packet.Presence;
import ymsg.network.StatusConstants; import org.openymsg.network.Status;
/** /**
* Yahoo Transport Interface. * Yahoo Transport Interface.
...@@ -107,27 +107,27 @@ public class YahooTransport extends BaseTransport { ...@@ -107,27 +107,27 @@ public class YahooTransport extends BaseTransport {
* @param jabStatus Jabber presence type. * @param jabStatus Jabber presence type.
* @return Yahoo status identifier. * @return Yahoo status identifier.
*/ */
public long convertJabStatusToYahoo(PresenceType jabStatus) { public Status convertJabStatusToYahoo(PresenceType jabStatus) {
if (jabStatus == PresenceType.available) { if (jabStatus == PresenceType.available) {
return StatusConstants.STATUS_AVAILABLE; return Status.AVAILABLE;
} }
else if (jabStatus == PresenceType.away) { else if (jabStatus == PresenceType.away) {
return StatusConstants.STATUS_BRB; return Status.BRB;
} }
else if (jabStatus == PresenceType.xa) { else if (jabStatus == PresenceType.xa) {
return StatusConstants.STATUS_STEPPEDOUT; return Status.STEPPEDOUT;
} }
else if (jabStatus == PresenceType.dnd) { else if (jabStatus == PresenceType.dnd) {
return StatusConstants.STATUS_BUSY; return Status.BUSY;
} }
else if (jabStatus == PresenceType.chat) { else if (jabStatus == PresenceType.chat) {
return StatusConstants.STATUS_AVAILABLE; return Status.AVAILABLE;
} }
else if (jabStatus == PresenceType.unavailable) { else if (jabStatus == PresenceType.unavailable) {
return StatusConstants.STATUS_OFFLINE; return Status.OFFLINE;
} }
else { else {
return StatusConstants.STATUS_AVAILABLE; return Status.AVAILABLE;
} }
} }
...@@ -137,38 +137,38 @@ public class YahooTransport extends BaseTransport { ...@@ -137,38 +137,38 @@ public class YahooTransport extends BaseTransport {
* @param packet Presence packet to be set up. * @param packet Presence packet to be set up.
* @param yahooStatus Yahoo StatusConstants constant. * @param yahooStatus Yahoo StatusConstants constant.
*/ */
public void setUpPresencePacket(Presence packet, long yahooStatus) { public void setUpPresencePacket(Presence packet, Status yahooStatus) {
if (yahooStatus == StatusConstants.STATUS_AVAILABLE) { if (yahooStatus == Status.AVAILABLE) {
// We're good, leave the type as blank for available. // We're good, leave the type as blank for available.
} }
else if (yahooStatus == StatusConstants.STATUS_BRB) { else if (yahooStatus == Status.BRB) {
packet.setShow(Presence.Show.away); packet.setShow(Presence.Show.away);
} }
else if (yahooStatus == StatusConstants.STATUS_BUSY) { else if (yahooStatus == Status.BUSY) {
packet.setShow(Presence.Show.dnd); packet.setShow(Presence.Show.dnd);
} }
else if (yahooStatus == StatusConstants.STATUS_IDLE) { else if (yahooStatus == Status.IDLE) {
packet.setShow(Presence.Show.away); packet.setShow(Presence.Show.away);
} }
else if (yahooStatus == StatusConstants.STATUS_OFFLINE) { else if (yahooStatus == Status.OFFLINE) {
packet.setType(Presence.Type.unavailable); packet.setType(Presence.Type.unavailable);
} }
else if (yahooStatus == StatusConstants.STATUS_NOTATDESK) { else if (yahooStatus == Status.NOTATDESK) {
packet.setShow(Presence.Show.away); packet.setShow(Presence.Show.away);
} }
else if (yahooStatus == StatusConstants.STATUS_NOTINOFFICE) { else if (yahooStatus == Status.NOTINOFFICE) {
packet.setShow(Presence.Show.away); packet.setShow(Presence.Show.away);
} }
else if (yahooStatus == StatusConstants.STATUS_ONPHONE) { else if (yahooStatus == Status.ONPHONE) {
packet.setShow(Presence.Show.away); packet.setShow(Presence.Show.away);
} }
else if (yahooStatus == StatusConstants.STATUS_ONVACATION) { else if (yahooStatus == Status.ONVACATION) {
packet.setShow(Presence.Show.xa); packet.setShow(Presence.Show.xa);
} }
else if (yahooStatus == StatusConstants.STATUS_OUTTOLUNCH) { else if (yahooStatus == Status.OUTTOLUNCH) {
packet.setShow(Presence.Show.xa); packet.setShow(Presence.Show.xa);
} }
else if (yahooStatus == StatusConstants.STATUS_STEPPEDOUT) { else if (yahooStatus == Status.STEPPEDOUT) {
packet.setShow(Presence.Show.away); packet.setShow(Presence.Show.away);
} }
else { else {
......
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