mirror of
https://github.com/vanitasvitae/Smack.git
synced 2024-11-23 04:22:05 +01:00
Added ability to obtain the value of a given account attribute. SMACK-164
git-svn-id: http://svn.igniterealtime.org/svn/repos/smack/trunk@2397 b35dd754-fafc-0310-a699-88a17e54d16e
This commit is contained in:
parent
fd62b99a59
commit
a654adc588
1 changed files with 19 additions and 0 deletions
|
@ -136,6 +136,25 @@ public class AccountManager {
|
|||
return Collections.EMPTY_LIST.iterator();
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the value of a given account attribute or <tt>null</tt> if the account
|
||||
* attribute wasn't found.
|
||||
*
|
||||
* @param name the name of the account attribute to return its value.
|
||||
* @return the value of the account attribute or <tt>null</tt> if an account
|
||||
* attribute wasn't found for the requested name.
|
||||
*/
|
||||
public String getAccountAttribute(String name) {
|
||||
try {
|
||||
if (info == null) {
|
||||
getRegistrationInfo();
|
||||
}
|
||||
return (String) info.getAttributes().get(name);
|
||||
}
|
||||
catch (XMPPException xe) { }
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the instructions for creating a new account, or <tt>null</tt> if there
|
||||
* are no instructions. If present, instructions should be displayed to the end-user
|
||||
|
|
Loading…
Reference in a new issue