_id stringlengths 2 7 | title stringlengths 3 140 | partition stringclasses 3
values | text stringlengths 73 34.1k | language stringclasses 1
value | meta_information dict |
|---|---|---|---|---|---|
q156100 | HeaderViewRecyclerAdapter.setAdapter | train | public void setAdapter(RecyclerView.Adapter adapter) {
if (mWrappedAdapter != null && mWrappedAdapter.getItemCount() > 0) {
notifyItemRangeRemoved(getHeaderCount(), mWrappedAdapter.getItemCount());
}
setWrappedAdapter(adapter);
notifyItemRangeInserted(getHeaderCount(), mWrapp... | java | {
"resource": ""
} |
q156101 | Base64Utils.longFromBase64 | train | public static long longFromBase64(String value) {
int pos = 0;
long longVal = base64Values[value.charAt(pos++)];
int len = value.length();
while (pos < len) {
longVal <<= 6;
longVal |= base64Values[value.charAt(pos++)];
}
return longVal;
} | java | {
"resource": ""
} |
q156102 | ActorRef.send | train | public void send(Object message, ActorRef sender) {
endpoint.getMailbox().schedule(new Envelope(message, endpoint.getScope(), endpoint.getMailbox(), sender));
} | java | {
"resource": ""
} |
q156103 | ActorRef.sendFirst | train | public void sendFirst(Object message, ActorRef sender) {
endpoint.getMailbox().scheduleFirst(new Envelope(message, endpoint.getScope(), endpoint.getMailbox(), sender));
} | java | {
"resource": ""
} |
q156104 | UnhandledExceptionHandler.getTopLevelCauseMessage | train | private static String getTopLevelCauseMessage(Throwable t) {
Throwable topLevelCause = t;
while (topLevelCause.getCause() != null) {
topLevelCause = topLevelCause.getCause();
}
return topLevelCause.getMessage();
} | java | {
"resource": ""
} |
q156105 | ActorToolbar.colorizeToolbar | train | public static void colorizeToolbar(Toolbar toolbarView, int toolbarIconsColor, Activity activity) {
final PorterDuffColorFilter colorFilter
= new PorterDuffColorFilter(toolbarIconsColor, PorterDuff.Mode.SRC_IN);
for (int i = 0; i < toolbarView.getChildCount(); i++) {
final V... | java | {
"resource": ""
} |
q156106 | SessionManagerActor.pickSession | train | public Promise<PeerSession> pickSession(final int uid,
final int keyGroupId,
final long ownKeyId,
final long theirKeyId) {
return pickCachedSession(uid, keyGroupId, ownKeyId, thei... | java | {
"resource": ""
} |
q156107 | SessionManagerActor.spawnSession | train | private PeerSession spawnSession(int uid,
int ownKeyGroup,
int theirKeyGroup,
PrivateKey ownIdentity,
PublicKey theirIdentity,
PrivateK... | java | {
"resource": ""
} |
q156108 | SessionManagerActor.pickCachedSession | train | private Promise<PeerSession> pickCachedSession(int uid, final int keyGroupId) {
return ManagedList.of(peerSessions.getValue(uid))
.flatMap(PeerSessionsStorage.SESSIONS)
.filter(PeerSession.BY_THEIR_GROUP(keyGroupId))
.sorted(PeerSession.COMPARATOR)
... | java | {
"resource": ""
} |
q156109 | ImageDrawing.drawTo | train | public static void drawTo(Bitmap src, Bitmap dest, int color) {
clearBitmap(src, color);
Canvas canvas = new Canvas(dest);
canvas.drawBitmap(src, 0, 0, null);
canvas.setBitmap(null);
} | java | {
"resource": ""
} |
q156110 | ImageDrawing.drawInRound | train | public static void drawInRound(Bitmap src, Bitmap dest, int clearColor) {
if (dest.getWidth() != dest.getHeight()) {
throw new RuntimeException("dest Bitmap must have square size");
}
clearBitmap(dest, clearColor);
Canvas canvas = new Canvas(dest);
int r = dest.getWi... | java | {
"resource": ""
} |
q156111 | ImageScaling.scaleFill | train | public static Bitmap scaleFill(Bitmap src, int w, int h) {
Bitmap res = Bitmap.createBitmap(w, h, Bitmap.Config.ARGB_8888);
scaleFill(src, res);
return res;
} | java | {
"resource": ""
} |
q156112 | ImageScaling.scaleFill | train | public static void scaleFill(Bitmap src, Bitmap dest, int clearColor) {
float ratio = Math.max(dest.getWidth() / (float) src.getWidth(), dest.getHeight() / (float) src.getHeight());
int newW = (int) (src.getWidth() * ratio);
int newH = (int) (src.getHeight() * ratio);
int paddingTop = (d... | java | {
"resource": ""
} |
q156113 | ImageScaling.scaleFit | train | public static void scaleFit(Bitmap src, Bitmap dest, int clearColor) {
float ratio = Math.min(dest.getWidth() / (float) src.getWidth(), dest.getHeight() / (float) src.getHeight());
int newW = (int) (src.getWidth() * ratio);
int newH = (int) (src.getHeight() * ratio);
int paddingTop = (de... | java | {
"resource": ""
} |
q156114 | ImageScaling.scale | train | public static Bitmap scale(Bitmap src, int dw, int dh) {
Bitmap res = Bitmap.createBitmap(dw, dh, Bitmap.Config.ARGB_8888);
scale(src, res);
return res;
} | java | {
"resource": ""
} |
q156115 | JSONObject.wrap | train | public static Object wrap(Object o) {
if (o == null) {
return NULL;
}
if (o instanceof JSONArray || o instanceof JSONObject) {
return o;
}
if (o.equals(NULL)) {
return o;
}
try {
if (o instanceof Collection) {
... | java | {
"resource": ""
} |
q156116 | Messenger.doStartEmailAuth | train | @NotNull
@ObjectiveCName("doStartAuthWithEmail:")
public Promise<AuthStartRes> doStartEmailAuth(String email) {
return modules.getAuthModule().doStartEmailAuth(email);
} | java | {
"resource": ""
} |
q156117 | Messenger.doStartPhoneAuth | train | @NotNull
@ObjectiveCName("doStartAuthWithPhone:")
public Promise<AuthStartRes> doStartPhoneAuth(long phone) {
return modules.getAuthModule().doStartPhoneAuth(phone);
} | java | {
"resource": ""
} |
q156118 | Messenger.doValidateCode | train | @NotNull
@ObjectiveCName("doValidateCode:withTransaction:")
public Promise<AuthCodeRes> doValidateCode(String code, String transactionHash) {
return modules.getAuthModule().doValidateCode(transactionHash, code);
} | java | {
"resource": ""
} |
q156119 | Messenger.doSendCodeViaCall | train | @NotNull
@ObjectiveCName("doSendCodeViaCall:")
public Promise<Boolean> doSendCodeViaCall(String transactionHash) {
return modules.getAuthModule().doSendCall(transactionHash);
} | java | {
"resource": ""
} |
q156120 | Messenger.requestStartEmailAuth | train | @NotNull
@Deprecated
@ObjectiveCName("requestStartAuthCommandWithEmail:")
public Command<AuthState> requestStartEmailAuth(final String email) {
return modules.getAuthModule().requestStartEmailAuth(email);
} | java | {
"resource": ""
} |
q156121 | Messenger.requestStartPhoneAuth | train | @NotNull
@Deprecated
@ObjectiveCName("requestStartAuthCommandWithPhone:")
public Command<AuthState> requestStartPhoneAuth(final long phone) {
return modules.getAuthModule().requestStartPhoneAuth(phone);
} | java | {
"resource": ""
} |
q156122 | Messenger.requestStartAnonymousAuth | train | @NotNull
@Deprecated
@ObjectiveCName("requestStartAnonymousAuthWithUserName:")
public Command<AuthState> requestStartAnonymousAuth(String userName) {
return modules.getAuthModule().requestStartAnonymousAuth(userName);
} | java | {
"resource": ""
} |
q156123 | Messenger.requestStartUserNameAuth | train | @NotNull
@ObjectiveCName("requestStartAuthCommandWithUserName:")
public Command<AuthState> requestStartUserNameAuth(String userName) {
return modules.getAuthModule().requestStartUserNameAuth(userName);
} | java | {
"resource": ""
} |
q156124 | Messenger.requestCompleteOAuth | train | @NotNull
@ObjectiveCName("requestCompleteOAuthCommandWithCode:")
public Command<AuthState> requestCompleteOAuth(String code) {
return modules.getAuthModule().requestCompleteOauth(code);
} | java | {
"resource": ""
} |
q156125 | Messenger.validateCode | train | @NotNull
@ObjectiveCName("validateCodeCommand:")
public Command<AuthState> validateCode(final String code) {
return modules.getAuthModule().requestValidateCode(code);
} | java | {
"resource": ""
} |
q156126 | Messenger.getUsers | train | @Nullable
@ObjectiveCName("getUsers")
public MVVMCollection<User, UserVM> getUsers() {
if (modules.getUsersModule() == null) {
return null;
}
return modules.getUsersModule().getUsers();
} | java | {
"resource": ""
} |
q156127 | Messenger.getGroups | train | @Nullable
@ObjectiveCName("getGroups")
public MVVMCollection<Group, GroupVM> getGroups() {
if (modules.getGroupsModule() == null) {
return null;
}
return modules.getGroupsModule().getGroupsCollection();
} | java | {
"resource": ""
} |
q156128 | Messenger.getTyping | train | @NotNull
@ObjectiveCName("getTypingWithUid:")
public ValueModel<Boolean> getTyping(int uid) {
return modules.getTypingModule().getTyping(uid).getTyping();
} | java | {
"resource": ""
} |
q156129 | Messenger.getGroupTyping | train | @NotNull
@ObjectiveCName("getGroupTypingWithGid:")
public ValueModel<int[]> getGroupTyping(int gid) {
return modules.getTypingModule().getGroupTyping(gid).getActive();
} | java | {
"resource": ""
} |
q156130 | Messenger.onProfileOpen | train | @ObjectiveCName("onProfileOpenWithUid:")
public void onProfileOpen(int uid) {
modules.getEvents().post(new PeerInfoOpened(Peer.user(uid)));
} | java | {
"resource": ""
} |
q156131 | Messenger.onProfileClosed | train | @ObjectiveCName("onProfileClosedWithUid:")
public void onProfileClosed(int uid) {
modules.getEvents().post(new PeerInfoClosed(Peer.user(uid)));
} | java | {
"resource": ""
} |
q156132 | Messenger.onPushReceived | train | @ObjectiveCName("onPushReceivedWithSeq:withAuthId:")
public void onPushReceived(int seq, long authId) {
if (modules.getUpdatesModule() != null) {
modules.getUpdatesModule().onPushReceived(seq, authId);
}
} | java | {
"resource": ""
} |
q156133 | Messenger.getConversationVM | train | @NotNull
@ObjectiveCName("getConversationVM")
public ConversationVM getConversationVM(Peer peer) {
return modules.getMessagesModule().getConversationVM(peer);
} | java | {
"resource": ""
} |
q156134 | Messenger.sendVideo | train | @ObjectiveCName("sendVideoWithPeer:withName:withW:withH:withDuration:withThumb:withDescriptor:")
public void sendVideo(Peer peer, String fileName, int w, int h, int duration,
FastThumb fastThumb, String descriptor) {
modules.getMessagesModule().sendVideo(peer, fileName, w, h, durat... | java | {
"resource": ""
} |
q156135 | Messenger.sendDocument | train | @ObjectiveCName("sendDocumentWithPeer:withName:withMime:withThumb:withDescriptor:")
public void sendDocument(Peer peer, String fileName, String mimeType, FastThumb fastThumb,
String descriptor) {
modules.getMessagesModule().sendDocument(peer, fileName, mimeType, fastThumb, descr... | java | {
"resource": ""
} |
q156136 | Messenger.forwardContent | train | @ObjectiveCName("forwardContentContentWithPeer:withContent:")
public void forwardContent(Peer peer, AbsContent content) {
modules.getMessagesModule().forwardContent(peer, content);
} | java | {
"resource": ""
} |
q156137 | Messenger.addReaction | train | @ObjectiveCName("addReactionWithPeer:withRid:withCode:")
public Command<Void> addReaction(Peer peer, long rid, String code) {
return callback -> modules.getMessagesModule().addReaction(peer, rid, code)
.then(v -> callback.onResult(v))
.failure(e -> callback.onError(e));
} | java | {
"resource": ""
} |
q156138 | Messenger.saveDraft | train | @ObjectiveCName("saveDraftWithPeer:withDraft:")
public void saveDraft(Peer peer, String draft) {
modules.getMessagesModule().saveDraft(peer, draft);
} | java | {
"resource": ""
} |
q156139 | Messenger.loadDraft | train | @Nullable
@ObjectiveCName("loadDraftWithPeer:")
public String loadDraft(Peer peer) {
return modules.getMessagesModule().loadDraft(peer);
} | java | {
"resource": ""
} |
q156140 | Messenger.findMentions | train | @ObjectiveCName("findMentionsWithGid:withQuery:")
public List<MentionFilterResult> findMentions(int gid, String query) {
return modules.getMentions().findMentions(gid, query);
} | java | {
"resource": ""
} |
q156141 | Messenger.findPeers | train | @ObjectiveCName("findPeersWithType:")
public Command<List<PeerSearchEntity>> findPeers(PeerSearchType type) {
return callback -> modules.getSearchModule().findPeers(type)
.then(v -> callback.onResult(v))
.failure(e -> callback.onError(e));
} | java | {
"resource": ""
} |
q156142 | Messenger.findPeers | train | @ObjectiveCName("findPeersWithQuery:")
public Command<List<PeerSearchEntity>> findPeers(String query) {
return callback -> modules.getSearchModule().findPeers(query)
.then(v -> callback.onResult(v))
.failure(e -> callback.onError(e));
} | java | {
"resource": ""
} |
q156143 | Messenger.findTextMessages | train | @ObjectiveCName("findTextMessagesWithPeer:withQuery:")
public Command<List<MessageSearchEntity>> findTextMessages(Peer peer, String query) {
return callback -> modules.getSearchModule().findTextMessages(peer, query)
.then(v -> callback.onResult(v))
.failure(e -> callback.onEr... | java | {
"resource": ""
} |
q156144 | Messenger.findAllDocs | train | @ObjectiveCName("findAllDocsWithPeer:")
public Command<List<MessageSearchEntity>> findAllDocs(Peer peer) {
return callback -> modules.getSearchModule().findAllDocs(peer)
.then(v -> callback.onResult(v))
.failure(e -> callback.onError(e));
} | java | {
"resource": ""
} |
q156145 | Messenger.doCall | train | @ObjectiveCName("doCallWithUid:")
public Command<Long> doCall(int uid) {
return modules.getCallsModule().makeCall(Peer.user(uid), false);
} | java | {
"resource": ""
} |
q156146 | Messenger.doVideoCall | train | @ObjectiveCName("doVideoCallWithUid:")
public Command<Long> doVideoCall(int uid) {
return modules.getCallsModule().makeCall(Peer.user(uid), true);
} | java | {
"resource": ""
} |
q156147 | Messenger.doGroupCall | train | @ObjectiveCName("doCallWithGid:")
public Command<Long> doGroupCall(int gid) {
return modules.getCallsModule().makeCall(Peer.group(gid), false);
} | java | {
"resource": ""
} |
q156148 | Messenger.toggleCallMute | train | @ObjectiveCName("toggleCallMuteWithCallId:")
public void toggleCallMute(long callId) {
if (modules.getCallsModule().getCall(callId).getIsAudioEnabled().get()) {
modules.getCallsModule().muteCall(callId);
} else {
modules.getCallsModule().unmuteCall(callId);
}
} | java | {
"resource": ""
} |
q156149 | Messenger.toggleVideoEnabled | train | @ObjectiveCName("toggleVideoEnabledWithCallId:")
public void toggleVideoEnabled(long callId) {
if (modules.getCallsModule().getCall(callId).getIsVideoEnabled().get()) {
modules.getCallsModule().disableVideo(callId);
} else {
modules.getCallsModule().enableVideo(callId);
... | java | {
"resource": ""
} |
q156150 | Messenger.checkCall | train | @ObjectiveCName("checkCall:withAttempt:")
public void checkCall(long callId, int attempt) {
if (modules.getCallsModule() != null) {
modules.getCallsModule().checkCall(callId, attempt);
}
} | java | {
"resource": ""
} |
q156151 | Messenger.editMyName | train | @Nullable
@ObjectiveCName("editMyNameCommandWithName:")
public Command<Boolean> editMyName(final String newName) {
return callback -> modules.getUsersModule().editMyName(newName)
.then(v -> callback.onResult(true))
.failure(e -> callback.onError(e));
} | java | {
"resource": ""
} |
q156152 | Messenger.editMyNick | train | @Nullable
@ObjectiveCName("editMyNickCommandWithNick:")
public Command<Boolean> editMyNick(final String newNick) {
return callback -> modules.getUsersModule().editNick(newNick)
.then(v -> callback.onResult(true))
.failure(e -> callback.onError(e));
} | java | {
"resource": ""
} |
q156153 | Messenger.editMyAbout | train | @Nullable
@ObjectiveCName("editMyAboutCommandWithNick:")
public Command<Boolean> editMyAbout(final String newAbout) {
return callback -> modules.getUsersModule().editAbout(newAbout)
.then(v -> callback.onResult(true))
.failure(e -> callback.onError(e));
} | java | {
"resource": ""
} |
q156154 | Messenger.editName | train | @Nullable
@ObjectiveCName("editNameCommandWithUid:withName:")
public Command<Boolean> editName(final int uid, final String name) {
return callback -> modules.getUsersModule().editName(uid, name)
.then(v -> callback.onResult(true))
.failure(e -> callback.onError(e));
} | java | {
"resource": ""
} |
q156155 | Messenger.editGroupTitle | train | @NotNull
@ObjectiveCName("editGroupTitleWithGid:withTitle:")
public Promise<Void> editGroupTitle(final int gid, final String title) {
return modules.getGroupsModule().editTitle(gid, title);
} | java | {
"resource": ""
} |
q156156 | Messenger.editGroupTheme | train | @NotNull
@ObjectiveCName("editGroupThemeCommandWithGid:withTheme:")
public Command<Void> editGroupTheme(final int gid, final String theme) {
return callback -> modules.getGroupsModule().editTheme(gid, theme)
.then(v -> callback.onResult(v))
.failure(e -> callback.onError(... | java | {
"resource": ""
} |
q156157 | Messenger.editGroupAbout | train | @NotNull
@ObjectiveCName("editGroupAboutWithGid:withAbout:")
public Promise<Void> editGroupAbout(int gid, String about) {
return modules.getGroupsModule().editAbout(gid, about);
} | java | {
"resource": ""
} |
q156158 | Messenger.editGroupShortName | train | @NotNull
@ObjectiveCName("editGroupShortNameWithGid:withAbout:")
public Promise<Void> editGroupShortName(int gid, String shortName) {
return modules.getGroupsModule().editShortName(gid, shortName);
} | java | {
"resource": ""
} |
q156159 | Messenger.loadGroupPermissions | train | @NotNull
@ObjectiveCName("loadGroupPermissionsWithGid:")
public Promise<GroupPermissions> loadGroupPermissions(int gid) {
return modules.getGroupsModule().loadAdminSettings(gid);
} | java | {
"resource": ""
} |
q156160 | Messenger.saveGroupPermissions | train | @NotNull
@ObjectiveCName("saveGroupPermissionsWithGid:withSettings:")
public Promise<Void> saveGroupPermissions(int gid, GroupPermissions adminSettings) {
return modules.getGroupsModule().saveAdminSettings(gid, adminSettings);
} | java | {
"resource": ""
} |
q156161 | Messenger.changeGroupAvatar | train | @ObjectiveCName("changeGroupAvatarWithGid:withDescriptor:")
public void changeGroupAvatar(int gid, String descriptor) {
modules.getGroupsModule().changeAvatar(gid, descriptor);
} | java | {
"resource": ""
} |
q156162 | Messenger.leaveAndDeleteGroup | train | @NotNull
@ObjectiveCName("leaveAndDeleteGroupWithGid:")
public Promise<Void> leaveAndDeleteGroup(int gid) {
return modules.getGroupsModule().leaveAndDeleteGroup(gid);
} | java | {
"resource": ""
} |
q156163 | Messenger.shareHistory | train | @NotNull
@ObjectiveCName("shareHistoryWithGid:")
public Promise<Void> shareHistory(int gid) {
return modules.getGroupsModule().shareHistory(gid);
} | java | {
"resource": ""
} |
q156164 | Messenger.inviteMemberPromise | train | @NotNull
@ObjectiveCName("inviteMemberPromiseWithGid:withUid:")
public Promise<Void> inviteMemberPromise(int gid, int uid) {
return modules.getGroupsModule().addMember(gid, uid);
} | java | {
"resource": ""
} |
q156165 | Messenger.loadMembers | train | @ObjectiveCName("loadMembersWithGid:withLimit:withNext:")
public Promise<GroupMembersSlice> loadMembers(int gid, int limit, byte[] next) {
return modules.getGroupsModule().loadMembers(gid, limit, next);
} | java | {
"resource": ""
} |
q156166 | Messenger.makeAdmin | train | @NotNull
@ObjectiveCName("makeAdminCommandWithGid:withUid:")
public Command<Void> makeAdmin(final int gid, final int uid) {
return callback -> modules.getGroupsModule().makeAdmin(gid, uid)
.then(v -> callback.onResult(v))
.failure(e -> callback.onError(e));
} | java | {
"resource": ""
} |
q156167 | Messenger.transferOwnership | train | @NotNull
@ObjectiveCName("transferOwnershipWithGid:withUid:")
public Promise<Void> transferOwnership(int gid, int uid) {
return modules.getGroupsModule().transferOwnership(gid, uid);
} | java | {
"resource": ""
} |
q156168 | Messenger.joinGroupViaToken | train | @NotNull
@ObjectiveCName("joinGroupViaLinkCommandWithToken:")
public Command<Integer> joinGroupViaToken(String token) {
return callback -> modules.getGroupsModule().joinGroupByToken(token)
.then(v -> callback.onResult(v))
.failure(e -> callback.onError(e));
} | java | {
"resource": ""
} |
q156169 | Messenger.requestIntegrationToken | train | @NotNull
@ObjectiveCName("requestIntegrationTokenCommandWithGid:")
public Command<String> requestIntegrationToken(int gid) {
return callback -> modules.getGroupsModule().requestIntegrationToken(gid)
.then(v -> callback.onResult(v))
.failure(e -> callback.onError(e));
... | java | {
"resource": ""
} |
q156170 | Messenger.isStarted | train | @ObjectiveCName("isStartedWithUid:")
public Promise<Boolean> isStarted(int uid) {
return modules.getMessagesModule().chatIsEmpty(Peer.user(uid));
} | java | {
"resource": ""
} |
q156171 | Messenger.removeContact | train | @Nullable
@ObjectiveCName("removeContactCommandWithUid:")
public Command<Boolean> removeContact(int uid) {
return modules.getContactsModule().removeContact(uid);
} | java | {
"resource": ""
} |
q156172 | Messenger.addContact | train | @Nullable
@ObjectiveCName("addContactCommandWithUid:")
public Command<Boolean> addContact(int uid) {
return modules.getContactsModule().addContact(uid);
} | java | {
"resource": ""
} |
q156173 | Messenger.bindFile | train | @NotNull
@ObjectiveCName("bindFileWithReference:autoStart:withCallback:")
public FileVM bindFile(FileReference fileReference, boolean isAutoStart, FileVMCallback callback) {
return new FileVM(fileReference, isAutoStart, modules, callback);
} | java | {
"resource": ""
} |
q156174 | Messenger.bindUpload | train | @NotNull
@ObjectiveCName("bindUploadWithRid:withCallback:")
public UploadFileVM bindUpload(long rid, UploadFileVMCallback callback) {
return new UploadFileVM(rid, callback, modules);
} | java | {
"resource": ""
} |
q156175 | Messenger.bindRawFile | train | @ObjectiveCName("bindRawFileWithReference:autoStart:withCallback:")
public void bindRawFile(FileReference fileReference, boolean isAutoStart, FileCallback callback) {
modules.getFilesModule().bindFile(fileReference, isAutoStart, callback);
} | java | {
"resource": ""
} |
q156176 | Messenger.unbindRawFile | train | @ObjectiveCName("unbindRawFileWithFileId:autoCancel:withCallback:")
public void unbindRawFile(long fileId, boolean isAutoCancel, FileCallback callback) {
modules.getFilesModule().unbindFile(fileId, callback, isAutoCancel);
} | java | {
"resource": ""
} |
q156177 | Messenger.bindRawUploadFile | train | @ObjectiveCName("bindRawUploadFileWithRid:withCallback:")
public void bindRawUploadFile(long rid, UploadFileCallback callback) {
modules.getFilesModule().bindUploadFile(rid, callback);
} | java | {
"resource": ""
} |
q156178 | Messenger.unbindRawUploadFile | train | @ObjectiveCName("unbindRawUploadFileWithRid:withCallback:")
public void unbindRawUploadFile(long rid, UploadFileCallback callback) {
modules.getFilesModule().unbindUploadFile(rid, callback);
} | java | {
"resource": ""
} |
q156179 | Messenger.requestState | train | @ObjectiveCName("requestStateWithFileId:withCallback:")
public void requestState(long fileId, final FileCallback callback) {
modules.getFilesModule().requestState(fileId, callback);
} | java | {
"resource": ""
} |
q156180 | Messenger.requestUploadState | train | @ObjectiveCName("requestUploadStateWithRid:withCallback:")
public void requestUploadState(long rid, UploadFileCallback callback) {
modules.getFilesModule().requestUploadState(rid, callback);
} | java | {
"resource": ""
} |
q156181 | Messenger.changeNotificationsEnabled | train | @ObjectiveCName("changeNotificationsEnabledWithPeer:withValue:")
public void changeNotificationsEnabled(Peer peer, boolean val) {
modules.getSettingsModule().changeNotificationsEnabled(peer, val);
} | java | {
"resource": ""
} |
q156182 | Messenger.changeNotificationsSound | train | @ObjectiveCName("changeNotificationsSoundPeer:withValue:")
public void changeNotificationsSound(Peer peer, String val) {
modules.getSettingsModule().changeNotificationPeerSound(peer, val);
} | java | {
"resource": ""
} |
q156183 | Messenger.loadSessions | train | @NotNull
@ObjectiveCName("loadSessionsCommand")
public Command<List<ApiAuthSession>> loadSessions() {
return callback -> modules.getSecurityModule().loadSessions()
.then(r -> callback.onResult(r))
.failure(e -> callback.onError(e));
} | java | {
"resource": ""
} |
q156184 | Messenger.terminateAllSessions | train | @NotNull
@ObjectiveCName("terminateAllSessionsCommand")
public Command<Void> terminateAllSessions() {
return callback -> modules.getSecurityModule().terminateAllSessions()
.then(r -> callback.onResult(r))
.failure(e -> callback.onError(e));
} | java | {
"resource": ""
} |
q156185 | Messenger.startWebAction | train | @ObjectiveCName("startWebAction:")
public Command<WebActionDescriptor> startWebAction(final String webAction) {
return modules.getExternalModule().startWebAction(webAction);
} | java | {
"resource": ""
} |
q156186 | Messenger.completeWebAction | train | @ObjectiveCName("completeWebActionWithHash:withUrl:")
public Command<Boolean> completeWebAction(final String actionHash, final String url) {
return modules.getExternalModule().completeWebAction(actionHash, url);
} | java | {
"resource": ""
} |
q156187 | Messenger.registerGooglePush | train | @ObjectiveCName("registerGooglePushWithProjectId:withToken:")
public void registerGooglePush(long projectId, String token) {
modules.getPushesModule().registerGooglePush(projectId, token);
} | java | {
"resource": ""
} |
q156188 | Messenger.registerApplePush | train | @ObjectiveCName("registerApplePushWithApnsId:withToken:")
public void registerApplePush(int apnsId, String token) {
modules.getPushesModule().registerApplePush(apnsId, token);
} | java | {
"resource": ""
} |
q156189 | Messenger.registerApplePushKit | train | @ObjectiveCName("registerApplePushKitWithApnsId:withToken:")
public void registerApplePushKit(int apnsId, String token) {
modules.getPushesModule().registerApplePushKit(apnsId, token);
} | java | {
"resource": ""
} |
q156190 | ConfigurationBuilder.addTrustedKey | train | @NotNull
@ObjectiveCName("addTrustedKey:")
public ConfigurationBuilder addTrustedKey(String trustedKey) {
trustedKeys.add(new TrustedKey(trustedKey));
return this;
} | java | {
"resource": ""
} |
q156191 | ConfigurationBuilder.addPreferredLanguage | train | @NotNull
@ObjectiveCName("addPreferredLanguage:")
public ConfigurationBuilder addPreferredLanguage(String language) {
if (!preferredLanguages.contains(language)) {
preferredLanguages.add(language);
}
return this;
} | java | {
"resource": ""
} |
q156192 | AppStateVM.onDialogsChanged | train | public synchronized void onDialogsChanged(boolean isEmpty) {
if (isDialogsEmpty.get() != isEmpty) {
context.getPreferences().putBool("app.dialogs.empty", isEmpty);
isDialogsEmpty.change(isEmpty);
}
if (!isEmpty) {
if (isAppEmpty.get()) {
contex... | java | {
"resource": ""
} |
q156193 | AppStateVM.onContactsChanged | train | public synchronized void onContactsChanged(boolean isEmpty) {
if (isContactsEmpty.get() != isEmpty) {
context.getPreferences().putBool("app.contacts.empty", isEmpty);
isContactsEmpty.change(isEmpty);
}
if (!isEmpty) {
if (isAppEmpty.get()) {
co... | java | {
"resource": ""
} |
q156194 | NotificationsActor.onNewMessage | train | public void onNewMessage(Peer peer, int sender, long date, ContentDescription description,
boolean hasCurrentUserMention, int messagesCount, int dialogsCount) {
// Check if message already read to avoid incorrect notifications
// for already read messages
if (date <... | java | {
"resource": ""
} |
q156195 | NotificationsActor.onMessagesRead | train | public void onMessagesRead(Peer peer, long fromDate) {
// Filtering obsolete read events
if (fromDate < getLastReadDate(peer)) {
return;
}
// Removing read messages from pending storage
getNotifications().clear();
pendingStorage.setMessagesCount(0);
... | java | {
"resource": ""
} |
q156196 | NotificationsActor.onConversationHidden | train | public void onConversationHidden(Peer peer) {
if (visiblePeer != null && visiblePeer.equals(peer)) {
this.visiblePeer = null;
}
} | java | {
"resource": ""
} |
q156197 | NotificationsActor.isNotificationsEnabled | train | private boolean isNotificationsEnabled(Peer peer, boolean hasMention) {
// If notifications doesn't enabled at all
if (!context().getSettingsModule().isNotificationsEnabled()) {
return false;
}
// Notifications for groups
if (peer.getPeerType() == PeerType.GROUP) {
... | java | {
"resource": ""
} |
q156198 | NotificationsActor.getLastReadDate | train | private long getLastReadDate(Peer peer) {
if (readStates.containsKey(peer)) {
return readStates.get(peer);
}
byte[] data = storage.get(peer.getUnuqueId());
if (data != null) {
try {
return ReadState.fromBytes(data).getSortDate();
} cat... | java | {
"resource": ""
} |
q156199 | NotificationsActor.setLastReadDate | train | private void setLastReadDate(Peer peer, long date) {
storage.put(peer.getUnuqueId(), new ReadState(date).toByteArray());
readStates.put(peer, date);
} | java | {
"resource": ""
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.