(JabberDataBlock field)
| 260 | } |
| 261 | |
| 262 | private VirtualElement extractMedia(JabberDataBlock field) { |
| 263 | // XEP-0221 |
| 264 | try { |
| 265 | JabberDataBlock m = field.findNamespace("media", "urn:xmpp:media-element"); |
| 266 | if (m == null) { |
| 267 | return null; |
| 268 | } |
| 269 | |
| 270 | for (Enumeration e = m.getChildBlocks().elements(); e.hasMoreElements();) { |
| 271 | JabberDataBlock u = (JabberDataBlock) e.nextElement(); |
| 272 | if (u.getTagName().equals("uri")) { |
| 273 | if (!u.getTypeAttribute().startsWith("image")) { |
| 274 | continue; |
| 275 | } |
| 276 | mediaUri = u.getText(); |
| 277 | return new ImageItem(null, "[Loading Image]"); |
| 278 | } |
| 279 | } |
| 280 | |
| 281 | } catch (Exception e) { |
| 282 | } |
| 283 | return null; |
| 284 | } |
| 285 | } |
no test coverage detected