MCPcopy Index your code
hub / github.com/BombusMod/BombusMod / constructVCard

Method constructVCard

src/main/java/VCard/VCard.java:111–141  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

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; }

Callers 1

runMethod · 0.80

Calls 6

getCountMethod · 0.95
getVCardDataMethod · 0.95
getChildBlockMethod · 0.95
addChildMethod · 0.95
toBase64Method · 0.95
addChildNsMethod · 0.80

Tested by

no test coverage detected