Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
X
xabber-android
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Administrator
xabber-android
Commits
4a1fae99
Commit
4a1fae99
authored
Jul 10, 2015
by
Grigory Fedorov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ConnectionManager light refactoring.
parent
687c63ae
Changes
16
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
16 changed files
with
81 additions
and
104 deletions
+81
-104
ConnectionManager.java
...com/xabber/android/data/connection/ConnectionManager.java
+51
-71
MessageArchiveManager.java
...android/data/extension/archive/MessageArchiveManager.java
+8
-8
AttentionManager.java
...er/android/data/extension/attention/AttentionManager.java
+1
-1
CapabilitiesManager.java
...ndroid/data/extension/capability/CapabilitiesManager.java
+1
-1
ChatStateManager.java
...om/xabber/android/data/extension/cs/ChatStateManager.java
+1
-1
MUCManager.java
...ava/com/xabber/android/data/extension/muc/MUCManager.java
+1
-2
OTRManager.java
...ava/com/xabber/android/data/extension/otr/OTRManager.java
+1
-1
PingManager.java
...a/com/xabber/android/data/extension/ping/PingManager.java
+1
-1
SSNManager.java
...ava/com/xabber/android/data/extension/ssn/SSNManager.java
+1
-1
TimeManager.java
...a/com/xabber/android/data/extension/time/TimeManager.java
+1
-1
VCardManager.java
...com/xabber/android/data/extension/vcard/VCardManager.java
+1
-2
AbstractChat.java
...in/java/com/xabber/android/data/message/AbstractChat.java
+1
-2
ReceiptManager.java
.../java/com/xabber/android/data/message/ReceiptManager.java
+1
-1
PresenceManager.java
.../java/com/xabber/android/data/roster/PresenceManager.java
+4
-4
RosterManager.java
...in/java/com/xabber/android/data/roster/RosterManager.java
+6
-6
CarbonManager.java
app/src/main/java/com/xabber/xmpp/carbon/CarbonManager.java
+1
-1
No files found.
app/src/main/java/com/xabber/android/data/connection/ConnectionManager.java
View file @
4a1fae99
This diff is collapsed.
Click to expand it.
app/src/main/java/com/xabber/android/data/extension/archive/MessageArchiveManager.java
View file @
4a1fae99
...
@@ -337,7 +337,7 @@ public class MessageArchiveManager implements OnPacketListener,
...
@@ -337,7 +337,7 @@ public class MessageArchiveManager implements OnPacketListener,
auto
.
setSave
(
true
);
auto
.
setSave
(
true
);
auto
.
setType
(
Type
.
set
);
auto
.
setType
(
Type
.
set
);
try
{
try
{
ConnectionManager
.
getInstance
().
send
Packet
(
account
,
auto
);
ConnectionManager
.
getInstance
().
send
Stanza
(
account
,
auto
);
}
catch
(
NetworkException
e
)
{
}
catch
(
NetworkException
e
)
{
}
}
// TODO: track results.
// TODO: track results.
...
@@ -394,7 +394,7 @@ public class MessageArchiveManager implements OnPacketListener,
...
@@ -394,7 +394,7 @@ public class MessageArchiveManager implements OnPacketListener,
pref
.
setDefault
(
defaultItem
);
pref
.
setDefault
(
defaultItem
);
pref
.
setType
(
Type
.
set
);
pref
.
setType
(
Type
.
set
);
try
{
try
{
ConnectionManager
.
getInstance
().
send
Packet
(
account
,
pref
);
ConnectionManager
.
getInstance
().
send
Stanza
(
account
,
pref
);
}
catch
(
NetworkException
e
)
{
}
catch
(
NetworkException
e
)
{
}
}
}
}
...
@@ -703,7 +703,7 @@ public class MessageArchiveManager implements OnPacketListener,
...
@@ -703,7 +703,7 @@ public class MessageArchiveManager implements OnPacketListener,
packet
.
setEnd
(
connected
.
get
(
account
));
packet
.
setEnd
(
connected
.
get
(
account
));
String
packetId
=
packet
.
getPacketID
();
String
packetId
=
packet
.
getPacketID
();
try
{
try
{
ConnectionManager
.
getInstance
().
send
Packet
(
account
,
packet
);
ConnectionManager
.
getInstance
().
send
Stanza
(
account
,
packet
);
}
catch
(
NetworkException
e
)
{
}
catch
(
NetworkException
e
)
{
}
}
return
packetId
;
return
packetId
;
...
@@ -722,7 +722,7 @@ public class MessageArchiveManager implements OnPacketListener,
...
@@ -722,7 +722,7 @@ public class MessageArchiveManager implements OnPacketListener,
modificationRequests
.
put
(
account
,
packet
.
getPacketID
(),
modification
);
modificationRequests
.
put
(
account
,
packet
.
getPacketID
(),
modification
);
try
{
try
{
if
(!
modification
)
{
if
(!
modification
)
{
ConnectionManager
.
getInstance
().
send
Packet
(
account
,
packet
);
ConnectionManager
.
getInstance
().
send
Stanza
(
account
,
packet
);
return
;
return
;
}
}
ConnectionManager
.
getInstance
().
sendRequest
(
account
,
packet
,
ConnectionManager
.
getInstance
().
sendRequest
(
account
,
packet
,
...
@@ -766,7 +766,7 @@ public class MessageArchiveManager implements OnPacketListener,
...
@@ -766,7 +766,7 @@ public class MessageArchiveManager implements OnPacketListener,
Pref
packet
=
new
Pref
();
Pref
packet
=
new
Pref
();
packet
.
addItem
(
extension
);
packet
.
addItem
(
extension
);
packet
.
setType
(
Type
.
set
);
packet
.
setType
(
Type
.
set
);
ConnectionManager
.
getInstance
().
send
Packet
(
account
,
packet
);
ConnectionManager
.
getInstance
().
send
Stanza
(
account
,
packet
);
}
}
private
void
sendItemRemove
(
String
account
,
String
user
)
private
void
sendItemRemove
(
String
account
,
String
user
)
...
@@ -776,7 +776,7 @@ public class MessageArchiveManager implements OnPacketListener,
...
@@ -776,7 +776,7 @@ public class MessageArchiveManager implements OnPacketListener,
ItemRemove
packet
=
new
ItemRemove
();
ItemRemove
packet
=
new
ItemRemove
();
packet
.
addItem
(
extension
);
packet
.
addItem
(
extension
);
packet
.
setType
(
Type
.
set
);
packet
.
setType
(
Type
.
set
);
ConnectionManager
.
getInstance
().
send
Packet
(
account
,
packet
);
ConnectionManager
.
getInstance
().
send
Stanza
(
account
,
packet
);
}
}
public
void
setOtrMode
(
String
account
,
String
user
,
OtrMode
otrMode
)
public
void
setOtrMode
(
String
account
,
String
user
,
OtrMode
otrMode
)
...
@@ -862,7 +862,7 @@ public class MessageArchiveManager implements OnPacketListener,
...
@@ -862,7 +862,7 @@ public class MessageArchiveManager implements OnPacketListener,
Pref
packet
=
new
Pref
();
Pref
packet
=
new
Pref
();
packet
.
addSession
(
extension
);
packet
.
addSession
(
extension
);
packet
.
setType
(
Type
.
set
);
packet
.
setType
(
Type
.
set
);
ConnectionManager
.
getInstance
().
send
Packet
(
account
,
packet
);
ConnectionManager
.
getInstance
().
send
Stanza
(
account
,
packet
);
sessionSaves
.
put
(
account
,
session
,
saveMode
);
sessionSaves
.
put
(
account
,
session
,
saveMode
);
}
}
...
@@ -873,7 +873,7 @@ public class MessageArchiveManager implements OnPacketListener,
...
@@ -873,7 +873,7 @@ public class MessageArchiveManager implements OnPacketListener,
SessionRemove
packet
=
new
SessionRemove
();
SessionRemove
packet
=
new
SessionRemove
();
packet
.
addSession
(
extension
);
packet
.
addSession
(
extension
);
packet
.
setType
(
Type
.
set
);
packet
.
setType
(
Type
.
set
);
ConnectionManager
.
getInstance
().
send
Packet
(
account
,
packet
);
ConnectionManager
.
getInstance
().
send
Stanza
(
account
,
packet
);
sessionSaves
.
remove
(
account
,
session
);
sessionSaves
.
remove
(
account
,
session
);
}
}
...
...
app/src/main/java/com/xabber/android/data/extension/attention/AttentionManager.java
View file @
4a1fae99
...
@@ -194,7 +194,7 @@ public class AttentionManager implements OnPacketListener, OnLoadListener {
...
@@ -194,7 +194,7 @@ public class AttentionManager implements OnPacketListener, OnLoadListener {
message
.
setTo
(
to
);
message
.
setTo
(
to
);
message
.
setType
(
Message
.
Type
.
headline
);
message
.
setType
(
Message
.
Type
.
headline
);
message
.
addExtension
(
new
Attention
());
message
.
addExtension
(
new
Attention
());
ConnectionManager
.
getInstance
().
send
Packet
(
account
,
message
);
ConnectionManager
.
getInstance
().
send
Stanza
(
account
,
message
);
chat
.
newAction
(
null
,
null
,
ChatAction
.
attention_called
);
chat
.
newAction
(
null
,
null
,
ChatAction
.
attention_called
);
}
}
...
...
app/src/main/java/com/xabber/android/data/extension/capability/CapabilitiesManager.java
View file @
4a1fae99
...
@@ -218,7 +218,7 @@ public class CapabilitiesManager implements OnAuthorizedListener,
...
@@ -218,7 +218,7 @@ public class CapabilitiesManager implements OnAuthorizedListener,
if
(
capability
.
getNode
()
!=
null
&&
capability
.
getVersion
()
!=
null
)
if
(
capability
.
getNode
()
!=
null
&&
capability
.
getVersion
()
!=
null
)
packet
.
setNode
(
capability
.
getNode
()
+
"#"
+
capability
.
getVersion
());
packet
.
setNode
(
capability
.
getNode
()
+
"#"
+
capability
.
getVersion
());
try
{
try
{
ConnectionManager
.
getInstance
().
send
Packet
(
account
,
packet
);
ConnectionManager
.
getInstance
().
send
Stanza
(
account
,
packet
);
}
catch
(
NetworkException
e
)
{
}
catch
(
NetworkException
e
)
{
return
;
return
;
}
}
...
...
app/src/main/java/com/xabber/android/data/extension/cs/ChatStateManager.java
View file @
4a1fae99
...
@@ -215,7 +215,7 @@ public class ChatStateManager implements OnDisconnectListener,
...
@@ -215,7 +215,7 @@ public class ChatStateManager implements OnDisconnectListener,
message
.
setTo
(
chat
.
getTo
());
message
.
setTo
(
chat
.
getTo
());
message
.
addExtension
(
new
ChatStateExtension
(
chatState
));
message
.
addExtension
(
new
ChatStateExtension
(
chatState
));
try
{
try
{
ConnectionManager
.
getInstance
().
send
Packet
(
account
,
message
);
ConnectionManager
.
getInstance
().
send
Stanza
(
account
,
message
);
}
catch
(
NetworkException
e
)
{
}
catch
(
NetworkException
e
)
{
// Just ignore it.
// Just ignore it.
}
}
...
...
app/src/main/java/com/xabber/android/data/extension/muc/MUCManager.java
View file @
4a1fae99
...
@@ -39,7 +39,6 @@ import org.jivesoftware.smack.SmackException;
...
@@ -39,7 +39,6 @@ import org.jivesoftware.smack.SmackException;
import
org.jivesoftware.smack.XMPPConnection
;
import
org.jivesoftware.smack.XMPPConnection
;
import
org.jivesoftware.smack.XMPPException
;
import
org.jivesoftware.smack.XMPPException
;
import
org.jivesoftware.smack.packet.Message
;
import
org.jivesoftware.smack.packet.Message
;
import
org.jivesoftware.smack.packet.Packet
;
import
org.jivesoftware.smack.packet.Stanza
;
import
org.jivesoftware.smack.packet.Stanza
;
import
org.jivesoftware.smackx.muc.MultiUserChat
;
import
org.jivesoftware.smackx.muc.MultiUserChat
;
import
org.jivesoftware.smackx.muc.MultiUserChatManager
;
import
org.jivesoftware.smackx.muc.MultiUserChatManager
;
...
@@ -442,7 +441,7 @@ public class MUCManager implements OnLoadListener, OnPacketListener {
...
@@ -442,7 +441,7 @@ public class MUCManager implements OnLoadListener, OnPacketListener {
invite
.
setReason
(
""
);
invite
.
setReason
(
""
);
mucUser
.
setInvite
(
invite
);
mucUser
.
setInvite
(
invite
);
message
.
addExtension
(
mucUser
);
message
.
addExtension
(
mucUser
);
ConnectionManager
.
getInstance
().
send
Packet
(
account
,
message
);
ConnectionManager
.
getInstance
().
send
Stanza
(
account
,
message
);
roomChat
.
putInvite
(
message
.
getPacketID
(),
user
);
roomChat
.
putInvite
(
message
.
getPacketID
(),
user
);
roomChat
.
newAction
(
roomChat
.
getNickname
(),
user
,
ChatAction
.
invite_sent
);
roomChat
.
newAction
(
roomChat
.
getNickname
(),
user
,
ChatAction
.
invite_sent
);
}
}
...
...
app/src/main/java/com/xabber/android/data/extension/otr/OTRManager.java
View file @
4a1fae99
...
@@ -235,7 +235,7 @@ public class OTRManager implements OtrEngineHost, OtrEngineListener,
...
@@ -235,7 +235,7 @@ public class OTRManager implements OtrEngineHost, OtrEngineListener,
SSNManager
.
getInstance
().
setSessionOtrMode
(
account
,
user
,
abstractChat
.
getThreadId
(),
OtrMode
.
prefer
);
SSNManager
.
getInstance
().
setSessionOtrMode
(
account
,
user
,
abstractChat
.
getThreadId
(),
OtrMode
.
prefer
);
try
{
try
{
ConnectionManager
.
getInstance
()
ConnectionManager
.
getInstance
()
.
send
Packet
(
abstractChat
.
getAccount
(),
abstractChat
.
createMessagePacket
(
msg
));
.
send
Stanza
(
abstractChat
.
getAccount
(),
abstractChat
.
createMessagePacket
(
msg
));
}
catch
(
NetworkException
e
)
{
}
catch
(
NetworkException
e
)
{
throw
new
OtrException
(
e
);
throw
new
OtrException
(
e
);
}
}
...
...
app/src/main/java/com/xabber/android/data/extension/ping/PingManager.java
View file @
4a1fae99
...
@@ -69,7 +69,7 @@ public class PingManager implements OnPacketListener {
...
@@ -69,7 +69,7 @@ public class PingManager implements OnPacketListener {
if
(
ping
.
getType
()
!=
IQ
.
Type
.
get
)
if
(
ping
.
getType
()
!=
IQ
.
Type
.
get
)
return
;
return
;
try
{
try
{
ConnectionManager
.
getInstance
().
send
Packet
(
account
,
ConnectionManager
.
getInstance
().
send
Stanza
(
account
,
IQ
.
createResultIQ
(
ping
));
IQ
.
createResultIQ
(
ping
));
}
catch
(
NetworkException
e
)
{
}
catch
(
NetworkException
e
)
{
LogManager
.
exception
(
this
,
e
);
LogManager
.
exception
(
this
,
e
);
...
...
app/src/main/java/com/xabber/android/data/extension/ssn/SSNManager.java
View file @
4a1fae99
...
@@ -292,7 +292,7 @@ public class SSNManager implements OnPacketListener, OnAccountRemovedListener {
...
@@ -292,7 +292,7 @@ public class SSNManager implements OnPacketListener, OnAccountRemovedListener {
message
.
setThread
(
session
);
message
.
setThread
(
session
);
message
.
addExtension
(
feature
);
message
.
addExtension
(
feature
);
try
{
try
{
ConnectionManager
.
getInstance
().
send
Packet
(
account
,
message
);
ConnectionManager
.
getInstance
().
send
Stanza
(
account
,
message
);
}
catch
(
NetworkException
e
)
{
}
catch
(
NetworkException
e
)
{
}
}
}
}
...
...
app/src/main/java/com/xabber/android/data/extension/time/TimeManager.java
View file @
4a1fae99
...
@@ -127,7 +127,7 @@ public class TimeManager implements OnServerInfoReceivedListener,
...
@@ -127,7 +127,7 @@ public class TimeManager implements OnServerInfoReceivedListener,
.
get
(
Calendar
.
DST_OFFSET
))
/
60000
);
.
get
(
Calendar
.
DST_OFFSET
))
/
60000
);
result
.
setUtc
(
calendar
.
getTime
());
result
.
setUtc
(
calendar
.
getTime
());
try
{
try
{
ConnectionManager
.
getInstance
().
send
Packet
(
account
,
result
);
ConnectionManager
.
getInstance
().
send
Stanza
(
account
,
result
);
}
catch
(
NetworkException
e
)
{
}
catch
(
NetworkException
e
)
{
}
}
}
}
...
...
app/src/main/java/com/xabber/android/data/extension/vcard/VCardManager.java
View file @
4a1fae99
...
@@ -24,7 +24,6 @@ import java.util.Set;
...
@@ -24,7 +24,6 @@ import java.util.Set;
import
org.jivesoftware.smack.packet.IQ
;
import
org.jivesoftware.smack.packet.IQ
;
import
org.jivesoftware.smack.packet.IQ.Type
;
import
org.jivesoftware.smack.packet.IQ.Type
;
import
org.jivesoftware.smack.packet.Packet
;
import
org.jivesoftware.smack.packet.Presence
;
import
org.jivesoftware.smack.packet.Presence
;
import
org.jivesoftware.smack.packet.Stanza
;
import
org.jivesoftware.smack.packet.Stanza
;
...
@@ -195,7 +194,7 @@ public class VCardManager implements OnLoadListener, OnPacketListener,
...
@@ -195,7 +194,7 @@ public class VCardManager implements OnLoadListener, OnPacketListener,
if
(
hash
!=
null
)
if
(
hash
!=
null
)
request
.
addHash
(
hash
);
request
.
addHash
(
hash
);
try
{
try
{
ConnectionManager
.
getInstance
().
send
Packet
(
account
,
packet
);
ConnectionManager
.
getInstance
().
send
Stanza
(
account
,
packet
);
}
catch
(
NetworkException
e
)
{
}
catch
(
NetworkException
e
)
{
requests
.
remove
(
request
);
requests
.
remove
(
request
);
onVCardFailed
(
account
,
bareAddress
);
onVCardFailed
(
account
,
bareAddress
);
...
...
app/src/main/java/com/xabber/android/data/message/AbstractChat.java
View file @
4a1fae99
...
@@ -34,7 +34,6 @@ import com.xabber.xmpp.carbon.CarbonManager;
...
@@ -34,7 +34,6 @@ import com.xabber.xmpp.carbon.CarbonManager;
import
org.jivesoftware.smack.packet.Message
;
import
org.jivesoftware.smack.packet.Message
;
import
org.jivesoftware.smack.packet.Message.Type
;
import
org.jivesoftware.smack.packet.Message.Type
;
import
org.jivesoftware.smack.packet.Packet
;
import
org.jivesoftware.smack.packet.Stanza
;
import
org.jivesoftware.smack.packet.Stanza
;
import
org.jivesoftware.smack.util.StringUtils
;
import
org.jivesoftware.smack.util.StringUtils
;
import
org.jivesoftware.smackx.delay.packet.DelayInformation
;
import
org.jivesoftware.smackx.delay.packet.DelayInformation
;
...
@@ -583,7 +582,7 @@ public abstract class AbstractChat extends BaseEntity {
...
@@ -583,7 +582,7 @@ public abstract class AbstractChat extends BaseEntity {
.
getTimestamp
()));
.
getTimestamp
()));
try
{
try
{
ConnectionManager
.
getInstance
()
ConnectionManager
.
getInstance
()
.
send
Packet
(
account
,
message
);
.
send
Stanza
(
account
,
message
);
}
catch
(
NetworkException
e
)
{
}
catch
(
NetworkException
e
)
{
break
;
break
;
}
}
...
...
app/src/main/java/com/xabber/android/data/message/ReceiptManager.java
View file @
4a1fae99
...
@@ -137,7 +137,7 @@ public class ReceiptManager implements OnPacketListener, OnDisconnectListener {
...
@@ -137,7 +137,7 @@ public class ReceiptManager implements OnPacketListener, OnDisconnectListener {
receipt
.
addExtension
(
new
Received
(
id
));
receipt
.
addExtension
(
new
Received
(
id
));
receipt
.
setThread
(
message
.
getThread
());
receipt
.
setThread
(
message
.
getThread
());
try
{
try
{
ConnectionManager
.
getInstance
().
send
Packet
(
account
,
ConnectionManager
.
getInstance
().
send
Stanza
(
account
,
receipt
);
receipt
);
}
catch
(
NetworkException
e
)
{
}
catch
(
NetworkException
e
)
{
LogManager
.
exception
(
this
,
e
);
LogManager
.
exception
(
this
,
e
);
...
...
app/src/main/java/com/xabber/android/data/roster/PresenceManager.java
View file @
4a1fae99
...
@@ -124,7 +124,7 @@ public class PresenceManager implements OnArchiveModificationsReceivedListener,
...
@@ -124,7 +124,7 @@ public class PresenceManager implements OnArchiveModificationsReceivedListener,
throws
NetworkException
{
throws
NetworkException
{
Presence
packet
=
new
Presence
(
Presence
.
Type
.
subscribe
);
Presence
packet
=
new
Presence
(
Presence
.
Type
.
subscribe
);
packet
.
setTo
(
bareAddress
);
packet
.
setTo
(
bareAddress
);
ConnectionManager
.
getInstance
().
send
Packet
(
account
,
packet
);
ConnectionManager
.
getInstance
().
send
Stanza
(
account
,
packet
);
HashSet
<
String
>
set
=
requestedSubscriptions
.
get
(
account
);
HashSet
<
String
>
set
=
requestedSubscriptions
.
get
(
account
);
if
(
set
==
null
)
{
if
(
set
==
null
)
{
set
=
new
HashSet
<
String
>();
set
=
new
HashSet
<
String
>();
...
@@ -150,7 +150,7 @@ public class PresenceManager implements OnArchiveModificationsReceivedListener,
...
@@ -150,7 +150,7 @@ public class PresenceManager implements OnArchiveModificationsReceivedListener,
throws
NetworkException
{
throws
NetworkException
{
Presence
packet
=
new
Presence
(
Presence
.
Type
.
subscribed
);
Presence
packet
=
new
Presence
(
Presence
.
Type
.
subscribed
);
packet
.
setTo
(
bareAddress
);
packet
.
setTo
(
bareAddress
);
ConnectionManager
.
getInstance
().
send
Packet
(
account
,
packet
);
ConnectionManager
.
getInstance
().
send
Stanza
(
account
,
packet
);
subscriptionRequestProvider
.
remove
(
account
,
bareAddress
);
subscriptionRequestProvider
.
remove
(
account
,
bareAddress
);
removeRequestedSubscription
(
account
,
bareAddress
);
removeRequestedSubscription
(
account
,
bareAddress
);
}
}
...
@@ -167,7 +167,7 @@ public class PresenceManager implements OnArchiveModificationsReceivedListener,
...
@@ -167,7 +167,7 @@ public class PresenceManager implements OnArchiveModificationsReceivedListener,
throws
NetworkException
{
throws
NetworkException
{
Presence
packet
=
new
Presence
(
Presence
.
Type
.
unsubscribed
);
Presence
packet
=
new
Presence
(
Presence
.
Type
.
unsubscribed
);
packet
.
setTo
(
bareAddress
);
packet
.
setTo
(
bareAddress
);
ConnectionManager
.
getInstance
().
send
Packet
(
account
,
packet
);
ConnectionManager
.
getInstance
().
send
Stanza
(
account
,
packet
);
subscriptionRequestProvider
.
remove
(
account
,
bareAddress
);
subscriptionRequestProvider
.
remove
(
account
,
bareAddress
);
removeRequestedSubscription
(
account
,
bareAddress
);
removeRequestedSubscription
(
account
,
bareAddress
);
}
}
...
@@ -381,7 +381,7 @@ public class PresenceManager implements OnArchiveModificationsReceivedListener,
...
@@ -381,7 +381,7 @@ public class PresenceManager implements OnArchiveModificationsReceivedListener,
public
void
resendPresence
(
String
account
)
throws
NetworkException
{
public
void
resendPresence
(
String
account
)
throws
NetworkException
{
if
(!
readyAccounts
.
contains
(
account
))
if
(!
readyAccounts
.
contains
(
account
))
throw
new
NetworkException
(
R
.
string
.
NOT_CONNECTED
);
throw
new
NetworkException
(
R
.
string
.
NOT_CONNECTED
);
ConnectionManager
.
getInstance
().
send
Packet
(
account
,
ConnectionManager
.
getInstance
().
send
Stanza
(
account
,
AccountManager
.
getInstance
().
getAccount
(
account
).
getPresence
());
AccountManager
.
getInstance
().
getAccount
(
account
).
getPresence
());
}
}
...
...
app/src/main/java/com/xabber/android/data/roster/RosterManager.java
View file @
4a1fae99
...
@@ -302,7 +302,7 @@ public class RosterManager implements OnDisconnectListener, OnPacketListener,
...
@@ -302,7 +302,7 @@ public class RosterManager implements OnDisconnectListener, OnPacketListener,
if
(
group
.
trim
().
length
()
>
0
)
if
(
group
.
trim
().
length
()
>
0
)
item
.
addGroupName
(
group
);
item
.
addGroupName
(
group
);
packet
.
addRosterItem
(
item
);
packet
.
addRosterItem
(
item
);
ConnectionManager
.
getInstance
().
send
Packet
(
account
,
packet
);
ConnectionManager
.
getInstance
().
send
Stanza
(
account
,
packet
);
}
}
/**
/**
...
@@ -319,7 +319,7 @@ public class RosterManager implements OnDisconnectListener, OnPacketListener,
...
@@ -319,7 +319,7 @@ public class RosterManager implements OnDisconnectListener, OnPacketListener,
RosterPacket
.
Item
item
=
new
RosterPacket
.
Item
(
bareAddress
,
""
);
RosterPacket
.
Item
item
=
new
RosterPacket
.
Item
(
bareAddress
,
""
);
item
.
setItemType
(
RosterPacket
.
ItemType
.
remove
);
item
.
setItemType
(
RosterPacket
.
ItemType
.
remove
);
packet
.
addRosterItem
(
item
);
packet
.
addRosterItem
(
item
);
ConnectionManager
.
getInstance
().
send
Packet
(
account
,
packet
);
ConnectionManager
.
getInstance
().
send
Stanza
(
account
,
packet
);
}
}
public
void
setGroups
(
String
account
,
String
bareAddress
,
Collection
<
String
>
groups
)
throws
NetworkException
{
public
void
setGroups
(
String
account
,
String
bareAddress
,
Collection
<
String
>
groups
)
throws
NetworkException
{
...
@@ -357,7 +357,7 @@ public class RosterManager implements OnDisconnectListener, OnPacketListener,
...
@@ -357,7 +357,7 @@ public class RosterManager implements OnDisconnectListener, OnPacketListener,
item
.
addGroupName
(
group
);
item
.
addGroupName
(
group
);
}
}
packet
.
addRosterItem
(
item
);
packet
.
addRosterItem
(
item
);
ConnectionManager
.
getInstance
().
send
Packet
(
account
,
packet
);
ConnectionManager
.
getInstance
().
send
Stanza
(
account
,
packet
);
}
}
/**
/**
...
@@ -384,7 +384,7 @@ public class RosterManager implements OnDisconnectListener, OnPacketListener,
...
@@ -384,7 +384,7 @@ public class RosterManager implements OnDisconnectListener, OnPacketListener,
}
}
if
(
packet
.
getRosterItemCount
()
==
0
)
if
(
packet
.
getRosterItemCount
()
==
0
)
return
;
return
;
ConnectionManager
.
getInstance
().
send
Packet
(
account
,
packet
);
ConnectionManager
.
getInstance
().
send
Stanza
(
account
,
packet
);
}
}
/**
/**
...
@@ -439,7 +439,7 @@ public class RosterManager implements OnDisconnectListener, OnPacketListener,
...
@@ -439,7 +439,7 @@ public class RosterManager implements OnDisconnectListener, OnPacketListener,
}
}
if
(
packet
.
getRosterItemCount
()
==
0
)
if
(
packet
.
getRosterItemCount
()
==
0
)
return
;
return
;
ConnectionManager
.
getInstance
().
send
Packet
(
account
,
packet
);
ConnectionManager
.
getInstance
().
send
Stanza
(
account
,
packet
);
}
}
/**
/**
...
@@ -500,7 +500,7 @@ public class RosterManager implements OnDisconnectListener, OnPacketListener,
...
@@ -500,7 +500,7 @@ public class RosterManager implements OnDisconnectListener, OnPacketListener,
String
account
=
((
AccountItem
)
connection
).
getAccount
();
String
account
=
((
AccountItem
)
connection
).
getAccount
();
requestedRosters
.
add
(
account
);
requestedRosters
.
add
(
account
);
try
{
try
{
ConnectionManager
.
getInstance
().
send
Packet
(
account
,
ConnectionManager
.
getInstance
().
send
Stanza
(
account
,
new
RosterPacket
());
new
RosterPacket
());
}
catch
(
NetworkException
e
)
{
}
catch
(
NetworkException
e
)
{
LogManager
.
exception
(
this
,
e
);
LogManager
.
exception
(
this
,
e
);
...
...
app/src/main/java/com/xabber/xmpp/carbon/CarbonManager.java
View file @
4a1fae99
...
@@ -149,7 +149,7 @@ public class CarbonManager implements OnServerInfoReceivedListener, OnPacketList
...
@@ -149,7 +149,7 @@ public class CarbonManager implements OnServerInfoReceivedListener, OnPacketList
// }
// }
// }, new StanzaIdFilter(setIQ.getStanzaId()));
// }, new StanzaIdFilter(setIQ.getStanzaId()));
//
//
// connection.send
Packet
(setIQ);
// connection.send
Stanza
(setIQ);
}
}
/**
/**
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment