handle muc nicks with white spaces. fixed #884

This commit is contained in:
iNPUTmice 2015-01-14 22:48:14 +01:00
parent df742ce1e1
commit a6a9ed4877
2 changed files with 4 additions and 3 deletions

View file

@ -212,7 +212,8 @@ public class AvatarService {
}
bitmap = Bitmap.createBitmap(size, size, Bitmap.Config.ARGB_8888);
Canvas canvas = new Canvas(bitmap);
final String letter = name.isEmpty() ? "X" : name.substring(0,1);
final String trimmedName = name.trim();
final String letter = trimmedName.isEmpty() ? "X" : trimmedName.substring(0,1);
final int color = UIHelper.getColorForName(name);
drawTile(canvas, letter, color, 0, 0, size, size);
mXmppConnectionService.getBitmapCache().put(KEY, bitmap);

View file

@ -212,9 +212,9 @@ public class UIHelper {
if (counterpart==null) {
return "";
} else if (!counterpart.isBareJid()) {
return counterpart.getResourcepart();
return counterpart.getResourcepart().trim();
} else {
return counterpart.toString();
return counterpart.toString().trim();
}
}
}