Fixes a NumberFormatException in icq contact info retriever.

cusax-fix
Yana Stamcheva 13 years ago
parent 60c4cf713a
commit cb1708e1a0

@ -135,25 +135,33 @@ protected List<GenericDetail> getContactDetails(String uin)
*/
protected List<GenericDetail> retrieveDetails(String uin)
{
int reqID = requestID++;
List<GenericDetail> result = null;
// Fixes a NumberFormatException, occurring if the uin is not a long
// number.
try
{
//retrieve the details
long toICQUin = Long.parseLong(uin);
//retrieve the details
long toICQUin = Long.parseLong(uin);
MetaFullInfoRequest infoRequest =
new MetaFullInfoRequest(
Long.parseLong(ownerUin),
reqID,
toICQUin);
int reqID = requestID++;
UserInfoResponseRetriever responseRetriever =
new UserInfoResponseRetriever(reqID);
MetaFullInfoRequest infoRequest =
new MetaFullInfoRequest(
Long.parseLong(ownerUin),
reqID,
toICQUin);
icqProvider.getAimConnection().getInfoService().getOscarConnection()
.sendSnacRequest(infoRequest, responseRetriever);
UserInfoResponseRetriever responseRetriever =
new UserInfoResponseRetriever(reqID);
icqProvider.getAimConnection().getInfoService().getOscarConnection()
.sendSnacRequest(infoRequest, responseRetriever);
responseRetriever.waitForLastInfo(60000);
responseRetriever.waitForLastInfo(60000);
List<GenericDetail> result = responseRetriever.result;
result = responseRetriever.result;
}
catch(Exception e) {}
if (result == null)
result = new LinkedList<GenericDetail>();

@ -115,10 +115,10 @@ public Iterator<GenericDetail> getDetails(
public Iterator<GenericDetail> getAllDetailsForContact(Contact contact)
{
assertConnected();
List<GenericDetail> res
= infoRetreiver.getContactDetails(contact.getAddress());
if(contact.getImage() != null)
{
res.add(new ServerStoredDetails.ImageDetail(

Loading…
Cancel
Save