()
| 109 | } |
| 110 | |
| 111 | public JabberDataBlock constructVCard(){ |
| 112 | JabberDataBlock vcardIq=new Iq(null, Iq.TYPE_SET, "vcard-set"); |
| 113 | JabberDataBlock vcardTemp=vcardIq.addChildNs("vCard", NS_VCARD); |
| 114 | |
| 115 | int itemsCount=getCount(); |
| 116 | |
| 117 | for (int i=0; i<itemsCount; i++){ |
| 118 | String field=getVCardData(i); |
| 119 | if (field==null) continue; |
| 120 | |
| 121 | String f1=(String)VCard.vCardFields.elementAt(i); |
| 122 | String f2=(String)VCard.vCardFields2.elementAt(i); |
| 123 | |
| 124 | JabberDataBlock subLevel=vcardTemp; |
| 125 | if (f2!=null) { |
| 126 | subLevel=vcardTemp.getChildBlock(f2); |
| 127 | if (subLevel==null) subLevel=vcardTemp.addChild(f2, null); |
| 128 | } |
| 129 | subLevel.addChild(f1, field); |
| 130 | |
| 131 | } |
| 132 | if (photo!=null) { |
| 133 | JabberDataBlock ph=vcardTemp.addChild("PHOTO", null); |
| 134 | ph.addChild("BINVAL", Strconv.toBase64(photo, -1)); |
| 135 | if (photoType!=null) { |
| 136 | ph.addChild("TYPE", photoType); |
| 137 | } |
| 138 | } |
| 139 | //System.out.println(vcard.toString()); |
| 140 | return vcardIq; |
| 141 | } |
| 142 | |
| 143 | public byte[] getPhoto() { return photo; } |
| 144 | public void setPhoto(byte[] photo) { this.photo=photo; } |
no test coverage detected