Lines 62-67
Link Here
|
62 |
import org.jivesoftware.smack.packet.Presence.Mode; |
62 |
import org.jivesoftware.smack.packet.Presence.Mode; |
63 |
import org.jivesoftware.smack.packet.Presence.Type; |
63 |
import org.jivesoftware.smack.packet.Presence.Type; |
64 |
import org.jivesoftware.smackx.packet.VCard; |
64 |
import org.jivesoftware.smackx.packet.VCard; |
|
|
65 |
import org.jivesoftware.smackx.packet.VCardTempXUpdateExtension; |
65 |
|
66 |
|
66 |
public class XMPPContainerPresenceHelper implements ISharedObject { |
67 |
public class XMPPContainerPresenceHelper implements ISharedObject { |
67 |
|
68 |
|
Lines 539-547
Link Here
|
539 |
|
540 |
|
540 |
protected XMPPID createIDFromName(String uname) { |
541 |
protected XMPPID createIDFromName(String uname) { |
541 |
try { |
542 |
try { |
542 |
if (uname.indexOf('@') == -1) { |
543 |
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=221053 |
543 |
return new XMPPID(container.getConnectNamespace(), "admin" + "@" + uname); |
544 |
// --- Comment #5 From Hiroyuki 2008-03-17 10:38:54 -0500 [reply] --- |
544 |
} |
545 |
// I think that you should not add "admin" when there is no fromID. |
|
|
546 |
// I always think the account "admin" to be no manager account. |
547 |
// The message can be sent to "admin" in the chat window. |
548 |
// if (uname.indexOf('@') == -1) { |
549 |
// return new XMPPID(container.getConnectNamespace(), "admin" + "@" + uname); |
550 |
// } |
545 |
return new XMPPID(container.getConnectNamespace(), uname); |
551 |
return new XMPPID(container.getConnectNamespace(), uname); |
546 |
} catch (final Exception e) { |
552 |
} catch (final Exception e) { |
547 |
traceStack("Exception in createIDFromName", e); |
553 |
traceStack("Exception in createIDFromName", e); |
Lines 575-593
Link Here
|
575 |
|
581 |
|
576 |
private VCard getVCardForPresence(Presence xmppPresence) { |
582 |
private VCard getVCardForPresence(Presence xmppPresence) { |
577 |
VCard result = null; |
583 |
VCard result = null; |
578 |
if (xmppPresence.getExtension("x", "vcard-temp:x:update") != null) { |
584 |
if (xmppPresence.getExtension("x", "vcard-temp:x:update") == null) { |
579 |
final String from = xmppPresence.getFrom(); |
585 |
xmppPresence.addExtension(new VCardTempXUpdateExtension()); |
|
|
586 |
} |
587 |
//if (xmppPresence.getExtension("x", "vcard-temp:x:update") != null) { |
588 |
String from = xmppPresence.getFrom(); |
580 |
result = getFromCache(from); |
589 |
result = getFromCache(from); |
581 |
if (result == null && from != null) { |
590 |
if (result == null && from != null) { |
582 |
result = new VCard(); |
591 |
result = new VCard(); |
583 |
try { |
592 |
try { |
584 |
result.load(container.getXMPPConnection(), from); |
593 |
// from is "username@server/XMPP_ECF" |
|
|
594 |
String userid = from; |
595 |
int slash=userid.indexOf('/'); |
596 |
if(slash>=0) |
597 |
userid=userid.substring(0,slash); |
598 |
//result.load(container.getXMPPConnection(), from); |
599 |
result.load(container.getXMPPConnection(), userid); |
585 |
addToCache(from, result); |
600 |
addToCache(from, result); |
586 |
} catch (final XMPPException e) { |
601 |
} catch (final XMPPException e) { |
587 |
traceStack("vcard loading exception", e); |
602 |
traceStack("vcard loading exception", e); |
588 |
} |
603 |
} |
589 |
} |
604 |
} |
590 |
} |
605 |
//} |
591 |
return result; |
606 |
return result; |
592 |
} |
607 |
} |
593 |
|
608 |
|