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