本文整理汇总了Java中org.telegram.tgnet.TLRPC.photos_Photos方法的典型用法代码示例。如果您正苦于以下问题:Java TLRPC.photos_Photos方法的具体用法?Java TLRPC.photos_Photos怎么用?Java TLRPC.photos_Photos使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.telegram.tgnet.TLRPC
的用法示例。
在下文中一共展示了TLRPC.photos_Photos方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: processLoadedUserPhotos
import org.telegram.tgnet.TLRPC; //导入方法依赖的package包/类
public void processLoadedUserPhotos(final TLRPC.photos_Photos res, final int did, final int offset, final int count, final long max_id, final boolean fromCache, final int classGuid) {
if (!fromCache) {
MessagesStorage.getInstance().putUsersAndChats(res.users, null, true, true);
MessagesStorage.getInstance().putDialogPhotos(did, res);
} else if (res == null || res.photos.isEmpty()) {
loadDialogPhotos(did, offset, count, max_id, false, classGuid);
return;
}
AndroidUtilities.runOnUIThread(new Runnable() {
@Override
public void run() {
putUsers(res.users, fromCache);
NotificationCenter.getInstance().postNotificationName(NotificationCenter.dialogPhotosLoaded, did, offset, count, fromCache, classGuid, res.photos);
}
});
}
示例2: putDialogPhotos
import org.telegram.tgnet.TLRPC; //导入方法依赖的package包/类
public void putDialogPhotos(final int did, final TLRPC.photos_Photos photos) {
if (photos == null || photos.photos.isEmpty()) {
return;
}
storageQueue.postRunnable(new Runnable() {
@Override
public void run() {
try {
SQLitePreparedStatement state = database.executeFast("REPLACE INTO user_photos VALUES(?, ?, ?)");
for (TLRPC.Photo photo : photos.photos) {
if (photo instanceof TLRPC.TL_photoEmpty) {
continue;
}
state.requery();
NativeByteBuffer data = new NativeByteBuffer(photo.getObjectSize());
photo.serializeToStream(data);
state.bindInteger(1, did);
state.bindLong(2, photo.id);
state.bindByteBuffer(3, data);
state.step();
data.reuse();
}
state.dispose();
} catch (Exception e) {
FileLog.e("tmessages", e);
}
}
});
}