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
9c88882d
Commit
9c88882d
authored
Aug 06, 2015
by
Grigory Fedorov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
VCard request behavior fixed for cases when account is disconnected.
parent
d767a89a
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
19 additions
and
8 deletions
+19
-8
VCardManager.java
...com/xabber/android/data/extension/vcard/VCardManager.java
+17
-4
AccountInfoEditorFragment.java
...java/com/xabber/android/ui/AccountInfoEditorFragment.java
+1
-2
AccountViewer.java
app/src/main/java/com/xabber/android/ui/AccountViewer.java
+1
-2
No files found.
app/src/main/java/com/xabber/android/data/extension/vcard/VCardManager.java
View file @
9c88882d
...
@@ -25,6 +25,7 @@ import com.xabber.android.data.account.AccountManager;
...
@@ -25,6 +25,7 @@ import com.xabber.android.data.account.AccountManager;
import
com.xabber.android.data.account.OnAccountRemovedListener
;
import
com.xabber.android.data.account.OnAccountRemovedListener
;
import
com.xabber.android.data.connection.ConnectionItem
;
import
com.xabber.android.data.connection.ConnectionItem
;
import
com.xabber.android.data.connection.ConnectionManager
;
import
com.xabber.android.data.connection.ConnectionManager
;
import
com.xabber.android.data.connection.ConnectionThread
;
import
com.xabber.android.data.connection.OnPacketListener
;
import
com.xabber.android.data.connection.OnPacketListener
;
import
com.xabber.android.data.extension.avatar.AvatarManager
;
import
com.xabber.android.data.extension.avatar.AvatarManager
;
import
com.xabber.android.data.roster.OnRosterChangedListener
;
import
com.xabber.android.data.roster.OnRosterChangedListener
;
...
@@ -35,8 +36,8 @@ import com.xabber.android.data.roster.StructuredName;
...
@@ -35,8 +36,8 @@ import com.xabber.android.data.roster.StructuredName;
import
com.xabber.xmpp.address.Jid
;
import
com.xabber.xmpp.address.Jid
;
import
com.xabber.xmpp.vcard.VCardProperty
;
import
com.xabber.xmpp.vcard.VCardProperty
;
import
org.jivesoftware.smack.AbstractXMPPConnection
;
import
org.jivesoftware.smack.SmackException
;
import
org.jivesoftware.smack.SmackException
;
import
org.jivesoftware.smack.XMPPConnection
;
import
org.jivesoftware.smack.XMPPException
;
import
org.jivesoftware.smack.XMPPException
;
import
org.jivesoftware.smack.packet.IQ.Type
;
import
org.jivesoftware.smack.packet.IQ.Type
;
import
org.jivesoftware.smack.packet.Presence
;
import
org.jivesoftware.smack.packet.Presence
;
...
@@ -261,8 +262,14 @@ public class VCardManager implements OnLoadListener, OnPacketListener,
...
@@ -261,8 +262,14 @@ public class VCardManager implements OnLoadListener, OnPacketListener,
private
void
requestVCard
(
final
String
account
,
final
String
srcUser
)
{
private
void
requestVCard
(
final
String
account
,
final
String
srcUser
)
{
final
String
user
=
Jid
.
getBareAddress
(
srcUser
);
final
String
user
=
Jid
.
getBareAddress
(
srcUser
);
final
XMPPConnection
xmppConnection
=
AccountManager
.
getInstance
().
getAccount
(
account
).
getConnectionThread
().
getXMPPConnection
();
ConnectionThread
connectionThread
=
AccountManager
.
getInstance
().
getAccount
(
account
).
getConnectionThread
();
final
org
.
jivesoftware
.
smackx
.
vcardtemp
.
VCardManager
vCardManager
=
org
.
jivesoftware
.
smackx
.
vcardtemp
.
VCardManager
.
getInstanceFor
(
xmppConnection
);
if
(
connectionThread
==
null
)
{
onVCardFailed
(
account
,
user
);
return
;
}
final
org
.
jivesoftware
.
smackx
.
vcardtemp
.
VCardManager
vCardManager
=
org
.
jivesoftware
.
smackx
.
vcardtemp
.
VCardManager
.
getInstanceFor
(
connectionThread
.
getXMPPConnection
());
final
Thread
thread
=
new
Thread
(
"Get vCard user "
+
user
+
" for account "
+
account
)
{
final
Thread
thread
=
new
Thread
(
"Get vCard user "
+
user
+
" for account "
+
account
)
{
@Override
@Override
...
@@ -305,7 +312,13 @@ public class VCardManager implements OnLoadListener, OnPacketListener,
...
@@ -305,7 +312,13 @@ public class VCardManager implements OnLoadListener, OnPacketListener,
}
}
public
void
saveVCard
(
final
String
account
,
final
VCard
vCard
)
{
public
void
saveVCard
(
final
String
account
,
final
VCard
vCard
)
{
final
XMPPConnection
xmppConnection
=
AccountManager
.
getInstance
().
getAccount
(
account
).
getConnectionThread
().
getXMPPConnection
();
ConnectionThread
connectionThread
=
AccountManager
.
getInstance
().
getAccount
(
account
).
getConnectionThread
();
if
(
connectionThread
==
null
)
{
onVCardSaveFailed
(
account
);
return
;
}
final
AbstractXMPPConnection
xmppConnection
=
connectionThread
.
getXMPPConnection
();
final
org
.
jivesoftware
.
smackx
.
vcardtemp
.
VCardManager
vCardManager
=
org
.
jivesoftware
.
smackx
.
vcardtemp
.
VCardManager
.
getInstanceFor
(
xmppConnection
);
final
org
.
jivesoftware
.
smackx
.
vcardtemp
.
VCardManager
vCardManager
=
org
.
jivesoftware
.
smackx
.
vcardtemp
.
VCardManager
.
getInstanceFor
(
xmppConnection
);
final
Thread
thread
=
new
Thread
(
"Save vCard for account "
+
account
)
{
final
Thread
thread
=
new
Thread
(
"Save vCard for account "
+
account
)
{
...
...
app/src/main/java/com/xabber/android/ui/AccountInfoEditorFragment.java
View file @
9c88882d
...
@@ -466,10 +466,9 @@ public class AccountInfoEditorFragment extends Fragment implements OnVCardSaveLi
...
@@ -466,10 +466,9 @@ public class AccountInfoEditorFragment extends Fragment implements OnVCardSaveLi
public
void
saveVCard
()
{
public
void
saveVCard
()
{
ChatViewer
.
hideKeyboard
(
getActivity
());
ChatViewer
.
hideKeyboard
(
getActivity
());
updateVCardFromFields
();
updateVCardFromFields
();
enableProgressMode
();
VCardManager
.
getInstance
().
saveVCard
(
account
,
vCard
);
VCardManager
.
getInstance
().
saveVCard
(
account
,
vCard
);
isSaveSuccess
=
false
;
isSaveSuccess
=
false
;
enableProgressMode
();
}
}
public
void
enableProgressMode
()
{
public
void
enableProgressMode
()
{
...
...
app/src/main/java/com/xabber/android/ui/AccountViewer.java
View file @
9c88882d
...
@@ -9,7 +9,6 @@ import android.view.MenuItem;
...
@@ -9,7 +9,6 @@ import android.view.MenuItem;
import
com.xabber.android.R
;
import
com.xabber.android.R
;
import
com.xabber.android.data.intent.EntityIntentBuilder
;
import
com.xabber.android.data.intent.EntityIntentBuilder
;
import
com.xabber.android.data.roster.GroupManager
;
import
com.xabber.xmpp.address.Jid
;
import
com.xabber.xmpp.address.Jid
;
import
com.xabber.xmpp.vcard.VCardProperty
;
import
com.xabber.xmpp.vcard.VCardProperty
;
...
@@ -26,7 +25,7 @@ public class AccountViewer extends ContactViewer implements Toolbar.OnMenuItemCl
...
@@ -26,7 +25,7 @@ public class AccountViewer extends ContactViewer implements Toolbar.OnMenuItemCl
public
static
Intent
createIntent
(
Context
context
,
String
account
)
{
public
static
Intent
createIntent
(
Context
context
,
String
account
)
{
return
new
EntityIntentBuilder
(
context
,
AccountViewer
.
class
)
return
new
EntityIntentBuilder
(
context
,
AccountViewer
.
class
)
.
setAccount
(
account
).
setUser
(
GroupManager
.
IS_ACCOUNT
).
build
();
.
setAccount
(
account
).
setUser
(
Jid
.
getBareAddress
(
account
)
).
build
();
}
}
@Override
@Override
...
...
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