Set "to" field of requests to be compatibile with more servers.

git-svn-id: http://svn.igniterealtime.org/svn/repos/smack/trunk@1853 b35dd754-fafc-0310-a699-88a17e54d16e
This commit is contained in:
Matt Tucker 2003-03-23 23:02:10 +00:00 committed by mtucker
parent f0ef12eed5
commit 25e4481984
1 changed files with 4 additions and 0 deletions

View File

@ -176,6 +176,7 @@ public class AccountManager {
}
Registration reg = new Registration();
reg.setType(IQ.Type.SET);
reg.setTo(connection.getHost());
reg.setUsername(username);
reg.setPassword(password);
reg.setAttributes(attributes);
@ -203,6 +204,7 @@ public class AccountManager {
public void changePassword(String newPassword) throws XMPPException {
Registration reg = new Registration();
reg.setType(IQ.Type.SET);
reg.setTo(connection.getHost());
reg.setUsername(connection.getUsername());
reg.setPassword(newPassword);
PacketFilter filter = new AndFilter(new PacketIDFilter(reg.getPacketID()),
@ -232,6 +234,7 @@ public class AccountManager {
}
Registration reg = new Registration();
reg.setType(IQ.Type.SET);
reg.setTo(connection.getHost());
Map attributes = new HashMap();
// To delete an account, we add a single attribute, "remove", that is blank.
attributes.put("remove", "");
@ -256,6 +259,7 @@ public class AccountManager {
*/
private synchronized void getRegistrationInfo() throws XMPPException {
Registration reg = new Registration();
reg.setTo(connection.getHost());
PacketFilter filter = new AndFilter(new PacketIDFilter(reg.getPacketID()),
new PacketTypeFilter(IQ.class));
PacketCollector collector = connection.createPacketCollector(filter);