-
Notifications
You must be signed in to change notification settings - Fork 885
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
XEP-0084: User Avatar implementation
- Loading branch information
Showing
14 changed files
with
1,285 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
108 changes: 108 additions & 0 deletions
108
smack-extensions/src/main/java/org/jivesoftware/smackx/avatar/MetadataInfo.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,108 @@ | ||
/** | ||
* | ||
* Copyright 2017 Fernando Ramirez | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
package org.jivesoftware.smackx.avatar; | ||
|
||
/** | ||
* User Avatar metadata info model class. | ||
* | ||
* @author Fernando Ramirez | ||
* @see <a href="http://xmpp.org/extensions/xep-0084.html">XEP-0084: User | ||
* Avatar</a> | ||
*/ | ||
public class MetadataInfo { | ||
|
||
private String id; | ||
private String url; | ||
private long bytes; | ||
private String type; | ||
private int height; | ||
private int width; | ||
|
||
/** | ||
* MetadataInfo constructor. | ||
* | ||
* @param id | ||
* @param url | ||
* @param bytes | ||
* @param type | ||
* @param pixelsHeight | ||
* @param pixelsWidth | ||
*/ | ||
public MetadataInfo(String id, String url, long bytes, String type, int pixelsHeight, int pixelsWidth) { | ||
this.id = id; | ||
this.url = url; | ||
this.bytes = bytes; | ||
this.type = type; | ||
this.height = pixelsHeight; | ||
this.width = pixelsWidth; | ||
} | ||
|
||
/** | ||
* Get the id. | ||
* | ||
* @return the id | ||
*/ | ||
public String getId() { | ||
return id; | ||
} | ||
|
||
/** | ||
* Get the url. | ||
* | ||
* @return the url | ||
*/ | ||
public String getUrl() { | ||
return url; | ||
} | ||
|
||
/** | ||
* Get the amount of bytes. | ||
* | ||
* @return the amount of bytes | ||
*/ | ||
public long getBytes() { | ||
return bytes; | ||
} | ||
|
||
/** | ||
* Get the type. | ||
* | ||
* @return the type | ||
*/ | ||
public String getType() { | ||
return type; | ||
} | ||
|
||
/** | ||
* Get the height in pixels. | ||
* | ||
* @return the height in pixels | ||
*/ | ||
public int getHeight() { | ||
return height; | ||
} | ||
|
||
/** | ||
* Get the width in pixels. | ||
* | ||
* @return the width in pixels | ||
*/ | ||
public int getWidth() { | ||
return width; | ||
} | ||
|
||
} |
62 changes: 62 additions & 0 deletions
62
smack-extensions/src/main/java/org/jivesoftware/smackx/avatar/MetadataPointer.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
/** | ||
* | ||
* Copyright 2017 Fernando Ramirez | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
package org.jivesoftware.smackx.avatar; | ||
|
||
import java.util.HashMap; | ||
|
||
/** | ||
* User Avatar metadata pointer model class. | ||
* | ||
* @author Fernando Ramirez | ||
* @see <a href="http://xmpp.org/extensions/xep-0084.html">XEP-0084: User | ||
* Avatar</a> | ||
*/ | ||
public class MetadataPointer { | ||
|
||
private String namespace; | ||
private HashMap<String, Object> fields; | ||
|
||
/** | ||
* Metadata Pointer constructor. | ||
* | ||
* @param namespace | ||
* @param fields | ||
*/ | ||
public MetadataPointer(String namespace, HashMap<String, Object> fields) { | ||
this.namespace = namespace; | ||
this.fields = fields; | ||
} | ||
|
||
/** | ||
* Get the namespace. | ||
* | ||
* @return the namespace | ||
*/ | ||
public String getNamespace() { | ||
return namespace; | ||
} | ||
|
||
/** | ||
* Get the fields. | ||
* | ||
* @return the fields | ||
*/ | ||
public HashMap<String, Object> getFields() { | ||
return fields; | ||
} | ||
|
||
} |
Oops, something went wrong.