diff --git a/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/Constants.kt b/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/Constants.kt index 30e026618..e37d06e0e 100644 --- a/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/Constants.kt +++ b/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/Constants.kt @@ -19,8 +19,8 @@ object Constants { val AUTH_VERSION = if (DEFAULT_ACCOUNT_TYPE == AccountType.KATE) API_VERSION else "5.122" const val FILE_PROVIDER_AUTHORITY: String = BuildConfig.APPLICATION_ID + ".file_provider" - const val VK_ANDROID_APP_VERSION_NAME = "8.11" - const val VK_ANDROID_APP_VERSION_CODE = "15060" + const val VK_ANDROID_APP_VERSION_NAME = "8.12" + const val VK_ANDROID_APP_VERSION_CODE = "15090" const val KATE_APP_VERSION_NAME = "96 lite" const val KATE_APP_VERSION_CODE = "529" const val API_ID: Int = BuildConfig.VK_API_APP_ID @@ -167,4 +167,4 @@ object Constants { Settings.get().accounts().getType(accountId) ) } -} \ No newline at end of file +} diff --git a/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/activity/AttachmentsActivity.kt b/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/activity/AttachmentsActivity.kt index 3149badee..163166eda 100644 --- a/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/activity/AttachmentsActivity.kt +++ b/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/activity/AttachmentsActivity.kt @@ -21,7 +21,7 @@ class AttachmentsActivity : NoMainActivity(), PlaceProvider { if (savedInstanceState == null) { var fragment: Fragment? = null val type = (intent.extras ?: return).getInt(Extra.TYPE) - val accountId = (intent.extras ?: return).getInt(Extra.ACCOUNT_ID) + val accountId = (intent.extras ?: return).getLong(Extra.ACCOUNT_ID) when (type) { AttachmentsTypes.DOC -> fragment = DocsFragment.newInstance(accountId, accountId, DocsListPresenter.ACTION_SELECT) @@ -54,7 +54,7 @@ class AttachmentsActivity : NoMainActivity(), PlaceProvider { companion object { - fun createIntent(context: Context, accountId: Int, type: Int): Intent { + fun createIntent(context: Context, accountId: Long, type: Int): Intent { return Intent(context, AttachmentsActivity::class.java) .putExtra(Extra.TYPE, type) .putExtra(Extra.ACCOUNT_ID, accountId) diff --git a/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/activity/AudioSelectActivity.kt b/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/activity/AudioSelectActivity.kt index ce3752a08..7bd534a64 100644 --- a/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/activity/AudioSelectActivity.kt +++ b/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/activity/AudioSelectActivity.kt @@ -15,12 +15,12 @@ class AudioSelectActivity : NoMainActivity(), PlaceProvider { override fun onCreate(savedInstanceState: Bundle?) { super.onCreate(savedInstanceState) savedInstanceState ?: run { - val accountId = (intent.extras ?: return@run).getInt(Extra.ACCOUNT_ID) + val accountId = (intent.extras ?: return@run).getLong(Extra.ACCOUNT_ID) attachInitialFragment(accountId) } } - private fun attachInitialFragment(accountId: Int) { + private fun attachInitialFragment(accountId: Long) { val fragment = AudioSelectTabsFragment.newInstance(accountId) supportFragmentManager .beginTransaction() @@ -57,7 +57,7 @@ class AudioSelectActivity : NoMainActivity(), PlaceProvider { * @param accountId От чьего имени получать */ - fun createIntent(context: Context, accountId: Int): Intent { + fun createIntent(context: Context, accountId: Long): Intent { return Intent(context, AudioSelectActivity::class.java) .putExtra(Extra.ACCOUNT_ID, accountId) } diff --git a/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/activity/ChatActivity.kt b/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/activity/ChatActivity.kt index 1b78cd932..d1ab8e4df 100644 --- a/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/activity/ChatActivity.kt +++ b/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/activity/ChatActivity.kt @@ -80,7 +80,7 @@ class ChatActivity : NoMainActivity(), PlaceProvider, AppStyleable { Place.CHAT -> { val peer: Peer = args.getParcelableCompat(Extra.PEER) ?: return val chatFragment = - newInstance(args.getInt(Extra.ACCOUNT_ID), args.getInt(Extra.OWNER_ID), peer) + newInstance(args.getLong(Extra.ACCOUNT_ID), args.getLong(Extra.OWNER_ID), peer) attachToFront(chatFragment) } Place.VK_PHOTO_ALBUM_GALLERY, Place.FAVE_PHOTOS_GALLERY, Place.SIMPLE_PHOTO_GALLERY, Place.VK_PHOTO_TMP_SOURCE, Place.VK_PHOTO_ALBUM_GALLERY_SAVED, Place.VK_PHOTO_ALBUM_GALLERY_NATIVE -> newInstance( @@ -108,7 +108,7 @@ class ChatActivity : NoMainActivity(), PlaceProvider, AppStyleable { Place.DOC_PREVIEW -> { val document: Document? = args.getParcelableCompat(Extra.DOC) if (document != null && document.hasValidGifVideoLink()) { - val aid = args.getInt(Extra.ACCOUNT_ID) + val aid = args.getLong(Extra.ACCOUNT_ID) val documents = ArrayList(listOf(document)) val extra = GifPagerActivity.buildArgs(aid, documents, 0) place.launchActivityForResult(this, GifPagerActivity.newInstance(this, extra)) diff --git a/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/activity/ChatActivityBubbles.kt b/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/activity/ChatActivityBubbles.kt index 6bf14e9c3..110bfbf04 100644 --- a/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/activity/ChatActivityBubbles.kt +++ b/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/activity/ChatActivityBubbles.kt @@ -90,7 +90,7 @@ class ChatActivityBubbles : NoMainActivity(), PlaceProvider, AppStyleable { Place.CHAT -> { val peer: Peer = args.getParcelableCompat(Extra.PEER) ?: return val chatFragment = - newInstance(args.getInt(Extra.ACCOUNT_ID), args.getInt(Extra.OWNER_ID), peer) + newInstance(args.getLong(Extra.ACCOUNT_ID), args.getLong(Extra.OWNER_ID), peer) attachToFront(chatFragment) } Place.VK_PHOTO_ALBUM_GALLERY, Place.FAVE_PHOTOS_GALLERY, Place.SIMPLE_PHOTO_GALLERY, Place.VK_PHOTO_TMP_SOURCE, Place.VK_PHOTO_ALBUM_GALLERY_SAVED, Place.VK_PHOTO_ALBUM_GALLERY_NATIVE -> newInstance( @@ -118,7 +118,7 @@ class ChatActivityBubbles : NoMainActivity(), PlaceProvider, AppStyleable { Place.DOC_PREVIEW -> { val document: Document? = args.getParcelableCompat(Extra.DOC) if (document != null && document.hasValidGifVideoLink()) { - val aid = args.getInt(Extra.ACCOUNT_ID) + val aid = args.getLong(Extra.ACCOUNT_ID) val documents = ArrayList(listOf(document)) val extra = GifPagerActivity.buildArgs(aid, documents, 0) place.launchActivityForResult(this, GifPagerActivity.newInstance(this, extra)) @@ -156,8 +156,8 @@ class ChatActivityBubbles : NoMainActivity(), PlaceProvider, AppStyleable { val data = intent if (data != null && data.extras != null) { NotificationHelper.setBubbleOpened( - (data.extras ?: return).getInt(Extra.ACCOUNT_ID), - (data.extras ?: return).getInt(Extra.OWNER_ID) + (data.extras ?: return).getLong(Extra.ACCOUNT_ID), + (data.extras ?: return).getLong(Extra.OWNER_ID) ) } super.onResume() @@ -210,7 +210,7 @@ class ChatActivityBubbles : NoMainActivity(), PlaceProvider, AppStyleable { const val ACTION_OPEN_PLACE = "dev.ragnarok.fenrir.activity.ChatActivityBubbles.openPlace" - fun forStart(context: Context?, accountId: Int, peer: Peer): Intent { + fun forStart(context: Context?, accountId: Long, peer: Peer): Intent { val intent = Intent(context, ChatActivityBubbles::class.java) intent.action = ACTION_OPEN_PLACE intent.putExtra(Extra.PLACE, PlaceFactory.getChatPlace(accountId, accountId, peer)) diff --git a/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/activity/DeltaOwnerActivity.kt b/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/activity/DeltaOwnerActivity.kt index 3248467ae..ca572f27d 100644 --- a/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/activity/DeltaOwnerActivity.kt +++ b/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/activity/DeltaOwnerActivity.kt @@ -97,7 +97,7 @@ class DeltaOwnerActivity : AppCompatActivity(), PlaceProvider, AppStyleable { intent.extras?.getParcelableCompat(Extra.LIST) ?: DeltaOwner() } - val accountId = intent.extras?.getInt(Extra.ACCOUNT_ID, Settings.get().accounts().current) + val accountId = intent.extras?.getLong(Extra.ACCOUNT_ID, Settings.get().accounts().current) ?: Settings.get().accounts().current val Title: TextView = findViewById(R.id.delta_title) @@ -213,7 +213,7 @@ class DeltaOwnerActivity : AppCompatActivity(), PlaceProvider, AppStyleable { val ivRecycler: RecyclerView = view.findViewById(R.id.alert_recycle) } - private inner class Adapter(val DeltaOwner: DeltaOwner, private val accountId: Int) : + private inner class Adapter(val DeltaOwner: DeltaOwner, private val accountId: Long) : RecyclerView.Adapter() { @SuppressLint("ClickableViewAccessibility") override fun onCreateViewHolder(container: ViewGroup, viewType: Int): RecyclerViewHolder { @@ -303,7 +303,7 @@ class DeltaOwnerActivity : AppCompatActivity(), PlaceProvider, AppStyleable { } companion object { - fun showDeltaActivity(context: Context, accountId: Int, delta: DeltaOwner) { + fun showDeltaActivity(context: Context, accountId: Long, delta: DeltaOwner) { if (delta.content.isEmpty()) { return } diff --git a/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/activity/DualTabPhotoActivity.kt b/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/activity/DualTabPhotoActivity.kt index c318a83bd..1b1977bb9 100644 --- a/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/activity/DualTabPhotoActivity.kt +++ b/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/activity/DualTabPhotoActivity.kt @@ -52,8 +52,8 @@ class DualTabPhotoActivity : NoMainActivity(), PlaceProvider { when (place.type) { Place.VK_PHOTO_ALBUM -> { val albumId = args.getInt(Extra.ALBUM_ID) - val accountId = args.getInt(Extra.ACCOUNT_ID) - val ownerId = args.getInt(Extra.OWNER_ID) + val accountId = args.getLong(Extra.ACCOUNT_ID) + val ownerId = args.getLong(Extra.OWNER_ID) val fragment = VKPhotosFragment.newInstance( accountId, ownerId, diff --git a/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/activity/KeyExchangeCommitActivity.kt b/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/activity/KeyExchangeCommitActivity.kt index c94002563..5944737f6 100644 --- a/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/activity/KeyExchangeCommitActivity.kt +++ b/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/activity/KeyExchangeCommitActivity.kt @@ -35,8 +35,8 @@ class KeyExchangeCommitActivity : AppCompatActivity() { setTheme(theme) super.onCreate(savedInstanceState) setContentView(R.layout.activity_key_exchange_commit) - val accountId = (intent.extras ?: return).getInt(Extra.ACCOUNT_ID) - val peerId = (intent.extras ?: return).getInt(Extra.PEER_ID) + val accountId = (intent.extras ?: return).getLong(Extra.ACCOUNT_ID) + val peerId = (intent.extras ?: return).getLong(Extra.PEER_ID) val user: User = intent.getParcelableExtraCompat(Extra.OWNER) ?: return val messageId = (intent.extras ?: return).getInt(Extra.MESSAGE_ID) val message: ExchangeMessage = intent.getParcelableExtraCompat(Extra.MESSAGE) ?: return @@ -79,8 +79,8 @@ class KeyExchangeCommitActivity : AppCompatActivity() { fun createIntent( context: Context, - accountId: Int, - peerId: Int, + accountId: Long, + peerId: Long, user: User, messageId: Int, message: ExchangeMessage diff --git a/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/activity/LocalJsonToChatActivity.kt b/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/activity/LocalJsonToChatActivity.kt index 26114c375..8e1a6aa9f 100644 --- a/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/activity/LocalJsonToChatActivity.kt +++ b/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/activity/LocalJsonToChatActivity.kt @@ -109,7 +109,7 @@ class LocalJsonToChatActivity : NoMainActivity(), PlaceProvider, AppStyleable { Place.DOC_PREVIEW -> { val document: Document? = args.getParcelableCompat(Extra.DOC) if (document != null && document.hasValidGifVideoLink()) { - val aid = args.getInt(Extra.ACCOUNT_ID) + val aid = args.getLong(Extra.ACCOUNT_ID) val documents = ArrayList(listOf(document)) val extra = GifPagerActivity.buildArgs(aid, documents, 0) place.launchActivityForResult(this, GifPagerActivity.newInstance(this, extra)) diff --git a/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/activity/LoginActivity.kt b/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/activity/LoginActivity.kt index f4d31c9e8..f1451d95a 100644 --- a/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/activity/LoginActivity.kt +++ b/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/activity/LoginActivity.kt @@ -144,10 +144,10 @@ class LoginActivity : AppCompatActivity() { context: Context?, clientId: String?, scope: String?, - groupIds: Collection? + groupIds: Collection? ): Intent { - val ids = Utils.join(groupIds, ",", object : Utils.SimpleFunction { - override fun apply(orig: Int): String { + val ids = Utils.join(groupIds, ",", object : Utils.SimpleFunction { + override fun apply(orig: Long): String { return orig.toString() } }) @@ -170,7 +170,7 @@ class LoginActivity : AppCompatActivity() { val groupid = matcher.group(1) val token = matcher.group(2) if (groupid.nonNullNoEmpty() && token.nonNullNoEmpty()) { - tokens.add(Token(-groupid.toInt(), token)) + tokens.add(Token(-groupid.toLong(), token)) } } if (tokens.isEmpty()) { diff --git a/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/activity/MainActivity.kt b/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/activity/MainActivity.kt index d546a4cf0..b0d2895d2 100644 --- a/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/activity/MainActivity.kt +++ b/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/activity/MainActivity.kt @@ -182,7 +182,7 @@ open class MainActivity : AppCompatActivity(), NavigationDrawerCallbacks, OnSect finish() } } - protected var mAccountId = 0 + protected var mAccountId = 0L private val requestEnterPinZero = registerForActivityResult( ActivityResultContracts.StartActivityForResult() ) { result: ActivityResult -> @@ -510,7 +510,7 @@ open class MainActivity : AppCompatActivity(), NavigationDrawerCallbacks, OnSect //CurrentTheme.dumpDynamicColors(this) } - private fun updateNotificationCount(account: Int) { + private fun updateNotificationCount(account: Long) { mCompositeDisposable.add(CountersInteractor(networkInterfaces).getApiCounters(account) .fromIOToMain() .subscribe({ counters -> updateNotificationsBadge(counters) }) { removeNotificationsBadge() }) @@ -689,7 +689,7 @@ open class MainActivity : AppCompatActivity(), NavigationDrawerCallbacks, OnSect ).showToastError(R.string.err_offline) } - private fun onCurrentAccountChange(newAccountId: Int) { + private fun onCurrentAccountChange(newAccountId: Long) { mAccountId = newAccountId navigationView?.onAccountChange(newAccountId) Accounts.showAccountSwitchedToast(this) @@ -710,12 +710,12 @@ open class MainActivity : AppCompatActivity(), NavigationDrawerCallbacks, OnSect return false } if (ACTION_OPEN_WALL == intent.action) { - val owner_id = intent.extras!!.getInt(Extra.OWNER_ID) + val owner_id = intent.extras!!.getLong(Extra.OWNER_ID) PlaceFactory.getOwnerWallPlace(mAccountId, owner_id, null).tryOpenWith(this) return true } if (ACTION_SWITH_ACCOUNT == intent.action) { - val newAccountId = intent.extras!!.getInt(Extra.ACCOUNT_ID) + val newAccountId = intent.extras!!.getLong(Extra.ACCOUNT_ID) if (Settings.get().accounts().current != newAccountId) { Settings.get() .accounts().current = newAccountId @@ -724,8 +724,8 @@ open class MainActivity : AppCompatActivity(), NavigationDrawerCallbacks, OnSect intent.action = ACTION_MAIN } if (ACTION_SHORTCUT_WALL == intent.action) { - val newAccountId = intent.extras!!.getInt(Extra.ACCOUNT_ID) - val ownerId = intent.extras!!.getInt(Extra.OWNER_ID) + val newAccountId = intent.extras!!.getLong(Extra.ACCOUNT_ID) + val ownerId = intent.extras!!.getLong(Extra.OWNER_ID) if (Settings.get().accounts().current != newAccountId) { Settings.get() .accounts().current = newAccountId @@ -794,7 +794,7 @@ open class MainActivity : AppCompatActivity(), NavigationDrawerCallbacks, OnSect return false } if (ACTION_CHAT_FROM_SHORTCUT == action) { - val aid = intent.extras!!.getInt(Extra.ACCOUNT_ID) + val aid = intent.extras!!.getLong(Extra.ACCOUNT_ID) val prefsAid = Settings.get() .accounts() .current @@ -802,7 +802,7 @@ open class MainActivity : AppCompatActivity(), NavigationDrawerCallbacks, OnSect Settings.get() .accounts().current = aid } - val peerId = intent.extras!!.getInt(Extra.PEER_ID) + val peerId = intent.extras!!.getLong(Extra.PEER_ID) val title = intent.getStringExtra(Extra.TITLE) val imgUrl = intent.getStringExtra(Extra.IMAGE) val peer = Peer(peerId).setTitle(title).setAvaUrl(imgUrl) @@ -848,7 +848,7 @@ open class MainActivity : AppCompatActivity(), NavigationDrawerCallbacks, OnSect resolveToolbarNavigationIcon() } - private fun openChat(accountId: Int, messagesOwnerId: Int, peer: Peer, closeMain: Boolean) { + private fun openChat(accountId: Long, messagesOwnerId: Long, peer: Peer, closeMain: Boolean) { if (Settings.get().other().isEnable_show_recent_dialogs) { val recentChat = RecentChat(accountId, peer.id, peer.getTitle(), peer.avaUrl) navigationView?.appendRecentChat(recentChat) @@ -1128,7 +1128,7 @@ open class MainActivity : AppCompatActivity(), NavigationDrawerCallbacks, OnSect mCurrentFrontSection = sectionDrawerItem } - override fun onChatResume(accountId: Int, peerId: Int, title: String?, imgUrl: String?) { + override fun onChatResume(accountId: Long, peerId: Long, title: String?, imgUrl: String?) { if (Settings.get().other().isEnable_show_recent_dialogs) { val recentChat = RecentChat(accountId, peerId, title, imgUrl) navigationView?.appendRecentChat(recentChat) @@ -1242,7 +1242,7 @@ open class MainActivity : AppCompatActivity(), NavigationDrawerCallbacks, OnSect Place.DOC_PREVIEW -> { val document: Document? = args.getParcelableCompat(Extra.DOC) if (document != null && document.hasValidGifVideoLink()) { - val aid = args.getInt(Extra.ACCOUNT_ID) + val aid = args.getLong(Extra.ACCOUNT_ID) val documents = ArrayList(listOf(document)) val extra = GifPagerActivity.buildArgs(aid, documents, 0) place.launchActivityForResult(this, GifPagerActivity.newInstance(this, extra)) @@ -1266,8 +1266,8 @@ open class MainActivity : AppCompatActivity(), NavigationDrawerCallbacks, OnSect Place.CHAT -> { val peer: Peer = args.getParcelableCompat(Extra.PEER) ?: return openChat( - args.getInt(Extra.ACCOUNT_ID), - args.getInt(Extra.OWNER_ID), + args.getLong(Extra.ACCOUNT_ID), + args.getLong(Extra.OWNER_ID), peer, place.isNeedFinishMain ) @@ -1281,7 +1281,7 @@ open class MainActivity : AppCompatActivity(), NavigationDrawerCallbacks, OnSect } Place.EDIT_COMMENT -> { val comment: Comment? = args.getParcelableCompat(Extra.COMMENT) - val accountId = args.getInt(Extra.ACCOUNT_ID) + val accountId = args.getLong(Extra.ACCOUNT_ID) val commemtId = args.getInt(Extra.COMMENT_ID) val commentEditFragment = CommentEditFragment.newInstance(accountId, comment, commemtId) @@ -1298,8 +1298,8 @@ open class MainActivity : AppCompatActivity(), NavigationDrawerCallbacks, OnSect } Place.DIALOGS -> attachToFront( DialogsFragment.newInstance( - args.getInt(Extra.ACCOUNT_ID), - args.getInt(Extra.OWNER_ID), + args.getLong(Extra.ACCOUNT_ID), + args.getLong(Extra.OWNER_ID), args.getString(Extra.SUBTITLE) ) ) @@ -1310,23 +1310,23 @@ open class MainActivity : AppCompatActivity(), NavigationDrawerCallbacks, OnSect Place.REMOTE_FILE_MANAGER -> attachToFront(FileManagerRemoteFragment()) Place.COMMUNITIES -> { val communitiesFragment = CommunitiesFragment.newInstance( - args.getInt(Extra.ACCOUNT_ID), - args.getInt(Extra.USER_ID) + args.getLong(Extra.ACCOUNT_ID), + args.getLong(Extra.USER_ID) ) attachToFront(communitiesFragment) } Place.AUDIOS -> attachToFront( if (Settings.get().other().isAudio_catalog_v2) CatalogV2ListFragment.newInstance( - args.getInt(Extra.ACCOUNT_ID), - args.getInt(Extra.OWNER_ID) + args.getLong(Extra.ACCOUNT_ID), + args.getLong(Extra.OWNER_ID) ) else AudiosTabsFragment.newInstance( - args.getInt(Extra.ACCOUNT_ID), - args.getInt(Extra.OWNER_ID) + args.getLong(Extra.ACCOUNT_ID), + args.getLong(Extra.OWNER_ID) ) ) Place.MENTIONS -> attachToFront( NewsfeedMentionsFragment.newInstance( - args.getInt(Extra.ACCOUNT_ID), args.getInt( + args.getLong(Extra.ACCOUNT_ID), args.getLong( Extra.OWNER_ID ) ) @@ -1340,14 +1340,14 @@ open class MainActivity : AppCompatActivity(), NavigationDrawerCallbacks, OnSect Place.AUDIOS_IN_ALBUM -> attachToFront(AudiosFragment.newInstance(args)) Place.SEARCH_BY_AUDIO -> attachToFront( AudiosRecommendationFragment.newInstance( - args.getInt( + args.getLong( Extra.ACCOUNT_ID - ), args.getInt(Extra.OWNER_ID), false, args.getInt(Extra.ID) + ), args.getLong(Extra.OWNER_ID), false, args.getInt(Extra.ID) ) ) Place.LOCAL_SERVER_PHOTO -> attachToFront( PhotosLocalServerFragment.newInstance( - args.getInt( + args.getLong( Extra.ACCOUNT_ID ) ) @@ -1356,8 +1356,8 @@ open class MainActivity : AppCompatActivity(), NavigationDrawerCallbacks, OnSect Place.VIDEOS -> attachToFront(VideosTabsFragment.newInstance(args)) Place.VK_PHOTO_ALBUMS -> attachToFront( VKPhotoAlbumsFragment.newInstance( - args.getInt(Extra.ACCOUNT_ID), - args.getInt(Extra.OWNER_ID), + args.getLong(Extra.ACCOUNT_ID), + args.getLong(Extra.OWNER_ID), args.getString(Extra.ACTION), args.getParcelableCompat(Extra.OWNER), false ) @@ -1439,7 +1439,7 @@ open class MainActivity : AppCompatActivity(), NavigationDrawerCallbacks, OnSect } Place.NEWSFEED_COMMENTS -> { val newsfeedCommentsFragment = NewsfeedCommentsFragment.newInstance( - args.getInt( + args.getLong( Extra.ACCOUNT_ID ) ) @@ -1447,7 +1447,7 @@ open class MainActivity : AppCompatActivity(), NavigationDrawerCallbacks, OnSect } Place.COMMUNITY_CONTROL -> { val communityControlFragment = CommunityControlFragment.newInstance( - args.getInt(Extra.ACCOUNT_ID), + args.getLong(Extra.ACCOUNT_ID), args.getParcelableCompat(Extra.OWNER), args.getParcelableCompat(Extra.SETTINGS) ) @@ -1455,14 +1455,14 @@ open class MainActivity : AppCompatActivity(), NavigationDrawerCallbacks, OnSect } Place.COMMUNITY_INFO -> { val communityInfoFragment = CommunityInfoContactsFragment.newInstance( - args.getInt(Extra.ACCOUNT_ID), + args.getLong(Extra.ACCOUNT_ID), args.getParcelableCompat(Extra.OWNER) ) attachToFront(communityInfoFragment) } Place.COMMUNITY_INFO_LINKS -> { val communityLinksFragment = CommunityInfoLinksFragment.newInstance( - args.getInt(Extra.ACCOUNT_ID), + args.getLong(Extra.ACCOUNT_ID), args.getParcelableCompat(Extra.OWNER) ) attachToFront(communityLinksFragment) @@ -1477,41 +1477,41 @@ open class MainActivity : AppCompatActivity(), NavigationDrawerCallbacks, OnSect } Place.COMMUNITY_BAN_EDIT -> { val communityBanEditFragment = CommunityBanEditFragment.newInstance( - args.getInt(Extra.ACCOUNT_ID), - args.getInt(Extra.GROUP_ID), + args.getLong(Extra.ACCOUNT_ID), + args.getLong(Extra.GROUP_ID), args.getParcelableCompat(Extra.BANNED) ) attachToFront(communityBanEditFragment) } Place.COMMUNITY_ADD_BAN -> attachToFront( CommunityBanEditFragment.newInstance( - args.getInt(Extra.ACCOUNT_ID), - args.getInt(Extra.GROUP_ID), + args.getLong(Extra.ACCOUNT_ID), + args.getLong(Extra.GROUP_ID), args.getParcelableArrayListCompat(Extra.USERS) ) ) Place.COMMUNITY_MANAGER_ADD -> attachToFront( CommunityManagerEditFragment.newInstance( - args.getInt(Extra.ACCOUNT_ID), - args.getInt(Extra.GROUP_ID), + args.getLong(Extra.ACCOUNT_ID), + args.getLong(Extra.GROUP_ID), args.getParcelableArrayListCompat(Extra.USERS) ) ) Place.COMMUNITY_MANAGER_EDIT -> attachToFront( CommunityManagerEditFragment.newInstance( - args.getInt(Extra.ACCOUNT_ID), - args.getInt(Extra.GROUP_ID), + args.getLong(Extra.ACCOUNT_ID), + args.getLong(Extra.GROUP_ID), args.getParcelableCompat(Extra.MANAGER) ) ) Place.REQUEST_EXECUTOR -> attachToFront( RequestExecuteFragment.newInstance( - args.getInt( + args.getLong( Extra.ACCOUNT_ID ) ) ) - Place.USER_BLACKLIST -> attachToFront(UserBannedFragment.newInstance(args.getInt(Extra.ACCOUNT_ID))) + Place.USER_BLACKLIST -> attachToFront(UserBannedFragment.newInstance(args.getLong(Extra.ACCOUNT_ID))) Place.FRIENDS_BIRTHDAYS -> attachToFront(BirthDayFragment.newInstance(args)) Place.DRAWER_EDIT -> attachToFront(DrawerEditFragment.newInstance()) Place.SIDE_DRAWER_EDIT -> attachToFront(SideDrawerEditFragment.newInstance()) @@ -1519,33 +1519,33 @@ open class MainActivity : AppCompatActivity(), NavigationDrawerCallbacks, OnSect Place.ARTIST -> { attachToFront(AudiosByArtistFragment.newInstance(args)) } - Place.SHORT_LINKS -> attachToFront(ShortedLinksFragment.newInstance(args.getInt(Extra.ACCOUNT_ID))) + Place.SHORT_LINKS -> attachToFront(ShortedLinksFragment.newInstance(args.getLong(Extra.ACCOUNT_ID))) Place.SHORTCUTS -> attachToFront(ShortcutsViewFragment()) Place.IMPORTANT_MESSAGES -> attachToFront( ImportantMessagesFragment.newInstance( - args.getInt( + args.getLong( Extra.ACCOUNT_ID ) ) ) Place.OWNER_ARTICLES -> attachToFront( OwnerArticlesFragment.newInstance( - args.getInt( + args.getLong( Extra.ACCOUNT_ID - ), args.getInt(Extra.OWNER_ID) + ), args.getLong(Extra.OWNER_ID) ) ) Place.USER_DETAILS -> { - val accountId = args.getInt(Extra.ACCOUNT_ID) + val accountId = args.getLong(Extra.ACCOUNT_ID) val user: User = args.getParcelableCompat(Extra.USER) ?: return val details: UserDetails = args.getParcelableCompat("details") ?: return attachToFront(newInstance(accountId, user, details)) } Place.WALL_ATTACHMENTS -> { val wall_attachments = WallAttachmentsFragmentFactory.newInstance( - args.getInt(Extra.ACCOUNT_ID), - args.getInt(Extra.OWNER_ID), + args.getLong(Extra.ACCOUNT_ID), + args.getLong(Extra.OWNER_ID), args.getString(Extra.TYPE) ) ?: throw IllegalArgumentException("wall_attachments cant bee null") @@ -1553,34 +1553,34 @@ open class MainActivity : AppCompatActivity(), NavigationDrawerCallbacks, OnSect } Place.MARKET_ALBUMS -> attachToFront( ProductAlbumsFragment.newInstance( - args.getInt(Extra.ACCOUNT_ID), - args.getInt(Extra.OWNER_ID) + args.getLong(Extra.ACCOUNT_ID), + args.getLong(Extra.OWNER_ID) ) ) Place.NARRATIVES -> attachToFront( NarrativesFragment.newInstance( - args.getInt(Extra.ACCOUNT_ID), - args.getInt(Extra.OWNER_ID) + args.getLong(Extra.ACCOUNT_ID), + args.getLong(Extra.OWNER_ID) ) ) Place.MARKETS -> attachToFront( ProductsFragment.newInstance( - args.getInt(Extra.ACCOUNT_ID), - args.getInt(Extra.OWNER_ID), + args.getLong(Extra.ACCOUNT_ID), + args.getLong(Extra.OWNER_ID), args.getInt(Extra.ALBUM_ID), args.getBoolean(Extra.SERVICE) ) ) Place.PHOTO_ALL_COMMENT -> attachToFront( PhotoAllCommentFragment.newInstance( - args.getInt(Extra.ACCOUNT_ID), - args.getInt(Extra.OWNER_ID) + args.getLong(Extra.ACCOUNT_ID), + args.getLong(Extra.OWNER_ID) ) ) Place.GIFTS -> attachToFront( GiftsFragment.newInstance( - args.getInt(Extra.ACCOUNT_ID), - args.getInt(Extra.OWNER_ID) + args.getLong(Extra.ACCOUNT_ID), + args.getLong(Extra.OWNER_ID) ) ) Place.MARKET_VIEW -> attachToFront(MarketViewFragment.newInstance(args)) @@ -1594,9 +1594,9 @@ open class MainActivity : AppCompatActivity(), NavigationDrawerCallbacks, OnSect private fun openCommentCreatePlace(place: Place) { val args = place.safeArguments() val fragment = CommentCreateFragment.newInstance( - args.getInt(Extra.ACCOUNT_ID), + args.getLong(Extra.ACCOUNT_ID), args.getInt(Extra.COMMENT_ID), - args.getInt(Extra.OWNER_ID), + args.getLong(Extra.OWNER_ID), args.getString(Extra.BODY) ) place.applyFragmentListener(fragment, supportFragmentManager) diff --git a/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/activity/NotReadMessagesActivity.kt b/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/activity/NotReadMessagesActivity.kt index faae6ad75..88197d54d 100644 --- a/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/activity/NotReadMessagesActivity.kt +++ b/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/activity/NotReadMessagesActivity.kt @@ -94,7 +94,7 @@ class NotReadMessagesActivity : NoMainActivity(), PlaceProvider, AppStyleable { Place.CHAT -> { val peer: Peer = args.getParcelableCompat(Extra.PEER) ?: return val chatFragment = - newInstance(args.getInt(Extra.ACCOUNT_ID), args.getInt(Extra.OWNER_ID), peer) + newInstance(args.getLong(Extra.ACCOUNT_ID), args.getLong(Extra.OWNER_ID), peer) attachToFront(chatFragment) } Place.UNREAD_MESSAGES -> attachToFront(NotReadMessagesFragment.newInstance(args)) @@ -123,7 +123,7 @@ class NotReadMessagesActivity : NoMainActivity(), PlaceProvider, AppStyleable { Place.DOC_PREVIEW -> { val document: Document? = args.getParcelableCompat(Extra.DOC) if (document != null && document.hasValidGifVideoLink()) { - val aid = args.getInt(Extra.ACCOUNT_ID) + val aid = args.getLong(Extra.ACCOUNT_ID) val documents = ArrayList(listOf(document)) val extra = GifPagerActivity.buildArgs(aid, documents, 0) place.launchActivityForResult(this, GifPagerActivity.newInstance(this, extra)) diff --git a/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/activity/PhotoAlbumsActivity.kt b/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/activity/PhotoAlbumsActivity.kt index dac715ee9..73f2594df 100644 --- a/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/activity/PhotoAlbumsActivity.kt +++ b/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/activity/PhotoAlbumsActivity.kt @@ -13,8 +13,8 @@ class PhotoAlbumsActivity : NoMainActivity(), PlaceProvider { super.onCreate(savedInstanceState) if (savedInstanceState == null) { val intent = intent - val accountId = (intent.extras ?: return).getInt(Extra.ACCOUNT_ID) - val ownerId = (intent.extras ?: return).getInt(Extra.OWNER_ID) + val accountId = (intent.extras ?: return).getLong(Extra.ACCOUNT_ID) + val ownerId = (intent.extras ?: return).getLong(Extra.OWNER_ID) val action = intent.getStringExtra(Extra.ACTION) val fragment = VKPhotoAlbumsFragment.newInstance(accountId, ownerId, action, null, false) diff --git a/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/activity/PostCreateActivity.kt b/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/activity/PostCreateActivity.kt index 618323bad..1216b027c 100644 --- a/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/activity/PostCreateActivity.kt +++ b/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/activity/PostCreateActivity.kt @@ -16,7 +16,7 @@ class PostCreateActivity : NoMainActivity() { override fun onCreate(savedInstanceState: Bundle?) { super.onCreate(savedInstanceState) if (savedInstanceState == null) { - val accountId = (intent.extras ?: return).getInt(Extra.ACCOUNT_ID) + val accountId = (intent.extras ?: return).getLong(Extra.ACCOUNT_ID) val streams = intent.getParcelableArrayListExtraCompat("streams") val attrs: WallEditorAttrs = intent.getParcelableExtraCompat("attrs") ?: return val links = intent.getStringExtra("links") @@ -45,7 +45,7 @@ class PostCreateActivity : NoMainActivity() { fun newIntent( context: Context, - accountId: Int, + accountId: Long, attrs: WallEditorAttrs, streams: ArrayList?, links: String?, diff --git a/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/activity/PostPublishPrepareActivity.kt b/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/activity/PostPublishPrepareActivity.kt index a5751b1dd..7b9b638b0 100644 --- a/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/activity/PostPublishPrepareActivity.kt +++ b/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/activity/PostPublishPrepareActivity.kt @@ -34,7 +34,7 @@ class PostPublishPrepareActivity : AppCompatActivity(), RecyclerMenuAdapter.Acti private var streams: StreamData? = null private var links: String? = null private var mime: String? = null - private var accountId = 0 + private var accountId = 0L private var loading = false override fun attachBaseContext(newBase: Context) { super.attachBaseContext(Utils.updateActivityContext(newBase)) diff --git a/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/activity/QuickAnswerActivity.kt b/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/activity/QuickAnswerActivity.kt index 0ff52df8d..5d06a044a 100644 --- a/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/activity/QuickAnswerActivity.kt +++ b/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/activity/QuickAnswerActivity.kt @@ -59,7 +59,7 @@ class QuickAnswerActivity : AppCompatActivity() { } private var etText: TextInputEditText? = null private var notifier: TextingNotifier? = null - private var accountId = 0 + private var accountId = 0L private lateinit var msg: Message private var messageIsRead = false private var messagesRepository: IMessagesRepository = messages @@ -81,7 +81,7 @@ class QuickAnswerActivity : AppCompatActivity() { window.setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_STATE_HIDDEN) } msg = (intent.extras?.getParcelableCompat(Extra.MESSAGE) ?: return) - accountId = (intent.extras ?: return).getInt(Extra.ACCOUNT_ID) + accountId = (intent.extras ?: return).getLong(Extra.ACCOUNT_ID) notifier = TextingNotifier(accountId) setContentView(R.layout.activity_quick_answer) val toolbar = findViewById(R.id.toolbar) @@ -154,7 +154,7 @@ class QuickAnswerActivity : AppCompatActivity() { } override fun onForwardMessagesOpen(messages: ArrayList) {} - override fun onOpenOwner(ownerId: Int) {} + override fun onOpenOwner(ownerId: Long) {} override fun onGoToMessagesLookup(message: Message) {} override fun onDocPreviewOpen(document: Document) {} override fun onPostOpen(post: Post) {} @@ -194,7 +194,7 @@ class QuickAnswerActivity : AppCompatActivity() { voiceHolderId: Int, voiceMessageId: Int, messageId: Int, - peerId: Int, + peerId: Long, voiceMessage: VoiceMessage ) { val audio = @@ -335,7 +335,7 @@ class QuickAnswerActivity : AppCompatActivity() { fun forStart( context: Context?, - accountId: Int, + accountId: Long, msg: Message?, body: String?, imgUrl: String?, diff --git a/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/activity/SendAttachmentsActivity.kt b/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/activity/SendAttachmentsActivity.kt index ca5913fd3..0331655f8 100644 --- a/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/activity/SendAttachmentsActivity.kt +++ b/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/activity/SendAttachmentsActivity.kt @@ -33,7 +33,7 @@ class SendAttachmentsActivity : MainActivity() { } companion object { - fun startForSendAttachments(context: Context, accountId: Int, bundle: ModelsBundle?) { + fun startForSendAttachments(context: Context, accountId: Long, bundle: ModelsBundle?) { val intent = Intent(context, SendAttachmentsActivity::class.java) intent.action = ACTION_SEND_ATTACHMENTS intent.putExtra(EXTRA_INPUT_ATTACHMENTS, bundle) @@ -44,7 +44,7 @@ class SendAttachmentsActivity : MainActivity() { fun startForSendAttachmentsFor( context: Context, - accountId: Int, + accountId: Long, peer: Peer, bundle: ModelsBundle? ) { @@ -63,14 +63,14 @@ class SendAttachmentsActivity : MainActivity() { } - fun startForSendAttachments(context: Context, accountId: Int, model: AbsModel) { + fun startForSendAttachments(context: Context, accountId: Long, model: AbsModel) { startForSendAttachments(context, accountId, ModelsBundle(1).append(model)) } fun startForSendAttachmentsFor( context: Context, - accountId: Int, + accountId: Long, peer: Peer, model: AbsModel ) { diff --git a/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/activity/ValidateActivity.kt b/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/activity/ValidateActivity.kt index 59aa6f1c3..6c811d110 100644 --- a/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/activity/ValidateActivity.kt +++ b/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/activity/ValidateActivity.kt @@ -131,7 +131,7 @@ class ValidateActivity : AppCompatActivity() { val accessToken = tryExtractAccessToken(url) val userId = tryExtractUserId(url) if (accessToken.nonNullNoEmpty() || userId.nonNullNoEmpty()) { - userId?.toInt() + userId?.toLong() ?.let { Settings.get().accounts().storeAccessToken(it, accessToken) } diff --git a/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/activity/VideoSelectActivity.kt b/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/activity/VideoSelectActivity.kt index 0c7773db5..32c929dd0 100644 --- a/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/activity/VideoSelectActivity.kt +++ b/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/activity/VideoSelectActivity.kt @@ -19,13 +19,13 @@ class VideoSelectActivity : NoMainActivity(), PlaceProvider { override fun onCreate(savedInstanceState: Bundle?) { super.onCreate(savedInstanceState) if (savedInstanceState == null) { - val accountId = (intent.extras ?: return).getInt(Extra.ACCOUNT_ID) - val ownerId = (intent.extras ?: return).getInt(Extra.OWNER_ID) + val accountId = (intent.extras ?: return).getLong(Extra.ACCOUNT_ID) + val ownerId = (intent.extras ?: return).getLong(Extra.OWNER_ID) attachInitialFragment(accountId, ownerId) } } - private fun attachInitialFragment(accountId: Int, ownerId: Int) { + private fun attachInitialFragment(accountId: Long, ownerId: Long) { val fragment = VideosTabsFragment.newInstance(accountId, ownerId, IVideosListView.ACTION_SELECT) supportFragmentManager @@ -78,7 +78,7 @@ class VideoSelectActivity : NoMainActivity(), PlaceProvider { * @param ownerId Чьи получать */ - fun createIntent(context: Context, accountId: Int, ownerId: Int): Intent { + fun createIntent(context: Context, accountId: Long, ownerId: Long): Intent { return Intent(context, VideoSelectActivity::class.java) .putExtra(Extra.ACCOUNT_ID, accountId) .putExtra(Extra.OWNER_ID, ownerId) diff --git a/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/activity/gifpager/GifPagerActivity.kt b/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/activity/gifpager/GifPagerActivity.kt index 88293b905..82b807d0a 100644 --- a/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/activity/gifpager/GifPagerActivity.kt +++ b/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/activity/gifpager/GifPagerActivity.kt @@ -222,7 +222,7 @@ class GifPagerActivity : AbsDocumentPreviewActivity { return object : IPresenterFactory { override fun create(): GifPagerPresenter { - val aid = requireArguments().getInt(Extra.ACCOUNT_ID) + val aid = requireArguments().getLong(Extra.ACCOUNT_ID) val index = requireArguments().getInt(Extra.INDEX) val documents: ArrayList = requireArguments().getParcelableArrayListCompat(Extra.DOCS)!! @@ -314,9 +314,9 @@ class GifPagerActivity : AbsDocumentPreviewActivity, index: Int): Bundle { + fun buildArgs(aid: Long, documents: ArrayList, index: Int): Bundle { val args = Bundle() - args.putInt(Extra.ACCOUNT_ID, aid) + args.getLong(Extra.ACCOUNT_ID, aid) args.putInt(Extra.INDEX, index) args.putParcelableArrayList(Extra.DOCS, documents) return args diff --git a/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/activity/gifpager/GifPagerPresenter.kt b/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/activity/gifpager/GifPagerPresenter.kt index 2c822a92a..4363ecbf8 100644 --- a/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/activity/gifpager/GifPagerPresenter.kt +++ b/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/activity/gifpager/GifPagerPresenter.kt @@ -12,7 +12,7 @@ import dev.ragnarok.fenrir.util.DownloadWorkUtils.doDownloadDoc import dev.ragnarok.fenrir.util.toast.CustomSnackbars class GifPagerPresenter( - accountId: Int, + accountId: Long, private val mDocuments: ArrayList, private var mCurrentIndex: Int, savedInstanceState: Bundle? diff --git a/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/activity/photopager/FavePhotoPagerPresenter.kt b/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/activity/photopager/FavePhotoPagerPresenter.kt index dd4afa623..d2bd72b1a 100644 --- a/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/activity/photopager/FavePhotoPagerPresenter.kt +++ b/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/activity/photopager/FavePhotoPagerPresenter.kt @@ -10,7 +10,7 @@ import dev.ragnarok.fenrir.util.Utils class FavePhotoPagerPresenter( photos: ArrayList, index: Int, - accountId: Int, + accountId: Long, context: Context, savedInstanceState: Bundle? ) : PhotoPagerPresenter(photos, accountId, false, context, savedInstanceState) { diff --git a/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/activity/photopager/IPhotoPagerView.kt b/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/activity/photopager/IPhotoPagerView.kt index 0e440a799..2d8704e8a 100644 --- a/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/activity/photopager/IPhotoPagerView.kt +++ b/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/activity/photopager/IPhotoPagerView.kt @@ -7,7 +7,7 @@ import dev.ragnarok.fenrir.model.Commented import dev.ragnarok.fenrir.model.Photo interface IPhotoPagerView : IMvpView, IErrorView, IToastView { - fun goToLikesList(accountId: Int, ownerId: Int, photoId: Int) + fun goToLikesList(accountId: Long, ownerId: Long, photoId: Int) fun setupLikeButton(visible: Boolean, like: Boolean, likes: Int) fun setupWithUserButton(users: Int) fun setupShareButton(visible: Boolean, reposts: Int) @@ -15,12 +15,12 @@ interface IPhotoPagerView : IMvpView, IErrorView, IToastView { fun displayPhotos(photos: List, initialIndex: Int) fun setToolbarTitle(title: String?) fun setToolbarSubtitle(subtitle: String?) - fun sharePhoto(accountId: Int, photo: Photo) - fun postToMyWall(photo: Photo, accountId: Int) + fun sharePhoto(accountId: Long, photo: Photo) + fun postToMyWall(photo: Photo, accountId: Long) fun requestWriteToExternalStoragePermission() fun setButtonRestoreVisible(visible: Boolean) fun setupOptionMenu(canSaveYourself: Boolean, canDelete: Boolean) - fun goToComments(accountId: Int, commented: Commented) + fun goToComments(accountId: Long, commented: Commented) fun displayPhotoListLoading(loading: Boolean) fun setButtonsBarVisible(visible: Boolean) fun setToolbarVisible(visible: Boolean) diff --git a/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/activity/photopager/PhotoAlbumPagerPresenter.kt b/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/activity/photopager/PhotoAlbumPagerPresenter.kt index 53d201ef8..d78f1399d 100644 --- a/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/activity/photopager/PhotoAlbumPagerPresenter.kt +++ b/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/activity/photopager/PhotoAlbumPagerPresenter.kt @@ -18,15 +18,15 @@ import dev.ragnarok.fenrir.util.Utils class PhotoAlbumPagerPresenter : PhotoPagerPresenter { private val localServerInteractor: ILocalServerInteractor - private val mOwnerId: Int + private val mOwnerId: Long private val mAlbumId: Int private val invertPhotoRev: Boolean private var canLoad: Boolean constructor( index: Int, - accountId: Int, - ownerId: Int, + accountId: Long, + ownerId: Long, albumId: Int, photos: ArrayList, readOnly: Boolean, @@ -49,8 +49,8 @@ class PhotoAlbumPagerPresenter : PhotoPagerPresenter { constructor( index: Int, - accountId: Int, - ownerId: Int, + accountId: Long, + ownerId: Long, albumId: Int, source: TmpSource, readOnly: Boolean, diff --git a/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/activity/photopager/PhotoPagerActivity.kt b/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/activity/photopager/PhotoPagerActivity.kt index 0a5874c42..3ede2ec53 100644 --- a/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/activity/photopager/PhotoPagerActivity.kt +++ b/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/activity/photopager/PhotoPagerActivity.kt @@ -73,11 +73,11 @@ class PhotoPagerActivity : BaseMvpActivity "dev.ragnarok.fenrir.activity.photopager.PhotoPagerActivity" fun buildArgsForSimpleGallery( - aid: Int, index: Int, photos: ArrayList, + aid: Long, index: Int, photos: ArrayList, needUpdate: Boolean ): Bundle { val args = Bundle() - args.putInt(Extra.ACCOUNT_ID, aid) + args.putLong(Extra.ACCOUNT_ID, aid) args.putParcelableArrayList(EXTRA_PHOTOS, photos) args.putInt(Extra.INDEX, index) args.putBoolean(EXTRA_NEED_UPDATE, needUpdate) @@ -85,17 +85,17 @@ class PhotoPagerActivity : BaseMvpActivity } fun buildArgsForAlbum( - aid: Int, + aid: Long, albumId: Int, - ownerId: Int, + ownerId: Long, source: TmpSource, position: Int, readOnly: Boolean, invert: Boolean ): Bundle { val args = Bundle() - args.putInt(Extra.ACCOUNT_ID, aid) - args.putInt(Extra.OWNER_ID, ownerId) + args.putLong(Extra.ACCOUNT_ID, aid) + args.putLong(Extra.OWNER_ID, ownerId) args.putInt(Extra.ALBUM_ID, albumId) args.putInt(Extra.INDEX, position) args.putBoolean(Extra.READONLY, readOnly) @@ -105,17 +105,17 @@ class PhotoPagerActivity : BaseMvpActivity } fun buildArgsForAlbum( - aid: Int, + aid: Long, albumId: Int, - ownerId: Int, + ownerId: Long, photos: ArrayList, position: Int, readOnly: Boolean, invert: Boolean ): Bundle { val args = Bundle() - args.putInt(Extra.ACCOUNT_ID, aid) - args.putInt(Extra.OWNER_ID, ownerId) + args.putLong(Extra.ACCOUNT_ID, aid) + args.putLong(Extra.OWNER_ID, ownerId) args.putInt(Extra.ALBUM_ID, albumId) args.putInt(Extra.INDEX, position) args.putBoolean(Extra.READONLY, readOnly) @@ -132,17 +132,17 @@ class PhotoPagerActivity : BaseMvpActivity } fun buildArgsForAlbum( - aid: Int, + aid: Long, albumId: Int, - ownerId: Int, + ownerId: Long, parcelNativePointer: Long, position: Int, readOnly: Boolean, invert: Boolean ): Bundle { val args = Bundle() - args.putInt(Extra.ACCOUNT_ID, aid) - args.putInt(Extra.OWNER_ID, ownerId) + args.putLong(Extra.ACCOUNT_ID, aid) + args.putLong(Extra.OWNER_ID, ownerId) args.putInt(Extra.ALBUM_ID, albumId) args.putInt(Extra.INDEX, position) args.putBoolean(Extra.READONLY, readOnly) @@ -151,9 +151,9 @@ class PhotoPagerActivity : BaseMvpActivity return args } - fun buildArgsForFave(aid: Int, photos: ArrayList, index: Int): Bundle { + fun buildArgsForFave(aid: Long, photos: ArrayList, index: Int): Bundle { val args = Bundle() - args.putInt(Extra.ACCOUNT_ID, aid) + args.putLong(Extra.ACCOUNT_ID, aid) args.putParcelableArrayList(EXTRA_PHOTOS, photos) args.putInt(Extra.INDEX, index) return args @@ -382,7 +382,7 @@ class PhotoPagerActivity : BaseMvpActivity return false } - override fun goToLikesList(accountId: Int, ownerId: Int, photoId: Int) { + override fun goToLikesList(accountId: Long, ownerId: Long, photoId: Int) { PlaceFactory.getLikesCopiesPlace( accountId, "photo", @@ -429,7 +429,7 @@ class PhotoPagerActivity : BaseMvpActivity object : IPresenterFactory { override fun create(): PhotoPagerPresenter { val placeType = requireArguments().getInt(Extra.PLACE_TYPE) - val aid = requireArguments().getInt(Extra.ACCOUNT_ID) + val aid = requireArguments().getLong(Extra.ACCOUNT_ID) when (placeType) { Place.SIMPLE_PHOTO_GALLERY -> { val index = requireArguments().getInt(Extra.INDEX) @@ -447,7 +447,7 @@ class PhotoPagerActivity : BaseMvpActivity } Place.VK_PHOTO_ALBUM_GALLERY_SAVED -> { val indexx = requireArguments().getInt(Extra.INDEX) - val ownerId = requireArguments().getInt(Extra.OWNER_ID) + val ownerId = requireArguments().getLong(Extra.OWNER_ID) val albumId = requireArguments().getInt(Extra.ALBUM_ID) val readOnly = requireArguments().getBoolean(Extra.READONLY) val invert = requireArguments().getBoolean(Extra.INVERT) @@ -467,7 +467,7 @@ class PhotoPagerActivity : BaseMvpActivity } Place.VK_PHOTO_ALBUM_GALLERY, Place.VK_PHOTO_ALBUM_GALLERY_NATIVE -> { val indexx = requireArguments().getInt(Extra.INDEX) - val ownerId = requireArguments().getInt(Extra.OWNER_ID) + val ownerId = requireArguments().getLong(Extra.OWNER_ID) val albumId = requireArguments().getInt(Extra.ALBUM_ID) val readOnly = requireArguments().getBoolean(Extra.READONLY) val invert = requireArguments().getBoolean(Extra.INVERT) @@ -576,7 +576,7 @@ class PhotoPagerActivity : BaseMvpActivity mViewPager?.setCurrentItem(initialIndex, false) } - override fun sharePhoto(accountId: Int, photo: Photo) { + override fun sharePhoto(accountId: Long, photo: Photo) { val items = arrayOf( getString(R.string.share_link), getString(R.string.repost_send_message), @@ -599,7 +599,7 @@ class PhotoPagerActivity : BaseMvpActivity .show() } - override fun postToMyWall(photo: Photo, accountId: Int) { + override fun postToMyWall(photo: Photo, accountId: Long) { PlaceUtil.goToPostCreation( this, accountId, @@ -623,7 +623,7 @@ class PhotoPagerActivity : BaseMvpActivity this.invalidateOptionsMenu() } - override fun goToComments(accountId: Int, commented: Commented) { + override fun goToComments(accountId: Long, commented: Commented) { PlaceFactory.getCommentsPlace(accountId, commented, null).tryOpenWith(this) } diff --git a/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/activity/photopager/PhotoPagerPresenter.kt b/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/activity/photopager/PhotoPagerPresenter.kt index 913b04569..f9a3f4ce2 100644 --- a/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/activity/photopager/PhotoPagerPresenter.kt +++ b/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/activity/photopager/PhotoPagerPresenter.kt @@ -47,7 +47,7 @@ import kotlin.math.abs open class PhotoPagerPresenter internal constructor( protected var mPhotos: ArrayList, - accountId: Int, + accountId: Long, private val read_only: Boolean, private val context: Context, savedInstanceState: Bundle? @@ -353,7 +353,7 @@ open class PhotoPagerPresenter internal constructor( }) } - private fun onDeleteOrRestoreResult(photoId: Int, ownerId: Int, deleted: Boolean) { + private fun onDeleteOrRestoreResult(photoId: Int, ownerId: Long, deleted: Boolean) { val index = Utils.findIndexById(mPhotos, photoId, ownerId) if (index != -1) { val photo = mPhotos[index] @@ -364,7 +364,7 @@ open class PhotoPagerPresenter internal constructor( } } - private fun interceptLike(ownerId: Int, photoId: Int, count: Int, userLikes: Boolean) { + private fun interceptLike(ownerId: Long, photoId: Int, count: Int, userLikes: Boolean) { for (photo in mPhotos) { if (photo.getObjectId() == photoId && photo.ownerId == ownerId) { photo.setLikesCount(count) @@ -414,7 +414,7 @@ open class PhotoPagerPresenter internal constructor( } } - private fun transform_owner(owner_id: Int): String { + private fun transform_owner(owner_id: Long): String { return if (owner_id < 0) "club" + abs(owner_id) else "id$owner_id" } @@ -574,7 +574,7 @@ open class PhotoPagerPresenter internal constructor( .subscribe({ val buttons: MutableList = ArrayList(it.size) for (i in it) { - if (i.user_id != 0) { + if (i.user_id != 0L) { buttons.add(FunctionSource(i.tagged_name, R.drawable.person) { PlaceFactory.getOwnerWallPlace( accountId, i.user_id, null diff --git a/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/activity/photopager/SimplePhotoPresenter.kt b/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/activity/photopager/SimplePhotoPresenter.kt index fbd8b8bab..82ce01c07 100644 --- a/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/activity/photopager/SimplePhotoPresenter.kt +++ b/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/activity/photopager/SimplePhotoPresenter.kt @@ -9,7 +9,7 @@ import dev.ragnarok.fenrir.util.Utils class SimplePhotoPresenter( photos: ArrayList, index: Int, needToRefreshData: Boolean, - accountId: Int, context: Context, savedInstanceState: Bundle? + accountId: Long, context: Context, savedInstanceState: Bundle? ) : PhotoPagerPresenter(photos, accountId, !needToRefreshData, context, savedInstanceState) { private var mDataRefreshSuccessfull = false private fun refreshData() { diff --git a/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/activity/photopager/TmpGalleryPagerPresenter.kt b/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/activity/photopager/TmpGalleryPagerPresenter.kt index aa6e5de66..351a1f7da 100644 --- a/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/activity/photopager/TmpGalleryPagerPresenter.kt +++ b/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/activity/photopager/TmpGalleryPagerPresenter.kt @@ -12,7 +12,7 @@ import dev.ragnarok.fenrir.util.PersistentLogger class TmpGalleryPagerPresenter : PhotoPagerPresenter { constructor( - accountId: Int, source: TmpSource, index: Int, context: Context, + accountId: Long, source: TmpSource, index: Int, context: Context, savedInstanceState: Bundle? ) : super(ArrayList(0), accountId, false, context, savedInstanceState) { currentIndex = index @@ -20,7 +20,7 @@ class TmpGalleryPagerPresenter : PhotoPagerPresenter { } constructor( - accountId: Int, source: Long, index: Int, context: Context, + accountId: Long, source: Long, index: Int, context: Context, savedInstanceState: Bundle? ) : super(ArrayList(0), accountId, false, context, savedInstanceState) { currentIndex = index diff --git a/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/activity/storypager/IStoryPagerView.kt b/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/activity/storypager/IStoryPagerView.kt index c96c8fb02..d2a56dd9e 100644 --- a/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/activity/storypager/IStoryPagerView.kt +++ b/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/activity/storypager/IStoryPagerView.kt @@ -13,8 +13,8 @@ interface IStoryPagerView : IMvpView, IErrorView, IToastView { fun setPreparingProgressVisible(position: Int, preparing: Boolean) fun attachDisplayToPlayer(adapterPosition: Int, storyPlayer: IStoryPlayer?) fun setToolbarTitle(@StringRes titleRes: Int, vararg params: Any?) - fun setToolbarSubtitle(story: Story, account_id: Int) - fun onShare(story: Story, account_id: Int) + fun setToolbarSubtitle(story: Story, account_id: Long) + fun onShare(story: Story, account_id: Long) fun configHolder(adapterPosition: Int, progress: Boolean, aspectRatioW: Int, aspectRatioH: Int) fun onNext() fun requestWriteExternalStoragePermission() diff --git a/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/activity/storypager/StoryPagerActivity.kt b/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/activity/storypager/StoryPagerActivity.kt index e929cfcc7..5cf7cd31a 100644 --- a/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/activity/storypager/StoryPagerActivity.kt +++ b/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/activity/storypager/StoryPagerActivity.kt @@ -269,7 +269,7 @@ class StoryPagerActivity : BaseMvpActivity override fun getPresenterFactory(saveInstanceState: Bundle?): IPresenterFactory = object : IPresenterFactory { override fun create(): StoryPagerPresenter { - val aid = requireArguments().getInt(Extra.ACCOUNT_ID) + val aid = requireArguments().getLong(Extra.ACCOUNT_ID) val index = requireArguments().getInt(Extra.INDEX) val stories: ArrayList = if (FenrirNative.isNativeLoaded && Settings.get() .other().isNative_parcel_story @@ -326,7 +326,7 @@ class StoryPagerActivity : BaseMvpActivity supportActionBar?.title = getString(titleRes, *params) } - override fun setToolbarSubtitle(story: Story, account_id: Int) { + override fun setToolbarSubtitle(story: Story, account_id: Long) { supportActionBar?.subtitle = story.owner?.fullName mAvatar?.setOnClickListener { story.owner?.let { it1 -> @@ -372,7 +372,7 @@ class StoryPagerActivity : BaseMvpActivity } } - override fun onShare(story: Story, account_id: Int) { + override fun onShare(story: Story, account_id: Long) { SendAttachmentsActivity.startForSendAttachments(this, account_id, story) } @@ -668,9 +668,9 @@ class StoryPagerActivity : BaseMvpActivity return ph } - fun buildArgs(aid: Int, stories: ArrayList, index: Int): Bundle { + fun buildArgs(aid: Long, stories: ArrayList, index: Int): Bundle { val args = Bundle() - args.putInt(Extra.ACCOUNT_ID, aid) + args.putLong(Extra.ACCOUNT_ID, aid) args.putInt(Extra.INDEX, index) if (FenrirNative.isNativeLoaded && Settings.get().other().isNative_parcel_story) { args.putLong( diff --git a/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/activity/storypager/StoryPagerPresenter.kt b/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/activity/storypager/StoryPagerPresenter.kt index 56ca6bb57..4dc6d2dc2 100644 --- a/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/activity/storypager/StoryPagerPresenter.kt +++ b/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/activity/storypager/StoryPagerPresenter.kt @@ -25,7 +25,7 @@ import java.util.* import kotlin.math.abs class StoryPagerPresenter( - accountId: Int, + accountId: Long, private val mStories: ArrayList, private var mCurrentIndex: Int, private val context: Context, @@ -267,7 +267,7 @@ class StoryPagerPresenter( } } - private fun transform_owner(owner_id: Int): String { + private fun transform_owner(owner_id: Long): String { return if (owner_id < 0) "club" + abs(owner_id) else "id$owner_id" } diff --git a/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/api/AbsVkApiInterceptor.kt b/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/api/AbsVkApiInterceptor.kt index 022a9879b..6c509abdd 100644 --- a/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/api/AbsVkApiInterceptor.kt +++ b/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/api/AbsVkApiInterceptor.kt @@ -18,7 +18,7 @@ abstract class AbsVkApiInterceptor(private val version: String) : @AccountType abstract val type: Int - protected abstract val accountId: Int + protected abstract val accountId: Long /* private String RECEIPT_GMS_TOKEN() { diff --git a/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/api/CustomTokenVkApiInterceptor.kt b/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/api/CustomTokenVkApiInterceptor.kt index fa18bee37..5dd0fe2b0 100644 --- a/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/api/CustomTokenVkApiInterceptor.kt +++ b/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/api/CustomTokenVkApiInterceptor.kt @@ -8,7 +8,7 @@ internal class CustomTokenVkApiInterceptor( override val token: String?, v: String, @AccountType private val accountType: Int, - private val account_id: Int? + private val account_id: Long? ) : AbsVkApiInterceptor( v ) { @@ -23,6 +23,6 @@ internal class CustomTokenVkApiInterceptor( } return accountType } - override val accountId: Int + override val accountId: Long get() = account_id ?: -1 } \ No newline at end of file diff --git a/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/api/DefaultVkApiInterceptor.kt b/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/api/DefaultVkApiInterceptor.kt index 4371a1f3c..f7c5111f4 100644 --- a/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/api/DefaultVkApiInterceptor.kt +++ b/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/api/DefaultVkApiInterceptor.kt @@ -4,7 +4,7 @@ import dev.ragnarok.fenrir.AccountType import dev.ragnarok.fenrir.settings.Settings class DefaultVkApiInterceptor internal constructor( - override val accountId: Int, + override val accountId: Long, v: String ) : AbsVkApiInterceptor( v diff --git a/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/api/IServiceProvider.kt b/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/api/IServiceProvider.kt index 5820f8234..6b7743ab2 100644 --- a/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/api/IServiceProvider.kt +++ b/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/api/IServiceProvider.kt @@ -5,7 +5,7 @@ import io.reactivex.rxjava3.core.Single interface IServiceProvider { fun provideService( - accountId: Int, + accountId: Long, serviceClass: T, vararg tokenTypes: Int ): Single diff --git a/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/api/IVkMethodHttpClientFactory.kt b/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/api/IVkMethodHttpClientFactory.kt index 309dcfb8c..0e5aba070 100644 --- a/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/api/IVkMethodHttpClientFactory.kt +++ b/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/api/IVkMethodHttpClientFactory.kt @@ -5,9 +5,9 @@ import dev.ragnarok.fenrir.model.ProxyConfig import okhttp3.OkHttpClient interface IVkMethodHttpClientFactory { - fun createDefaultVkHttpClient(accountId: Int, config: ProxyConfig?): OkHttpClient.Builder + fun createDefaultVkHttpClient(accountId: Long, config: ProxyConfig?): OkHttpClient.Builder fun createCustomVkHttpClient( - accountId: Int, + accountId: Long, token: String, config: ProxyConfig? ): OkHttpClient.Builder diff --git a/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/api/IVkRestProvider.kt b/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/api/IVkRestProvider.kt index 85aed4d31..233a65ab6 100644 --- a/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/api/IVkRestProvider.kt +++ b/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/api/IVkRestProvider.kt @@ -6,9 +6,9 @@ import io.reactivex.rxjava3.core.Single import okhttp3.OkHttpClient interface IVkRestProvider { - fun provideNormalRest(accountId: Int): Single - fun provideCustomRest(accountId: Int, token: String): Single + fun provideNormalRest(accountId: Long): Single + fun provideCustomRest(accountId: Long, token: String): Single fun provideServiceRest(): Single - fun provideNormalHttpClient(accountId: Int): Single + fun provideNormalHttpClient(accountId: Long): Single fun provideRawHttpClient(@AccountType type: Int): Single } \ No newline at end of file diff --git a/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/api/VkMethodHttpClientFactory.kt b/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/api/VkMethodHttpClientFactory.kt index 7c425a56e..63722523d 100644 --- a/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/api/VkMethodHttpClientFactory.kt +++ b/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/api/VkMethodHttpClientFactory.kt @@ -13,7 +13,7 @@ import java.util.concurrent.TimeUnit class VkMethodHttpClientFactory : IVkMethodHttpClientFactory { override fun createDefaultVkHttpClient( - accountId: Int, + accountId: Long, config: ProxyConfig? ): OkHttpClient.Builder { return createDefaultVkApiOkHttpClient( @@ -25,7 +25,7 @@ class VkMethodHttpClientFactory : IVkMethodHttpClientFactory { } override fun createCustomVkHttpClient( - accountId: Int, + accountId: Long, token: String, config: ProxyConfig? ): OkHttpClient.Builder { diff --git a/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/api/VkRestProvider.kt b/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/api/VkRestProvider.kt index 59f4b8fab..4c956495b 100644 --- a/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/api/VkRestProvider.kt +++ b/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/api/VkRestProvider.kt @@ -17,7 +17,7 @@ class VkRestProvider( private val restCacheLock = Any() private val serviceRestLock = Any() - private val restCache = Collections.synchronizedMap(HashMap(1)) + private val restCache = Collections.synchronizedMap(HashMap(1)) @Volatile private var serviceRest: SimplePostHttp? = null @@ -30,7 +30,7 @@ class VkRestProvider( } } - override fun provideNormalRest(accountId: Int): Single { + override fun provideNormalRest(accountId: Long): Single { return Single.fromCallable { var rest: SimplePostHttp? synchronized(restCacheLock) { @@ -48,7 +48,7 @@ class VkRestProvider( } } - override fun provideCustomRest(accountId: Int, token: String): Single { + override fun provideCustomRest(accountId: Long, token: String): Single { return Single.fromCallable { val client = clientFactory.createCustomVkHttpClient( accountId, @@ -75,7 +75,7 @@ class VkRestProvider( } } - override fun provideNormalHttpClient(accountId: Int): Single { + override fun provideNormalHttpClient(accountId: Long): Single { return Single.fromCallable { clientFactory.createDefaultVkHttpClient( accountId, diff --git a/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/api/adapters/ArticleDtoAdapter.kt b/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/api/adapters/ArticleDtoAdapter.kt index 971a174cd..99646f86f 100644 --- a/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/api/adapters/ArticleDtoAdapter.kt +++ b/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/api/adapters/ArticleDtoAdapter.kt @@ -18,7 +18,7 @@ class ArticleDtoAdapter : AbsAdapter("VKApiArticle") { val article = VKApiArticle() val root = json.jsonObject article.id = optInt(root, "id") - article.owner_id = optInt(root, "owner_id") + article.owner_id = optLong(root, "owner_id") article.owner_name = optString(root, "owner_name") article.title = optString(root, "title") article.subtitle = optString(root, "subtitle") diff --git a/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/api/adapters/AudioDtoAdapter.kt b/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/api/adapters/AudioDtoAdapter.kt index 3fe5873e8..6d0ded037 100644 --- a/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/api/adapters/AudioDtoAdapter.kt +++ b/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/api/adapters/AudioDtoAdapter.kt @@ -17,7 +17,7 @@ class AudioDtoAdapter : AbsAdapter("VKApiAudio") { val dto = VKApiAudio() val root = json.jsonObject dto.id = optInt(root, "id") - dto.owner_id = optInt(root, "owner_id") + dto.owner_id = optLong(root, "owner_id") dto.artist = optString(root, "artist") dto.title = optString(root, "title") dto.duration = optInt(root, "duration") @@ -46,7 +46,7 @@ class AudioDtoAdapter : AbsAdapter("VKApiAudio") { if (hasObject(root, "album")) { var thmb = root.getAsJsonObject("album") dto.album_id = optInt(thmb, "id") - dto.album_owner_id = optInt(thmb, "owner_id") + dto.album_owner_id = optLong(thmb, "owner_id") dto.album_access_key = optString(thmb, "access_key") dto.album_title = optString(thmb, "title") if (hasObject(thmb, "thumb")) { diff --git a/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/api/adapters/AudioPlaylistDtoAdapter.kt b/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/api/adapters/AudioPlaylistDtoAdapter.kt index 426d5a8d9..1db335fe7 100644 --- a/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/api/adapters/AudioPlaylistDtoAdapter.kt +++ b/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/api/adapters/AudioPlaylistDtoAdapter.kt @@ -16,7 +16,7 @@ class AudioPlaylistDtoAdapter : AbsAdapter("VKApiAudioPlayli val root = json.jsonObject album.id = optInt(root, "id") album.count = optInt(root, "count") - album.owner_id = optInt(root, "owner_id") + album.owner_id = optLong(root, "owner_id") album.title = optString(root, "title") album.access_key = optString(root, "access_key") album.description = optString(root, "description") @@ -39,7 +39,7 @@ class AudioPlaylistDtoAdapter : AbsAdapter("VKApiAudioPlayli if (hasObject(root, "original")) { val orig = root.getAsJsonObject("original") album.original_id = optInt(orig, "playlist_id") - album.original_owner_id = optInt(orig, "owner_id") + album.original_owner_id = optLong(orig, "owner_id") album.original_access_key = optString(orig, "access_key") } if (hasArray(root, "main_artists")) { @@ -69,4 +69,4 @@ class AudioPlaylistDtoAdapter : AbsAdapter("VKApiAudioPlayli companion object { private val TAG = AudioPlaylistDtoAdapter::class.java.simpleName } -} +} \ No newline at end of file diff --git a/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/api/adapters/ChatDtoAdapter.kt b/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/api/adapters/ChatDtoAdapter.kt index 56071b40b..1cd52f95e 100644 --- a/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/api/adapters/ChatDtoAdapter.kt +++ b/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/api/adapters/ChatDtoAdapter.kt @@ -8,7 +8,7 @@ import dev.ragnarok.fenrir.kJson import dev.ragnarok.fenrir.orZero import dev.ragnarok.fenrir.util.serializeble.json.JsonElement import dev.ragnarok.fenrir.util.serializeble.json.JsonPrimitive -import dev.ragnarok.fenrir.util.serializeble.json.int +import dev.ragnarok.fenrir.util.serializeble.json.long class ChatDtoAdapter : AbsAdapter("VKApiChat") { @Throws(Exception::class) @@ -20,13 +20,13 @@ class ChatDtoAdapter : AbsAdapter("VKApiChat") { } val dto = VKApiChat() val root = json.asJsonObject - dto.id = optInt(root, "id") + dto.id = optLong(root, "id") dto.type = optString(root, "type") dto.title = optString(root, "title") dto.photo_50 = optString(root, "photo_50") dto.photo_100 = optString(root, "photo_100") dto.photo_200 = optString(root, "photo_200") - dto.admin_id = optInt(root, "admin_id") + dto.admin_id = optLong(root, "admin_id") if (hasArray(root, "users")) { val users = root.getAsJsonArray("users") dto.users = ArrayList(users?.size.orZero()) @@ -34,7 +34,7 @@ class ChatDtoAdapter : AbsAdapter("VKApiChat") { val userElement = users?.get(i) if (userElement is JsonPrimitive) { val user = VKApiUser() - user.id = userElement.int + user.id = userElement.long val chatUserDto = ChatUserDto() chatUserDto.user = user dto.users?.add(chatUserDto) @@ -46,7 +46,7 @@ class ChatDtoAdapter : AbsAdapter("VKApiChat") { val type = optString(jsonObject, "type") val chatUserDto = ChatUserDto() chatUserDto.type = type - chatUserDto.invited_by = optInt(jsonObject, "invited_by", 0) + chatUserDto.invited_by = optLong(jsonObject, "invited_by", 0) if ("profile" == type) { chatUserDto.user = kJson.decodeFromJsonElement(VKApiUser.serializer(), userElement) diff --git a/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/api/adapters/ChatJsonResponseDtoAdapter.kt b/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/api/adapters/ChatJsonResponseDtoAdapter.kt index 7e4eb87ef..2b76cda6f 100644 --- a/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/api/adapters/ChatJsonResponseDtoAdapter.kt +++ b/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/api/adapters/ChatJsonResponseDtoAdapter.kt @@ -17,7 +17,7 @@ class ChatJsonResponseDtoAdapter : AbsAdapter("ChatJsonRespons val root = json.asJsonObject story.type = optString(root, "type") story.page_avatar = optString(root, "page_avatar") - story.page_id = optInt(root, "page_id") + story.page_id = optLong(root, "page_id") story.page_instagram = optString(root, "page_instagram") story.page_phone_number = optString(root, "page_phone_number") story.page_site = optString(root, "page_site") diff --git a/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/api/adapters/ChatUserDtoAdapter.kt b/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/api/adapters/ChatUserDtoAdapter.kt index 3e135f114..a55111ceb 100644 --- a/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/api/adapters/ChatUserDtoAdapter.kt +++ b/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/api/adapters/ChatUserDtoAdapter.kt @@ -15,7 +15,7 @@ class ChatUserDtoAdapter : AbsAdapter("ChatUserDto") { val dto = ChatUserDto() if (checkObject(json)) { val root = json.asJsonObject - dto.invited_by = optInt(root, "invited_by") + dto.invited_by = optLong(root, "invited_by") dto.type = optString(root, "type") } dto.user = user diff --git a/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/api/adapters/CommentDtoAdapter.kt b/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/api/adapters/CommentDtoAdapter.kt index 691baacb6..f506e65ca 100644 --- a/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/api/adapters/CommentDtoAdapter.kt +++ b/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/api/adapters/CommentDtoAdapter.kt @@ -17,13 +17,13 @@ class CommentDtoAdapter : AbsAdapter("VKApiComment") { val dto = VKApiComment() val root = json.asJsonObject dto.id = optInt(root, "id") - dto.from_id = optInt(root, "from_id") - if (dto.from_id == 0) { - dto.from_id = optInt(root, "owner_id") + dto.from_id = optLong(root, "from_id") + if (dto.from_id == 0L) { + dto.from_id = optLong(root, "owner_id") } dto.date = optLong(root, "date") dto.text = optString(root, "text") - dto.reply_to_user = optInt(root, "reply_to_user") + dto.reply_to_user = optLong(root, "reply_to_user") dto.reply_to_comment = optInt(root, "reply_to_comment") if (hasArray(root, "attachments")) { dto.attachments = root["attachments"]?.let { diff --git a/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/api/adapters/CommunityDtoAdapter.kt b/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/api/adapters/CommunityDtoAdapter.kt index 95f971a5d..525659a64 100644 --- a/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/api/adapters/CommunityDtoAdapter.kt +++ b/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/api/adapters/CommunityDtoAdapter.kt @@ -18,7 +18,7 @@ class CommunityDtoAdapter : AbsAdapter("VKApiCommunity") { } val root = json.asJsonObject val dto = VKApiCommunity() - dto.id = optInt(root, "id") + dto.id = optLong(root, "id") dto.name = optString(root, Fields.GROUP_FIELDS.NAME) dto.screen_name = optString( root, diff --git a/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/api/adapters/FeedbackUserArrayDtoAdapter.kt b/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/api/adapters/FeedbackUserArrayDtoAdapter.kt index e59ca08f9..7eb01fa6e 100644 --- a/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/api/adapters/FeedbackUserArrayDtoAdapter.kt +++ b/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/api/adapters/FeedbackUserArrayDtoAdapter.kt @@ -14,15 +14,15 @@ class FeedbackUserArrayDtoAdapter : AbsAdapter("UserArray") { dto.count = optInt(root, "count") if (hasArray(root, "items")) { val array = root.getAsJsonArray("items") - dto.ids = IntArray(array?.size.orZero()) + dto.ids = LongArray(array?.size.orZero()) for (i in 0 until array?.size.orZero()) { if (!checkObject(array?.get(i))) { continue } - dto.ids?.set(i, optInt(array?.get(i)?.asJsonObject, "from_id", 0)) + dto.ids?.set(i, optLong(array?.get(i)?.asJsonObject, "from_id", 0)) } } else { - dto.ids = IntArray(0) + dto.ids = LongArray(0) } return dto } diff --git a/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/api/adapters/FeedbackVKOfficialDtoAdapter.kt b/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/api/adapters/FeedbackVKOfficialDtoAdapter.kt index 6174125cd..2a285e547 100644 --- a/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/api/adapters/FeedbackVKOfficialDtoAdapter.kt +++ b/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/api/adapters/FeedbackVKOfficialDtoAdapter.kt @@ -68,7 +68,7 @@ class FeedbackVKOfficialDtoAdapter : AbsAdapter("Feedbac ) { val context_item = action_item["context"]?.jsonObject dto.action = ActionMessage( - optInt(context_item, "peer_id", 0), + optLong(context_item, "peer_id", 0), optInt(context_item, "id", 0) ) } @@ -112,7 +112,7 @@ class FeedbackVKOfficialDtoAdapter : AbsAdapter("Feedbac val matcher = LinkParser.MENTIONS_AVATAR_PATTERN.matcher(it) if (matcher.find()) { val Type = matcher.group(1) - matcher.group(2)?.toInt()?.let { lit -> + matcher.group(2)?.toLong()?.let { lit -> dto.header_owner_id = if (Type == "event" || Type == "club" || Type == "public") -lit else lit if (dto.header_owner_id.orZero() >= 0) { diff --git a/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/api/adapters/GroupSettingsAdapter.kt b/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/api/adapters/GroupSettingsAdapter.kt index d292820a0..4d1fc24cb 100644 --- a/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/api/adapters/GroupSettingsAdapter.kt +++ b/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/api/adapters/GroupSettingsAdapter.kt @@ -76,4 +76,4 @@ class GroupSettingsAdapter : AbsAdapter("GroupSettingsDto") { companion object { private val TAG = GroupSettingsAdapter::class.java.simpleName } -} +} \ No newline at end of file diff --git a/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/api/adapters/LongpollUpdateAdapter.kt b/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/api/adapters/LongpollUpdateAdapter.kt index c4c398139..77795310f 100644 --- a/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/api/adapters/LongpollUpdateAdapter.kt +++ b/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/api/adapters/LongpollUpdateAdapter.kt @@ -31,21 +31,21 @@ class LongpollUpdateAdapter : AbsAdapter("AbsLongpollEvent?") ) AbsLongpollEvent.ACTION_USER_WRITE_TEXT_IN_DIALOG -> { val w = WriteTextInDialogUpdate(true) - w.peer_id = optInt(array, 1) - w.from_ids = optIntArray(array, 2, intArrayOf()) + w.peer_id = optLong(array, 1) + w.from_ids = optLongArray(array, 2, longArrayOf()) w.from_ids_count = optInt(array, 3) return w } AbsLongpollEvent.ACTION_USER_WRITE_VOICE_IN_DIALOG -> { val v = WriteTextInDialogUpdate(false) - v.peer_id = optInt(array, 1) - v.from_ids = optIntArray(array, 2, intArrayOf()) + v.peer_id = optLong(array, 1) + v.from_ids = optLongArray(array, 2, longArrayOf()) v.from_ids_count = optInt(array, 3) return v } AbsLongpollEvent.ACTION_USER_IS_ONLINE -> { val u = UserIsOnlineUpdate() - u.userId = -optInt(array, 1) + u.userId = -optLong(array, 1) u.platform = optInt(array, 2) u.timestamp = optLong(array, 3) u.app_id = optInt(array, 4) @@ -53,7 +53,7 @@ class LongpollUpdateAdapter : AbsAdapter("AbsLongpollEvent?") } AbsLongpollEvent.ACTION_USER_IS_OFFLINE -> { val u1 = UserIsOfflineUpdate() - u1.userId = -optInt(array, 1) + u1.userId = -optLong(array, 1) u1.isTimeout = optInt(array, 2) != 0 u1.timestamp = optLong(array, 3) u1.app_id = optInt(array, 4) @@ -63,15 +63,15 @@ class LongpollUpdateAdapter : AbsAdapter("AbsLongpollEvent?") val update = MessageFlagsResetUpdate() update.messageId = optInt(array, 1) update.mask = optInt(array, 2) - update.peerId = optInt(array, 3) - return if (update.peerId != 0 && update.messageId != 0) update else null + update.peerId = optLong(array, 3) + return if (update.peerId != 0L && update.messageId != 0) update else null } AbsLongpollEvent.ACTION_MESSAGES_FLAGS_SET -> { val update = MessageFlagsSetUpdate() update.messageId = optInt(array, 1) update.mask = optInt(array, 2) - update.peerId = optInt(array, 3) - return if (update.peerId != 0 && update.messageId != 0) update else null + update.peerId = optLong(array, 3) + return if (update.peerId != 0L && update.messageId != 0) update else null } AbsLongpollEvent.ACTION_COUNTER_UNREAD_WAS_CHANGED -> { val c = BadgeCountChangeUpdate() @@ -80,17 +80,17 @@ class LongpollUpdateAdapter : AbsAdapter("AbsLongpollEvent?") } AbsLongpollEvent.ACTION_SET_INPUT_MESSAGES_AS_READ -> { val update = InputMessagesSetReadUpdate() - update.peerId = optInt(array, 1) + update.peerId = optLong(array, 1) update.localId = optInt(array, 2) update.unreadCount = optInt(array, 3) // undocumented - return if (update.peerId != 0) update else null + return if (update.peerId != 0L) update else null } AbsLongpollEvent.ACTION_SET_OUTPUT_MESSAGES_AS_READ -> { val update = OutputMessagesSetReadUpdate() - update.peerId = optInt(array, 1) + update.peerId = optLong(array, 1) update.localId = optInt(array, 2) update.unreadCount = optInt(array, 3) // undocumented - return if (update.peerId != 0) update else null + return if (update.peerId != 0L) update else null } } return null @@ -102,7 +102,7 @@ class LongpollUpdateAdapter : AbsAdapter("AbsLongpollEvent?") val update = AddMessageUpdate() val flags = optInt(array, 2) update.messageId = optInt(array, 1) - update.peerId = optInt(array, 3) + update.peerId = optLong(array, 3) update.timestamp = optLong(array, 4) update.text = VKStringUtils.unescape(optString(array, 5)) update.isOut = Utils.hasFlag(flags, VKApiMessage.FLAG_OUTBOX) @@ -111,10 +111,10 @@ class LongpollUpdateAdapter : AbsAdapter("AbsLongpollEvent?") update.deleted = Utils.hasFlag(flags, VKApiMessage.FLAG_DELETED) val extra = opt(array, 6) as JsonObject? if (extra != null) { - update.from = optInt(extra, "from") + update.from = optLong(extra, "from") update.sourceText = optString(extra, "source_text") update.sourceAct = optString(extra, "source_act") - update.sourceMid = optInt(extra, "source_mid") + update.sourceMid = optLong(extra, "source_mid") update.payload = optString(extra, "payload") if (extra.has("keyboard")) { update.keyboard = @@ -140,7 +140,7 @@ class LongpollUpdateAdapter : AbsAdapter("AbsLongpollEvent?") } update.random_id = optString(array, 8) // ok update.edit_time = optLong(array, 10) - if (update.from == 0 && !Peer.isGroupChat(update.peerId) && !Peer.isContactChat(update.peerId) && !update.isOut) { + if (update.from == 0L && !Peer.isGroupChat(update.peerId) && !Peer.isContactChat(update.peerId) && !update.isOut) { update.from = update.peerId } return if (update.messageId != 0) update else null diff --git a/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/api/adapters/MarketDtoAdapter.kt b/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/api/adapters/MarketDtoAdapter.kt index e07674a6f..103c1eb02 100644 --- a/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/api/adapters/MarketDtoAdapter.kt +++ b/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/api/adapters/MarketDtoAdapter.kt @@ -16,7 +16,7 @@ class MarketDtoAdapter : AbsAdapter("VKApiMarket") { val dto = VKApiMarket() val root = json.asJsonObject dto.id = optInt(root, "id") - dto.owner_id = optInt(root, "owner_id") + dto.owner_id = optLong(root, "owner_id") dto.weight = optInt(root, "weight") dto.availability = optInt(root, "availability") dto.date = optLong(root, "date") diff --git a/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/api/adapters/MessageDtoAdapter.kt b/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/api/adapters/MessageDtoAdapter.kt index ad7b1c200..a72c81717 100644 --- a/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/api/adapters/MessageDtoAdapter.kt +++ b/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/api/adapters/MessageDtoAdapter.kt @@ -19,8 +19,9 @@ class MessageDtoAdapter : AbsAdapter("VKApiMessage") { val root = json.asJsonObject dto.id = optInt(root, "id") dto.out = optBoolean(root, "out") - dto.peer_id = optInt(root, "peer_id") - dto.from_id = if (root.has("from_id")) optInt(root, "from_id") else optInt(root, "user_id") + dto.peer_id = optLong(root, "peer_id") + dto.from_id = + if (root.has("from_id")) optLong(root, "from_id") else optLong(root, "user_id") dto.date = optLong(root, "date") //dto.read_state = optBoolean(root, "read_state"); //dto.title = VKStringUtils.unescape(optString(root, "title")); @@ -80,7 +81,7 @@ class MessageDtoAdapter : AbsAdapter("VKApiMessage") { val actionJson = root["action"] if (checkObject(actionJson)) { dto.action = optString(actionJson.asJsonObject, "type") - dto.action_mid = optInt(actionJson.asJsonObject, "member_id") + dto.action_mid = optLong(actionJson.asJsonObject, "member_id") dto.action_text = optString(actionJson.asJsonObject, "text") dto.action_email = optString(actionJson.asJsonObject, "email") if (hasObject(actionJson.asJsonObject, "photo")) { diff --git a/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/api/adapters/NarrativesDtoAdapter.kt b/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/api/adapters/NarrativesDtoAdapter.kt index acd52132d..c96a36e41 100644 --- a/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/api/adapters/NarrativesDtoAdapter.kt +++ b/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/api/adapters/NarrativesDtoAdapter.kt @@ -17,7 +17,7 @@ class NarrativesDtoAdapter : AbsAdapter("VKApiNarratives") { val dto = VKApiNarratives() val root = json.asJsonObject dto.id = optInt(root, "id") - dto.owner_id = optInt(root, "owner_id") + dto.owner_id = optLong(root, "owner_id") dto.title = optString(root, "title") if (hasArray(root, "story_ids")) { val temp = root.getAsJsonArray("story_ids") diff --git a/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/api/adapters/NewsAdapter.kt b/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/api/adapters/NewsAdapter.kt index 9e3f803dc..ad2a68c99 100644 --- a/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/api/adapters/NewsAdapter.kt +++ b/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/api/adapters/NewsAdapter.kt @@ -5,8 +5,8 @@ import dev.ragnarok.fenrir.kJson import dev.ragnarok.fenrir.nonNullNoEmpty import dev.ragnarok.fenrir.orZero import dev.ragnarok.fenrir.util.serializeble.json.JsonElement -import dev.ragnarok.fenrir.util.serializeble.json.int import dev.ragnarok.fenrir.util.serializeble.json.jsonPrimitive +import dev.ragnarok.fenrir.util.serializeble.json.long class NewsAdapter : AbsAdapter("VKApiNews") { @Throws(Exception::class) @@ -19,12 +19,12 @@ class NewsAdapter : AbsAdapter("VKApiNews") { val dto = VKApiNews() val root = json.asJsonObject dto.type = optString(root, "type") - dto.source_id = optInt(root, "source_id") + dto.source_id = optLong(root, "source_id") dto.date = optLong(root, "date") dto.post_id = optInt(root, "post_id") dto.post_type = optString(root, "post_type") dto.final_post = optBoolean(root, "final_post") - dto.copy_owner_id = optInt(root, "copy_owner_id") + dto.copy_owner_id = optLong(root, "copy_owner_id") dto.copy_post_id = optInt(root, "copy_post_id") dto.mark_as_ads = optInt(root, "mark_as_ads") if (hasArray(root, "copy_history")) { @@ -126,7 +126,7 @@ class NewsAdapter : AbsAdapter("VKApiNews") { dto.friends = ArrayList(friendsArray?.size.orZero()) for (i in 0 until friendsArray?.size.orZero()) { val friendObj = friendsArray?.get(i)?.asJsonObject - friendObj?.get("user_id")?.jsonPrimitive?.let { dto.friends?.add(it.int) } + friendObj?.get("user_id")?.jsonPrimitive?.let { dto.friends?.add(it.long) } } } return dto diff --git a/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/api/adapters/NewsfeedCommentDtoAdapter.kt b/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/api/adapters/NewsfeedCommentDtoAdapter.kt index 935b8c44a..f54b8c0eb 100644 --- a/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/api/adapters/NewsfeedCommentDtoAdapter.kt +++ b/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/api/adapters/NewsfeedCommentDtoAdapter.kt @@ -27,8 +27,8 @@ class NewsfeedCommentDtoAdapter : AbsAdapter("Dto") { "topic" -> { val topic = VKApiTopic() topic.id = optInt(root, "post_id") - if (root.has("to_id")) topic.owner_id = optInt(root, "to_id") else topic.owner_id = - optInt(root, "source_id") + if (root.has("to_id")) topic.owner_id = optLong(root, "to_id") else topic.owner_id = + optLong(root, "source_id") topic.title = optString(root, "text") topic.comments = root["comments"]?.let { diff --git a/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/api/adapters/PhotoAlbumDtoAdapter.kt b/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/api/adapters/PhotoAlbumDtoAdapter.kt index b3ad5e7cb..46917d6ae 100644 --- a/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/api/adapters/PhotoAlbumDtoAdapter.kt +++ b/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/api/adapters/PhotoAlbumDtoAdapter.kt @@ -19,7 +19,7 @@ class PhotoAlbumDtoAdapter : AbsAdapter("VKApiPhotoAlbum") { val root = json.asJsonObject album.id = optInt(root, "id") album.thumb_id = optInt(root, "thumb_id") - album.owner_id = optInt(root, "owner_id") + album.owner_id = optLong(root, "owner_id") album.title = optString(root, "title") album.description = optString(root, "description") album.created = optLong(root, "created") diff --git a/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/api/adapters/PhotoDtoAdapter.kt b/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/api/adapters/PhotoDtoAdapter.kt index 390567228..12b9b6050 100644 --- a/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/api/adapters/PhotoDtoAdapter.kt +++ b/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/api/adapters/PhotoDtoAdapter.kt @@ -22,7 +22,7 @@ class PhotoDtoAdapter : AbsAdapter("VKApiPhoto") { photo.date = optLong(root, "date") photo.height = optInt(root, "height") photo.width = optInt(root, "width") - photo.owner_id = optInt(root, "owner_id") + photo.owner_id = optLong(root, "owner_id") photo.text = optString(root, "text") photo.access_key = optString(root, "access_key") if (hasObject(root, "likes")) { diff --git a/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/api/adapters/PostDtoAdapter.kt b/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/api/adapters/PostDtoAdapter.kt index 795220426..cf2ef17bb 100644 --- a/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/api/adapters/PostDtoAdapter.kt +++ b/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/api/adapters/PostDtoAdapter.kt @@ -25,9 +25,9 @@ class PostDtoAdapter : AbsAdapter("VKApiPost") { dto.post_type = DONUT } } - dto.owner_id = getFirstInt(root, 0, "owner_id", "to_id", "source_id") - dto.from_id = optInt(root, "from_id") - if (dto.from_id == 0) { + dto.owner_id = getFirstLong(root, 0, "owner_id", "to_id", "source_id") + dto.from_id = optLong(root, "from_id") + if (dto.from_id == 0L) { // "copy_history": [ // { // ... this post has been removed ... @@ -48,8 +48,8 @@ class PostDtoAdapter : AbsAdapter("VKApiPost") { dto.copyright = VKApiPost.Copyright(it, link) } } - dto.reply_owner_id = optInt(root, "reply_owner_id", 0) - if (dto.reply_owner_id == 0) { + dto.reply_owner_id = optLong(root, "reply_owner_id", 0) + if (dto.reply_owner_id == 0L) { // for replies from newsfeed.search // но не помешало бы понять какого хе...а!!! dto.reply_owner_id = dto.owner_id @@ -96,8 +96,8 @@ class PostDtoAdapter : AbsAdapter("VKApiPost") { } dto.can_edit = optBoolean(root, "can_edit") dto.is_favorite = optBoolean(root, "is_favorite") - dto.signer_id = optInt(root, "signer_id") - dto.created_by = optInt(root, "created_by") + dto.signer_id = optLong(root, "signer_id") + dto.created_by = optLong(root, "created_by") dto.can_pin = optInt(root, "can_pin") == 1 dto.is_pinned = optBoolean(root, "is_pinned") if (hasArray(root, "copy_history")) { diff --git a/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/api/adapters/PrivacyDtoAdapter.kt b/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/api/adapters/PrivacyDtoAdapter.kt index 9d7840b83..6fc3b6296 100644 --- a/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/api/adapters/PrivacyDtoAdapter.kt +++ b/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/api/adapters/PrivacyDtoAdapter.kt @@ -22,13 +22,13 @@ class PrivacyDtoAdapter : AbsAdapter("VKApiPrivacy") { val allowed = owners.asJsonObject["allowed"] if (checkArray(allowed)) { for (i in 0 until allowed.asJsonArray.size) { - privacy.includeOwner(optInt(allowed.asJsonArray, i)) + privacy.includeOwner(optLong(allowed.asJsonArray, i)) } } val excluded = owners.asJsonObject["excluded"] if (checkArray(excluded)) { for (i in 0 until excluded.asJsonArray.size) { - privacy.excludeOwner(optInt(excluded.asJsonArray, i)) + privacy.excludeOwner(optLong(excluded.asJsonArray, i)) } } } @@ -37,13 +37,13 @@ class PrivacyDtoAdapter : AbsAdapter("VKApiPrivacy") { val allowed = lists.asJsonObject["allowed"] if (checkArray(allowed)) { for (i in 0 until allowed.asJsonArray.size) { - privacy.includeFriendsList(optInt(allowed.asJsonArray, i)) + privacy.includeFriendsList(optLong(allowed.asJsonArray, i)) } } val excluded = lists.asJsonObject["excluded"] if (checkArray(excluded)) { for (i in 0 until excluded.asJsonArray.size) { - privacy.excludeFriendsList(optInt(excluded.asJsonArray, i)) + privacy.excludeFriendsList(optLong(excluded.asJsonArray, i)) } } } diff --git a/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/api/adapters/StoryDtoAdapter.kt b/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/api/adapters/StoryDtoAdapter.kt index 780bc4a9a..e7919c990 100644 --- a/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/api/adapters/StoryDtoAdapter.kt +++ b/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/api/adapters/StoryDtoAdapter.kt @@ -17,7 +17,7 @@ class StoryDtoAdapter : AbsAdapter("VKApiStory") { val story = VKApiStory() val root = json.asJsonObject story.id = optInt(root, "id") - story.owner_id = optInt(root, "owner_id") + story.owner_id = optLong(root, "owner_id") story.date = optLong(root, "owner_id") story.expires_at = optLong(root, "expires_at") story.is_expired = optBoolean(root, "is_expired") @@ -47,4 +47,4 @@ class StoryDtoAdapter : AbsAdapter("VKApiStory") { companion object { private val TAG = StoryDtoAdapter::class.java.simpleName } -} +} \ No newline at end of file diff --git a/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/api/adapters/TopicDtoAdapter.kt b/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/api/adapters/TopicDtoAdapter.kt index c5b99cee5..9d9c8a7ba 100644 --- a/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/api/adapters/TopicDtoAdapter.kt +++ b/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/api/adapters/TopicDtoAdapter.kt @@ -19,12 +19,12 @@ class TopicDtoAdapter : AbsAdapter("VKApiTopic") { val dto = VKApiTopic() val root = json.asJsonObject dto.id = optInt(root, "id") - dto.owner_id = optInt(root, "owner_id") + dto.owner_id = optLong(root, "owner_id") dto.title = optString(root, "title") dto.created = optLong(root, "created") - dto.created_by = optInt(root, "created_by") + dto.created_by = optLong(root, "created_by") dto.updated = optLong(root, "updated") - dto.updated_by = optInt(root, "updated_by") + dto.updated_by = optLong(root, "updated_by") dto.is_closed = optBoolean(root, "is_closed") dto.is_fixed = optBoolean(root, "is_fixed") if (root.has("comments")) { diff --git a/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/api/adapters/UserDtoAdapter.kt b/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/api/adapters/UserDtoAdapter.kt index e7c09c9b4..a86f97c99 100644 --- a/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/api/adapters/UserDtoAdapter.kt +++ b/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/api/adapters/UserDtoAdapter.kt @@ -17,8 +17,8 @@ class UserDtoAdapter : AbsAdapter("VKApiUser") { } val dto = VKApiUser() val root = json.asJsonObject - dto.id = optInt(root, "id") - if (dto.id == 0) dto.id = optInt(root, "user_id") + dto.id = optLong(root, "id") + if (dto.id == 0L) dto.id = optLong(root, "user_id") dto.first_name = optString(root, Fields.USER_FIELDS.FIRST_NAME) dto.last_name = optString(root, Fields.USER_FIELDS.LAST_NAME) dto.online = optBoolean(root, Fields.USER_FIELDS.ONLINE) diff --git a/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/api/adapters/VideoAlbumDtoAdapter.kt b/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/api/adapters/VideoAlbumDtoAdapter.kt index 7ad2506c1..dedf4bd93 100644 --- a/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/api/adapters/VideoAlbumDtoAdapter.kt +++ b/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/api/adapters/VideoAlbumDtoAdapter.kt @@ -19,7 +19,7 @@ class VideoAlbumDtoAdapter : AbsAdapter("VKApiVideoAlbum") { val album = VKApiVideoAlbum() val root = json.asJsonObject album.id = optInt(root, "id") - album.owner_id = optInt(root, "owner_id") + album.owner_id = optLong(root, "owner_id") album.title = optString(root, "title") album.count = optInt(root, "count") album.updated_time = optLong(root, "updated_time") @@ -57,4 +57,4 @@ class VideoAlbumDtoAdapter : AbsAdapter("VKApiVideoAlbum") { companion object { private val TAG = VideoAlbumDtoAdapter::class.java.simpleName } -} +} \ No newline at end of file diff --git a/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/api/adapters/VideoDtoAdapter.kt b/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/api/adapters/VideoDtoAdapter.kt index b8dd3aec9..aeebaa381 100644 --- a/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/api/adapters/VideoDtoAdapter.kt +++ b/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/api/adapters/VideoDtoAdapter.kt @@ -19,7 +19,7 @@ class VideoDtoAdapter : AbsAdapter("VKApiVideo") { val root = json.asJsonObject val dto = VKApiVideo() dto.id = optInt(root, "id") - dto.owner_id = optInt(root, "owner_id") + dto.owner_id = optLong(root, "owner_id") dto.title = optString(root, "title") dto.description = optString(root, "description") dto.duration = optInt(root, "duration") diff --git a/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/api/impl/AbsApi.kt b/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/api/impl/AbsApi.kt index cbb126697..f42de9772 100644 --- a/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/api/impl/AbsApi.kt +++ b/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/api/impl/AbsApi.kt @@ -25,7 +25,7 @@ import kotlinx.serialization.KSerializer import okhttp3.* import java.util.* -internal open class AbsApi(val accountId: Int, private val restProvider: IServiceProvider) { +internal open class AbsApi(val accountId: Long, private val restProvider: IServiceProvider) { fun provideService(serviceClass: T, vararg tokenTypes: Int): Single { var pTokenTypes: IntArray = tokenTypes if (pTokenTypes.nullOrEmpty()) { diff --git a/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/api/impl/AccountApi.kt b/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/api/impl/AccountApi.kt index 91cfb37ef..ad5ab38c6 100644 --- a/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/api/impl/AccountApi.kt +++ b/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/api/impl/AccountApi.kt @@ -15,9 +15,9 @@ import dev.ragnarok.fenrir.api.services.IAccountService import io.reactivex.rxjava3.core.Completable import io.reactivex.rxjava3.core.Single -internal class AccountApi(accountId: Int, provider: IServiceProvider) : +internal class AccountApi(accountId: Long, provider: IServiceProvider) : AbsApi(accountId, provider), IAccountApi { - override fun ban(ownerId: Int): Single { + override fun ban(ownerId: Long): Single { return provideService(IAccountService(), TokenType.USER, TokenType.COMMUNITY) .flatMap { service -> service @@ -26,7 +26,7 @@ internal class AccountApi(accountId: Int, provider: IServiceProvider) : } } - override fun unban(ownerId: Int): Single { + override fun unban(ownerId: Long): Single { return provideService(IAccountService(), TokenType.USER, TokenType.COMMUNITY) .flatMap { service -> service diff --git a/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/api/impl/AudioApi.kt b/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/api/impl/AudioApi.kt index cf11d5ee1..f3e5a114f 100644 --- a/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/api/impl/AudioApi.kt +++ b/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/api/impl/AudioApi.kt @@ -15,9 +15,9 @@ import dev.ragnarok.fenrir.model.Audio import dev.ragnarok.fenrir.nonNullNoEmpty import io.reactivex.rxjava3.core.Single -internal class AudioApi(accountId: Int, provider: IServiceProvider) : +internal class AudioApi(accountId: Long, provider: IServiceProvider) : AbsApi(accountId, provider), IAudioApi { - override fun setBroadcast(audio: AccessIdPair, targetIds: Collection): Single> { + override fun setBroadcast(audio: AccessIdPair, targetIds: Collection): Single> { val f = join(setOf(audio), ",") { AccessIdPair.format(it) } val s = join(targetIds, ",") return provideService(IAudioService()) @@ -81,7 +81,7 @@ internal class AudioApi(accountId: Int, provider: IServiceProvider) : } } - override fun restore(audioId: Int, ownerId: Int?): Single { + override fun restore(audioId: Int, ownerId: Long?): Single { return provideService(IAudioService()) .flatMap { service -> service @@ -90,7 +90,7 @@ internal class AudioApi(accountId: Int, provider: IServiceProvider) : } } - override fun delete(audioId: Int, ownerId: Int): Single { + override fun delete(audioId: Int, ownerId: Long): Single { return provideService(IAudioService()) .flatMap { service -> service @@ -107,7 +107,7 @@ internal class AudioApi(accountId: Int, provider: IServiceProvider) : } override fun edit( - ownerId: Int, + ownerId: Long, audioId: Int, artist: String?, title: String?, @@ -121,7 +121,7 @@ internal class AudioApi(accountId: Int, provider: IServiceProvider) : } } - override fun add(audioId: Int, ownerId: Int, groupId: Int?, accessKey: String?): Single { + override fun add(audioId: Int, ownerId: Long, groupId: Long?, accessKey: String?): Single { return provideService(IAudioService()) .flatMap { service -> service @@ -131,7 +131,7 @@ internal class AudioApi(accountId: Int, provider: IServiceProvider) : } override fun createPlaylist( - ownerId: Int, + ownerId: Long, title: String?, description: String? ): Single { @@ -144,7 +144,7 @@ internal class AudioApi(accountId: Int, provider: IServiceProvider) : } override fun editPlaylist( - ownerId: Int, + ownerId: Long, playlist_id: Int, title: String?, description: String? @@ -158,7 +158,7 @@ internal class AudioApi(accountId: Int, provider: IServiceProvider) : } override fun removeFromPlaylist( - ownerId: Int, + ownerId: Long, playlist_id: Int, audio_ids: Collection ): Single { @@ -174,7 +174,7 @@ internal class AudioApi(accountId: Int, provider: IServiceProvider) : } override fun addToPlaylist( - ownerId: Int, + ownerId: Long, playlist_id: Int, audio_ids: Collection ): Single> { @@ -189,7 +189,7 @@ internal class AudioApi(accountId: Int, provider: IServiceProvider) : } } - override fun reorder(ownerId: Int, audio_id: Int, before: Int?, after: Int?): Single { + override fun reorder(ownerId: Long, audio_id: Int, before: Int?, after: Int?): Single { return provideService(IAudioService()) .flatMap { service -> service @@ -208,7 +208,7 @@ internal class AudioApi(accountId: Int, provider: IServiceProvider) : } override fun getCatalogV2Sections( - owner_id: Int, artist_id: String?, url: String?, query: String?, context: String? + owner_id: Long, artist_id: String?, url: String?, query: String?, context: String? ): Single { return provideService(IAudioService()) .flatMap { service -> @@ -248,7 +248,7 @@ internal class AudioApi(accountId: Int, provider: IServiceProvider) : } } - override fun deletePlaylist(playlist_id: Int, ownerId: Int): Single { + override fun deletePlaylist(playlist_id: Int, ownerId: Long): Single { return provideService(IAudioService()) .flatMap { service -> service @@ -259,7 +259,7 @@ internal class AudioApi(accountId: Int, provider: IServiceProvider) : override fun followPlaylist( playlist_id: Int, - ownerId: Int, + ownerId: Long, accessKey: String? ): Single { return provideService(IAudioService()) @@ -270,7 +270,7 @@ internal class AudioApi(accountId: Int, provider: IServiceProvider) : } } - override fun clonePlaylist(playlist_id: Int, ownerId: Int): Single { + override fun clonePlaylist(playlist_id: Int, ownerId: Long): Single { return provideService(IAudioService()) .flatMap { service -> service @@ -281,7 +281,7 @@ internal class AudioApi(accountId: Int, provider: IServiceProvider) : override fun getPlaylistById( playlist_id: Int, - ownerId: Int, + ownerId: Long, accessKey: String? ): Single { return provideService(IAudioService()) @@ -294,7 +294,7 @@ internal class AudioApi(accountId: Int, provider: IServiceProvider) : override fun get( playlist_id: Int?, - ownerId: Int?, + ownerId: Long?, offset: Int?, count: Int?, accessKey: String? @@ -330,7 +330,7 @@ internal class AudioApi(accountId: Int, provider: IServiceProvider) : } } - override fun getRecommendations(audioOwnerId: Int?, count: Int?): Single> { + override fun getRecommendations(audioOwnerId: Long?, count: Int?): Single> { return provideService(IAudioService()) .flatMap { service -> service @@ -349,7 +349,7 @@ internal class AudioApi(accountId: Int, provider: IServiceProvider) : } override fun getPlaylists( - owner_id: Int, + owner_id: Long, offset: Int, count: Int ): Single> { diff --git a/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/api/impl/BoardApi.kt b/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/api/impl/BoardApi.kt index 09325b220..de3de3a8b 100644 --- a/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/api/impl/BoardApi.kt +++ b/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/api/impl/BoardApi.kt @@ -10,10 +10,10 @@ import dev.ragnarok.fenrir.api.services.IBoardService import dev.ragnarok.fenrir.requireNonNull import io.reactivex.rxjava3.core.Single -internal class BoardApi(accountId: Int, provider: IServiceProvider) : +internal class BoardApi(accountId: Long, provider: IServiceProvider) : AbsApi(accountId, provider), IBoardApi { override fun getComments( - groupId: Int, + groupId: Long, topicId: Int, needLikes: Boolean?, startCommentId: Int?, @@ -41,7 +41,7 @@ internal class BoardApi(accountId: Int, provider: IServiceProvider) : } } - override fun restoreComment(groupId: Int, topicId: Int, commentId: Int): Single { + override fun restoreComment(groupId: Long, topicId: Int, commentId: Int): Single { return provideService(IBoardService(), TokenType.USER, TokenType.COMMUNITY) .flatMap { service -> service.restoreComment(groupId, topicId, commentId) @@ -50,7 +50,7 @@ internal class BoardApi(accountId: Int, provider: IServiceProvider) : } } - override fun deleteComment(groupId: Int, topicId: Int, commentId: Int): Single { + override fun deleteComment(groupId: Long, topicId: Int, commentId: Int): Single { return provideService(IBoardService(), TokenType.USER, TokenType.COMMUNITY) .flatMap { service -> service.deleteComment(groupId, topicId, commentId) @@ -60,7 +60,7 @@ internal class BoardApi(accountId: Int, provider: IServiceProvider) : } override fun getTopics( - groupId: Int, topicIds: Collection?, order: Int?, + groupId: Long, topicIds: Collection?, order: Int?, offset: Int?, count: Int?, extended: Boolean?, preview: Int?, previewLength: Int?, fields: String? ): Single { @@ -92,7 +92,7 @@ internal class BoardApi(accountId: Int, provider: IServiceProvider) : } override fun editComment( - groupId: Int, topicId: Int, commentId: Int, message: String?, + groupId: Long, topicId: Int, commentId: Int, message: String?, attachments: Collection? ): Single { return provideService(IBoardService(), TokenType.USER) @@ -112,7 +112,7 @@ internal class BoardApi(accountId: Int, provider: IServiceProvider) : } override fun addComment( - groupId: Int?, + groupId: Long?, topicId: Int, message: String?, attachments: Collection?, diff --git a/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/api/impl/CommentsApi.kt b/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/api/impl/CommentsApi.kt index 8954c4908..3258e1478 100644 --- a/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/api/impl/CommentsApi.kt +++ b/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/api/impl/CommentsApi.kt @@ -8,11 +8,11 @@ import dev.ragnarok.fenrir.api.model.response.CustomCommentsResponse import dev.ragnarok.fenrir.api.services.ICommentsService import io.reactivex.rxjava3.core.Single -internal class CommentsApi(accountId: Int, provider: IServiceProvider) : +internal class CommentsApi(accountId: Long, provider: IServiceProvider) : AbsApi(accountId, provider), ICommentsApi { override fun get( sourceType: String?, - ownerId: Int, + ownerId: Long, sourceId: Int, offset: Int?, count: Int?, diff --git a/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/api/impl/DatabaseApi.kt b/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/api/impl/DatabaseApi.kt index 9a97b620d..20907218e 100644 --- a/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/api/impl/DatabaseApi.kt +++ b/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/api/impl/DatabaseApi.kt @@ -10,7 +10,7 @@ import dev.ragnarok.fenrir.api.model.database.* import dev.ragnarok.fenrir.api.services.IDatabaseService import io.reactivex.rxjava3.core.Single -internal class DatabaseApi(accountId: Int, provider: IServiceProvider) : +internal class DatabaseApi(accountId: Long, provider: IServiceProvider) : AbsApi(accountId, provider), IDatabaseApi { override fun getCitiesById(cityIds: Collection): Single> { return provideService(IDatabaseService(), TokenType.USER, TokenType.SERVICE) diff --git a/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/api/impl/DocsApi.kt b/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/api/impl/DocsApi.kt index 53d66ffc8..84b0adaee 100644 --- a/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/api/impl/DocsApi.kt +++ b/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/api/impl/DocsApi.kt @@ -11,9 +11,9 @@ import dev.ragnarok.fenrir.api.model.server.VKApiVideosUploadServer import dev.ragnarok.fenrir.api.services.IDocsService import io.reactivex.rxjava3.core.Single -internal class DocsApi(accountId: Int, provider: IServiceProvider) : AbsApi(accountId, provider), +internal class DocsApi(accountId: Long, provider: IServiceProvider) : AbsApi(accountId, provider), IDocsApi { - override fun delete(ownerId: Int?, docId: Int): Single { + override fun delete(ownerId: Long?, docId: Int): Single { return provideService(IDocsService(), TokenType.USER) .flatMap { service -> service.delete(ownerId, docId) @@ -22,7 +22,7 @@ internal class DocsApi(accountId: Int, provider: IServiceProvider) : AbsApi(acco } } - override fun add(ownerId: Int, docId: Int, accessKey: String?): Single { + override fun add(ownerId: Long, docId: Int, accessKey: String?): Single { return provideService(IDocsService(), TokenType.USER) .flatMap { service -> service.add(ownerId, docId, accessKey) @@ -57,7 +57,7 @@ internal class DocsApi(accountId: Int, provider: IServiceProvider) : AbsApi(acco } override fun getMessagesUploadServer( - peerId: Int?, + peerId: Long?, type: String? ): Single { return provideService(IDocsService(), TokenType.USER, TokenType.COMMUNITY) @@ -67,7 +67,7 @@ internal class DocsApi(accountId: Int, provider: IServiceProvider) : AbsApi(acco } } - override fun getUploadServer(groupId: Int?): Single { + override fun getUploadServer(groupId: Long?): Single { return provideService(IDocsService(), TokenType.USER) .flatMap { service -> service.getUploadServer(groupId) @@ -77,7 +77,7 @@ internal class DocsApi(accountId: Int, provider: IServiceProvider) : AbsApi(acco override fun getVideoServer( isPrivate: Int?, - group_id: Int?, + group_id: Long?, name: String? ): Single { return provideService(IDocsService(), TokenType.USER) @@ -88,7 +88,7 @@ internal class DocsApi(accountId: Int, provider: IServiceProvider) : AbsApi(acco } override fun get( - ownerId: Int?, + ownerId: Long?, count: Int?, offset: Int?, type: Int? diff --git a/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/api/impl/FaveApi.kt b/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/api/impl/FaveApi.kt index 61aea637a..17e5e1f1c 100644 --- a/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/api/impl/FaveApi.kt +++ b/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/api/impl/FaveApi.kt @@ -12,7 +12,7 @@ import dev.ragnarok.fenrir.api.services.IFaveService import dev.ragnarok.fenrir.util.Utils.listEmptyIfNull import io.reactivex.rxjava3.core.Single -internal class FaveApi(accountId: Int, provider: IServiceProvider) : AbsApi(accountId, provider), +internal class FaveApi(accountId: Long, provider: IServiceProvider) : AbsApi(accountId, provider), IFaveApi { override fun getPages( offset: Int?, @@ -68,7 +68,7 @@ internal class FaveApi(accountId: Int, provider: IServiceProvider) : AbsApi(acco } override fun getOwnerPublishedArticles( - owner_id: Int?, + owner_id: Long?, offset: Int?, count: Int? ): Single> { @@ -118,7 +118,7 @@ internal class FaveApi(accountId: Int, provider: IServiceProvider) : AbsApi(acco } } - override fun addPage(userId: Int?, groupId: Int?): Single { + override fun addPage(userId: Long?, groupId: Long?): Single { return provideService(IFaveService(), TokenType.USER) .flatMap { service -> service.addPage(userId, groupId) @@ -136,7 +136,7 @@ internal class FaveApi(accountId: Int, provider: IServiceProvider) : AbsApi(acco } } - override fun addVideo(owner_id: Int?, id: Int?, access_key: String?): Single { + override fun addVideo(owner_id: Long?, id: Int?, access_key: String?): Single { return provideService(IFaveService(), TokenType.USER) .flatMap { service -> service.addVideo(owner_id, id, access_key) @@ -154,7 +154,7 @@ internal class FaveApi(accountId: Int, provider: IServiceProvider) : AbsApi(acco } } - override fun addProduct(id: Int, owner_id: Int, access_key: String?): Single { + override fun addProduct(id: Int, owner_id: Long, access_key: String?): Single { return provideService(IFaveService(), TokenType.USER) .flatMap { service -> service.addProduct(id, owner_id, access_key) @@ -163,7 +163,7 @@ internal class FaveApi(accountId: Int, provider: IServiceProvider) : AbsApi(acco } } - override fun addPost(owner_id: Int?, id: Int?, access_key: String?): Single { + override fun addPost(owner_id: Long?, id: Int?, access_key: String?): Single { return provideService(IFaveService(), TokenType.USER) .flatMap { service -> service.addPost(owner_id, id, access_key) @@ -172,7 +172,7 @@ internal class FaveApi(accountId: Int, provider: IServiceProvider) : AbsApi(acco } } - override fun removePage(userId: Int?, groupId: Int?): Single { + override fun removePage(userId: Long?, groupId: Long?): Single { return provideService(IFaveService(), TokenType.USER) .flatMap { service -> service.removePage(userId, groupId) @@ -190,7 +190,7 @@ internal class FaveApi(accountId: Int, provider: IServiceProvider) : AbsApi(acco } } - override fun removeArticle(owner_id: Int?, article_id: Int?): Single { + override fun removeArticle(owner_id: Long?, article_id: Int?): Single { return provideService(IFaveService(), TokenType.USER) .flatMap { service -> service.removeArticle(owner_id, article_id) @@ -199,7 +199,7 @@ internal class FaveApi(accountId: Int, provider: IServiceProvider) : AbsApi(acco } } - override fun removeProduct(id: Int?, owner_id: Int?): Single { + override fun removeProduct(id: Int?, owner_id: Long?): Single { return provideService(IFaveService(), TokenType.USER) .flatMap { service -> service.removeProduct(id, owner_id) @@ -208,7 +208,7 @@ internal class FaveApi(accountId: Int, provider: IServiceProvider) : AbsApi(acco } } - override fun removePost(owner_id: Int?, id: Int?): Single { + override fun removePost(owner_id: Long?, id: Int?): Single { return provideService(IFaveService(), TokenType.USER) .flatMap { service -> service.removePost(owner_id, id) @@ -217,7 +217,7 @@ internal class FaveApi(accountId: Int, provider: IServiceProvider) : AbsApi(acco } } - override fun removeVideo(owner_id: Int?, id: Int?): Single { + override fun removeVideo(owner_id: Long?, id: Int?): Single { return provideService(IFaveService(), TokenType.USER) .flatMap { service -> service.removeVideo(owner_id, id) @@ -226,7 +226,7 @@ internal class FaveApi(accountId: Int, provider: IServiceProvider) : AbsApi(acco } } - override fun pushFirst(owner_id: Int): Single { + override fun pushFirst(owner_id: Long): Single { return provideService(IFaveService(), TokenType.USER) .flatMap { service -> service.pushFirst( diff --git a/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/api/impl/FriendsApi.kt b/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/api/impl/FriendsApi.kt index 6e7b0a366..32d285c46 100644 --- a/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/api/impl/FriendsApi.kt +++ b/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/api/impl/FriendsApi.kt @@ -12,10 +12,10 @@ import dev.ragnarok.fenrir.api.model.response.OnlineFriendsResponse import dev.ragnarok.fenrir.api.services.IFriendsService import io.reactivex.rxjava3.core.Single -internal class FriendsApi(accountId: Int, provider: IServiceProvider) : +internal class FriendsApi(accountId: Long, provider: IServiceProvider) : AbsApi(accountId, provider), IFriendsApi { override fun getOnline( - userId: Int, + userId: Long, order: String?, count: Int, offset: Int, @@ -70,7 +70,7 @@ internal class FriendsApi(accountId: Int, provider: IServiceProvider) : .map(extractResponseWithErrorHandling())); }*/ override fun get( - userId: Int?, order: String?, listId: Int?, count: Int?, + userId: Long?, order: String?, listId: Int?, count: Int?, offset: Int?, fields: String?, nameCase: String? ): Single> { return provideService(IFriendsService(), TokenType.USER, TokenType.SERVICE) @@ -101,7 +101,7 @@ internal class FriendsApi(accountId: Int, provider: IServiceProvider) : } override fun deleteSubscriber( - subscriber_id: Int + subscriber_id: Long ): Single { return provideService(IFriendsService(), TokenType.USER) .flatMap { service -> @@ -110,7 +110,7 @@ internal class FriendsApi(accountId: Int, provider: IServiceProvider) : } } - override fun getLists(userId: Int?, returnSystem: Boolean?): Single> { + override fun getLists(userId: Long?, returnSystem: Boolean?): Single> { return provideService(IFriendsService(), TokenType.USER) .flatMap { service -> service.getLists(userId, integerFromBoolean(returnSystem)) @@ -118,7 +118,7 @@ internal class FriendsApi(accountId: Int, provider: IServiceProvider) : } } - override fun delete(userId: Int): Single { + override fun delete(userId: Long): Single { return provideService(IFriendsService(), TokenType.USER) .flatMap { service -> service.delete(userId) @@ -126,7 +126,7 @@ internal class FriendsApi(accountId: Int, provider: IServiceProvider) : } } - override fun add(userId: Int, text: String?, follow: Boolean?): Single { + override fun add(userId: Long, text: String?, follow: Boolean?): Single { return provideService(IFriendsService(), TokenType.USER) .flatMap { service -> service.add(userId, text, integerFromBoolean(follow)) @@ -135,7 +135,7 @@ internal class FriendsApi(accountId: Int, provider: IServiceProvider) : } override fun search( - userId: Int, + userId: Long, query: String?, fields: String?, nameCase: String?, @@ -150,8 +150,8 @@ internal class FriendsApi(accountId: Int, provider: IServiceProvider) : } override fun getMutual( - sourceUid: Int?, - targetUid: Int, + sourceUid: Long?, + targetUid: Long, count: Int, offset: Int, fields: String? diff --git a/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/api/impl/GroupsApi.kt b/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/api/impl/GroupsApi.kt index 5db1ba6bb..53ac58c72 100644 --- a/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/api/impl/GroupsApi.kt +++ b/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/api/impl/GroupsApi.kt @@ -14,11 +14,11 @@ import dev.ragnarok.fenrir.util.Utils.safeCountOf import io.reactivex.rxjava3.core.Completable import io.reactivex.rxjava3.core.Single -internal class GroupsApi(accountId: Int, provider: IServiceProvider) : +internal class GroupsApi(accountId: Long, provider: IServiceProvider) : AbsApi(accountId, provider), IGroupsApi { override fun editManager( - groupId: Int, - userId: Int, + groupId: Long, + userId: Long, role: String?, isContact: Boolean?, contactPosition: String?, @@ -43,7 +43,7 @@ internal class GroupsApi(accountId: Int, provider: IServiceProvider) : } override fun edit( - groupId: Int, + groupId: Long, title: String?, description: String?, screen_name: String?, @@ -73,7 +73,7 @@ internal class GroupsApi(accountId: Int, provider: IServiceProvider) : } } - override fun unban(groupId: Int, ownerId: Int): Completable { + override fun unban(groupId: Long, ownerId: Long): Completable { return provideService(IGroupsService(), TokenType.USER, TokenType.COMMUNITY) .flatMapCompletable { service -> service @@ -84,8 +84,8 @@ internal class GroupsApi(accountId: Int, provider: IServiceProvider) : } override fun ban( - groupId: Int, - ownerId: Int, + groupId: Long, + ownerId: Long, endDate: Long?, reason: Int?, comment: String?, @@ -107,7 +107,7 @@ internal class GroupsApi(accountId: Int, provider: IServiceProvider) : } } - override fun getSettings(groupId: Int): Single { + override fun getSettings(groupId: Long): Single { return provideService(IGroupsService(), TokenType.USER, TokenType.COMMUNITY) .flatMap { service -> service @@ -117,7 +117,7 @@ internal class GroupsApi(accountId: Int, provider: IServiceProvider) : } override fun getMarketAlbums( - owner_id: Int, + owner_id: Long, offset: Int, count: Int ): Single> { @@ -129,7 +129,7 @@ internal class GroupsApi(accountId: Int, provider: IServiceProvider) : } override fun getMarket( - owner_id: Int, + owner_id: Long, album_id: Int?, offset: Int, count: Int, @@ -143,7 +143,7 @@ internal class GroupsApi(accountId: Int, provider: IServiceProvider) : } override fun getMarketServices( - owner_id: Int, + owner_id: Long, offset: Int, count: Int, extended: Int? @@ -166,11 +166,11 @@ internal class GroupsApi(accountId: Int, provider: IServiceProvider) : } override fun getBanned( - groupId: Int, + groupId: Long, offset: Int?, count: Int?, fields: String?, - userId: Int? + userId: Long? ): Single> { return provideService(IGroupsService(), TokenType.USER, TokenType.COMMUNITY) .flatMap { service -> @@ -245,7 +245,7 @@ internal class GroupsApi(accountId: Int, provider: IServiceProvider) : } } - override fun leave(groupId: Int): Single { + override fun leave(groupId: Long): Single { return provideService(IGroupsService(), TokenType.USER) .flatMap { service -> service.leave(groupId) @@ -254,7 +254,7 @@ internal class GroupsApi(accountId: Int, provider: IServiceProvider) : } } - override fun join(groupId: Int, notSure: Int?): Single { + override fun join(groupId: Long, notSure: Int?): Single { return provideService(IGroupsService(), TokenType.USER) .flatMap { service -> service.join(groupId, notSure) @@ -264,7 +264,7 @@ internal class GroupsApi(accountId: Int, provider: IServiceProvider) : } override fun get( - userId: Int?, + userId: Long?, extended: Boolean?, filter: String?, fields: String?, @@ -278,7 +278,7 @@ internal class GroupsApi(accountId: Int, provider: IServiceProvider) : } } - override fun getLongPollServer(groupId: Int): Single { + override fun getLongPollServer(groupId: Long): Single { return provideService(IGroupsService(), TokenType.USER, TokenType.COMMUNITY) .flatMap { service -> service @@ -288,7 +288,7 @@ internal class GroupsApi(accountId: Int, provider: IServiceProvider) : } override fun getById( - ids: Collection, + ids: Collection, domains: Collection?, groupId: String?, fields: String? @@ -309,7 +309,11 @@ internal class GroupsApi(accountId: Int, provider: IServiceProvider) : } } - override fun getChats(groupId: Int, offset: Int?, count: Int?): Single> { + override fun getChats( + groupId: Long, + offset: Int?, + count: Int? + ): Single> { return provideService(IGroupsService(), TokenType.USER, TokenType.COMMUNITY) .flatMap { service -> service diff --git a/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/api/impl/LikesApi.kt b/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/api/impl/LikesApi.kt index c9769e91e..cc14977b6 100644 --- a/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/api/impl/LikesApi.kt +++ b/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/api/impl/LikesApi.kt @@ -8,10 +8,10 @@ import dev.ragnarok.fenrir.api.model.response.LikesListResponse import dev.ragnarok.fenrir.api.services.ILikesService import io.reactivex.rxjava3.core.Single -internal class LikesApi(accountId: Int, provider: IServiceProvider) : +internal class LikesApi(accountId: Long, provider: IServiceProvider) : AbsApi(accountId, provider), ILikesApi { override fun getList( - type: String?, ownerId: Int?, itemId: Int?, pageUrl: String?, + type: String?, ownerId: Long?, itemId: Int?, pageUrl: String?, filter: String?, friendsOnly: Boolean?, offset: Int?, count: Int?, skipOwn: Boolean?, fields: String? ): Single { @@ -28,7 +28,7 @@ internal class LikesApi(accountId: Int, provider: IServiceProvider) : override fun delete( type: String?, - ownerId: Int?, + ownerId: Long?, itemId: Int, accessKey: String? ): Single { @@ -40,7 +40,7 @@ internal class LikesApi(accountId: Int, provider: IServiceProvider) : } } - override fun add(type: String?, ownerId: Int?, itemId: Int, accessKey: String?): Single { + override fun add(type: String?, ownerId: Long?, itemId: Int, accessKey: String?): Single { return provideService(ILikesService(), TokenType.USER) .flatMap { service -> service.add(type, ownerId, itemId, accessKey) @@ -49,7 +49,7 @@ internal class LikesApi(accountId: Int, provider: IServiceProvider) : } } - override fun isLiked(type: String?, ownerId: Int?, itemId: Int): Single { + override fun isLiked(type: String?, ownerId: Long?, itemId: Int): Single { return provideService(ILikesService(), TokenType.USER) .flatMap { service -> service.isLiked(type, ownerId, itemId) @@ -60,7 +60,7 @@ internal class LikesApi(accountId: Int, provider: IServiceProvider) : override fun checkAndAddLike( type: String?, - ownerId: Int?, + ownerId: Long?, itemId: Int, accessKey: String? ): Single { diff --git a/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/api/impl/MessagesApi.kt b/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/api/impl/MessagesApi.kt index ed695a1fa..7bcf86747 100644 --- a/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/api/impl/MessagesApi.kt +++ b/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/api/impl/MessagesApi.kt @@ -11,14 +11,14 @@ import dev.ragnarok.fenrir.util.Utils.listEmptyIfNull import io.reactivex.rxjava3.core.Completable import io.reactivex.rxjava3.core.Single -internal class MessagesApi(accountId: Int, provider: IServiceProvider) : +internal class MessagesApi(accountId: Long, provider: IServiceProvider) : AbsApi(accountId, provider), IMessagesApi { private fun serviceRx(vararg tokenTypes: Int): Single { return provideService(IMessageService(), *tokenTypes) } override fun edit( - peerId: Int, + peerId: Long, messageId: Int, message: String?, attachments: List?, @@ -44,7 +44,7 @@ internal class MessagesApi(accountId: Int, provider: IServiceProvider) : } } - override fun removeChatMember(chatId: Int, memberId: Int): Single { + override fun removeChatMember(chatId: Long, memberId: Long): Single { return serviceRx(TokenType.USER, TokenType.COMMUNITY) .flatMap { service -> service @@ -54,7 +54,7 @@ internal class MessagesApi(accountId: Int, provider: IServiceProvider) : } } - override fun deleteChatPhoto(chatId: Int): Single { + override fun deleteChatPhoto(chatId: Long): Single { return serviceRx(TokenType.USER, TokenType.COMMUNITY) .flatMap { service -> service @@ -64,7 +64,7 @@ internal class MessagesApi(accountId: Int, provider: IServiceProvider) : } } - override fun addChatUser(chatId: Int, userId: Int): Single { + override fun addChatUser(chatId: Long, userId: Long): Single { return serviceRx(TokenType.USER, TokenType.COMMUNITY) .flatMap { service -> service @@ -75,8 +75,8 @@ internal class MessagesApi(accountId: Int, provider: IServiceProvider) : } override fun getChat( - chatId: Int?, - chatIds: Collection?, + chatId: Long?, + chatIds: Collection?, fields: String?, name_case: String? ): Single> { @@ -90,7 +90,7 @@ internal class MessagesApi(accountId: Int, provider: IServiceProvider) : } override fun getConversationMembers( - peer_id: Int?, + peer_id: Long?, fields: String? ): Single { return serviceRx(TokenType.USER, TokenType.COMMUNITY) @@ -101,7 +101,7 @@ internal class MessagesApi(accountId: Int, provider: IServiceProvider) : } } - override fun editChat(chatId: Int, title: String?): Single { + override fun editChat(chatId: Long, title: String?): Single { return serviceRx(TokenType.USER, TokenType.COMMUNITY) .flatMap { service -> service @@ -111,7 +111,7 @@ internal class MessagesApi(accountId: Int, provider: IServiceProvider) : } } - override fun createChat(userIds: Collection, title: String?): Single { + override fun createChat(userIds: Collection, title: String?): Single { return serviceRx(TokenType.USER, TokenType.COMMUNITY) .flatMap { service -> service @@ -129,7 +129,7 @@ internal class MessagesApi(accountId: Int, provider: IServiceProvider) : } } - override fun setMemberRole(peer_id: Int?, member_id: Int?, role: String?): Single { + override fun setMemberRole(peer_id: Long?, member_id: Long?, role: String?): Single { return serviceRx(TokenType.USER, TokenType.COMMUNITY) .flatMap { service -> service @@ -138,7 +138,7 @@ internal class MessagesApi(accountId: Int, provider: IServiceProvider) : } } - override fun deleteDialog(peerId: Int): Single { + override fun deleteDialog(peerId: Long): Single { return serviceRx(TokenType.USER, TokenType.COMMUNITY) .flatMap { service -> service @@ -174,7 +174,7 @@ internal class MessagesApi(accountId: Int, provider: IServiceProvider) : } } - override fun markAsRead(peerId: Int?, startMessageId: Int?): Single { + override fun markAsRead(peerId: Long?, startMessageId: Int?): Single { return serviceRx(TokenType.USER, TokenType.COMMUNITY) .flatMap { service -> service @@ -193,7 +193,7 @@ internal class MessagesApi(accountId: Int, provider: IServiceProvider) : } } - override fun setActivity(peerId: Int, typing: Boolean): Single { + override fun setActivity(peerId: Long, typing: Boolean): Single { return serviceRx(TokenType.USER, TokenType.COMMUNITY) .flatMap { service -> service @@ -205,7 +205,7 @@ internal class MessagesApi(accountId: Int, provider: IServiceProvider) : override fun search( query: String?, - peerId: Int?, + peerId: Long?, date: Long?, previewLength: Int?, offset: Int?, @@ -245,7 +245,7 @@ internal class MessagesApi(accountId: Int, provider: IServiceProvider) : } override fun getHistoryAttachments( - peerId: Int, + peerId: Long, mediaType: String?, startFrom: String?, photoSizes: Int?, @@ -261,7 +261,7 @@ internal class MessagesApi(accountId: Int, provider: IServiceProvider) : } override fun send( - randomId: Long?, peerId: Int?, domain: String?, message: String?, + randomId: Long?, peerId: Long?, domain: String?, message: String?, latitude: Double?, longitude: Double?, attachments: Collection?, forwardMessages: Collection?, stickerId: Int?, payload: String?, reply_to: Int? ): Single { @@ -280,7 +280,7 @@ internal class MessagesApi(accountId: Int, provider: IServiceProvider) : } override fun getConversations( - peers: List, + peers: List, extended: Boolean?, fields: String? ): Single> { @@ -316,7 +316,7 @@ internal class MessagesApi(accountId: Int, provider: IServiceProvider) : } - override fun unpin(peerId: Int): Completable { + override fun unpin(peerId: Long): Completable { return serviceRx(TokenType.USER, TokenType.COMMUNITY) .flatMapCompletable { service -> service.unpin(peerId) @@ -325,7 +325,7 @@ internal class MessagesApi(accountId: Int, provider: IServiceProvider) : } } - override fun pin(peerId: Int, messageId: Int): Completable { + override fun pin(peerId: Long, messageId: Int): Completable { return serviceRx(TokenType.USER, TokenType.COMMUNITY) .flatMapCompletable { service -> service.pin(peerId, messageId) @@ -334,7 +334,7 @@ internal class MessagesApi(accountId: Int, provider: IServiceProvider) : } } - override fun pinUnPinConversation(peerId: Int, peen: Boolean): Completable { + override fun pinUnPinConversation(peerId: Long, peen: Boolean): Completable { return serviceRx(TokenType.USER, TokenType.COMMUNITY) .flatMapCompletable { service -> (if (peen) service.pinConversation(peerId) else service.unpinConversation(peerId)) @@ -366,7 +366,7 @@ internal class MessagesApi(accountId: Int, provider: IServiceProvider) : override fun getHistory( offset: Int?, count: Int?, - peerId: Int, + peerId: Long, startMessageId: Int?, rev: Boolean?, extended: Boolean?, @@ -391,7 +391,7 @@ internal class MessagesApi(accountId: Int, provider: IServiceProvider) : override fun getJsonHistory( offset: Int?, count: Int?, - peerId: Int + peerId: Long ): Single> { return serviceRx(TokenType.USER, TokenType.COMMUNITY) .flatMap { service -> diff --git a/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/api/impl/Networker.kt b/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/api/impl/Networker.kt index 7be7e8b20..a9dbc9d72 100644 --- a/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/api/impl/Networker.kt +++ b/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/api/impl/Networker.kt @@ -11,11 +11,11 @@ class Networker(settings: IProxySettings) : INetworker { private val otherVkRestProvider: IOtherVkRestProvider private val vkRestProvider: IVkRestProvider private val uploadRestProvider: IUploadRestProvider - override fun vkDefault(accountId: Int): IAccountApis { + override fun vkDefault(accountId: Long): IAccountApis { return VkApies[accountId, vkRestProvider] } - override fun vkManual(accountId: Int, accessToken: String): IAccountApis { + override fun vkManual(accountId: Long, accessToken: String): IAccountApis { return VkApies.create(accountId, accessToken, vkRestProvider) } diff --git a/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/api/impl/NewsfeedApi.kt b/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/api/impl/NewsfeedApi.kt index 80a8fea5f..f87196e1f 100644 --- a/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/api/impl/NewsfeedApi.kt +++ b/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/api/impl/NewsfeedApi.kt @@ -14,7 +14,7 @@ import dev.ragnarok.fenrir.api.services.INewsfeedService import io.reactivex.rxjava3.core.Single import kotlin.math.abs -internal class NewsfeedApi(accountId: Int, provider: IServiceProvider) : +internal class NewsfeedApi(accountId: Long, provider: IServiceProvider) : AbsApi(accountId, provider), INewsfeedApi { override fun getLists(listIds: Collection?): Single> { return provideService(INewsfeedService(), TokenType.USER) @@ -24,7 +24,7 @@ internal class NewsfeedApi(accountId: Int, provider: IServiceProvider) : } } - override fun saveList(title: String?, listIds: Collection?): Single { + override fun saveList(title: String?, listIds: Collection?): Single { return provideService(INewsfeedService(), TokenType.USER) .flatMap { service -> service.saveList(title, join(listIds, ",")) @@ -32,9 +32,9 @@ internal class NewsfeedApi(accountId: Int, provider: IServiceProvider) : } } - override fun addBan(listIds: Collection): Single { - val users: ArrayList = ArrayList() - val groups: ArrayList = ArrayList() + override fun addBan(listIds: Collection): Single { + val users: ArrayList = ArrayList() + val groups: ArrayList = ArrayList() for (i in listIds) { if (i < 0) { groups.add(abs(i)) @@ -57,7 +57,7 @@ internal class NewsfeedApi(accountId: Int, provider: IServiceProvider) : } } - override fun ignoreItem(type: String?, owner_id: Int?, item_id: Int?): Single { + override fun ignoreItem(type: String?, owner_id: Long?, item_id: Int?): Single { return provideService(INewsfeedService(), TokenType.USER) .flatMap { service -> service.ignoreItem(type, owner_id, item_id) @@ -116,7 +116,7 @@ internal class NewsfeedApi(accountId: Int, provider: IServiceProvider) : } override fun getMentions( - owner_id: Int?, + owner_id: Long?, count: Int?, offset: Int?, startTime: Long?, @@ -194,9 +194,9 @@ internal class NewsfeedApi(accountId: Int, provider: IServiceProvider) : } } - override fun deleteBan(listIds: Collection): Single { - val users: ArrayList = ArrayList() - val groups: ArrayList = ArrayList() + override fun deleteBan(listIds: Collection): Single { + val users: ArrayList = ArrayList() + val groups: ArrayList = ArrayList() for (i in listIds) { if (i < 0) { groups.add(abs(i)) diff --git a/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/api/impl/NotificationsApi.kt b/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/api/impl/NotificationsApi.kt index a816b3d0c..b442caf70 100644 --- a/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/api/impl/NotificationsApi.kt +++ b/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/api/impl/NotificationsApi.kt @@ -11,7 +11,7 @@ import dev.ragnarok.fenrir.requireNonNull import dev.ragnarok.fenrir.util.Utils.safeCountOf import io.reactivex.rxjava3.core.Single -internal class NotificationsApi(accountId: Int, provider: IServiceProvider) : +internal class NotificationsApi(accountId: Long, provider: IServiceProvider) : AbsApi(accountId, provider), INotificationsApi { override fun markAsViewed(): Single { return provideService(INotificationsService(), TokenType.USER) diff --git a/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/api/impl/OtherApi.kt b/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/api/impl/OtherApi.kt index b36332bd3..421716f95 100644 --- a/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/api/impl/OtherApi.kt +++ b/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/api/impl/OtherApi.kt @@ -13,7 +13,7 @@ import okhttp3.Request import okhttp3.Response import okhttp3.ResponseBody -class OtherApi(private val accountId: Int, private val provider: IVkRestProvider) : IOtherApi { +class OtherApi(private val accountId: Long, private val provider: IVkRestProvider) : IOtherApi { override fun rawRequest( method: String, postParams: Map diff --git a/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/api/impl/PagesApi.kt b/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/api/impl/PagesApi.kt index c792ae766..a5639b7e0 100644 --- a/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/api/impl/PagesApi.kt +++ b/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/api/impl/PagesApi.kt @@ -7,10 +7,10 @@ import dev.ragnarok.fenrir.api.model.VKApiWikiPage import dev.ragnarok.fenrir.api.services.IPagesService import io.reactivex.rxjava3.core.Single -internal class PagesApi(accountId: Int, provider: IServiceProvider) : +internal class PagesApi(accountId: Long, provider: IServiceProvider) : AbsApi(accountId, provider), IPagesApi { override fun get( - ownerId: Int, + ownerId: Long, pageId: Int, global: Boolean?, sitePreview: Boolean?, diff --git a/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/api/impl/PhotosApi.kt b/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/api/impl/PhotosApi.kt index 52f5ff08d..265f57ac3 100644 --- a/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/api/impl/PhotosApi.kt +++ b/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/api/impl/PhotosApi.kt @@ -13,9 +13,9 @@ import dev.ragnarok.fenrir.api.services.IPhotosService import dev.ragnarok.fenrir.util.Utils.listEmptyIfNull import io.reactivex.rxjava3.core.Single -internal class PhotosApi(accountId: Int, provider: IServiceProvider) : +internal class PhotosApi(accountId: Long, provider: IServiceProvider) : AbsApi(accountId, provider), IPhotosApi { - override fun deleteAlbum(albumId: Int, groupId: Int?): Single { + override fun deleteAlbum(albumId: Int, groupId: Long?): Single { return provideService(IPhotosService(), TokenType.USER) .flatMap { service -> service.deleteAlbum(albumId, groupId) @@ -24,7 +24,7 @@ internal class PhotosApi(accountId: Int, provider: IServiceProvider) : } } - override fun restore(ownerId: Int?, photoId: Int): Single { + override fun restore(ownerId: Long?, photoId: Int): Single { return provideService(IPhotosService(), TokenType.USER) .flatMap { service -> service.restore(ownerId, photoId) @@ -33,7 +33,7 @@ internal class PhotosApi(accountId: Int, provider: IServiceProvider) : } } - override fun delete(ownerId: Int?, photoId: Int): Single { + override fun delete(ownerId: Long?, photoId: Int): Single { return provideService(IPhotosService(), TokenType.USER) .flatMap { service -> service.delete(ownerId, photoId) @@ -42,7 +42,7 @@ internal class PhotosApi(accountId: Int, provider: IServiceProvider) : } } - override fun deleteComment(ownerId: Int?, commentId: Int): Single { + override fun deleteComment(ownerId: Long?, commentId: Int): Single { return provideService(IPhotosService(), TokenType.USER) .flatMap { service -> service.deleteComment(ownerId, commentId) @@ -51,7 +51,7 @@ internal class PhotosApi(accountId: Int, provider: IServiceProvider) : } } - override fun restoreComment(ownerId: Int?, commentId: Int): Single { + override fun restoreComment(ownerId: Long?, commentId: Int): Single { return provideService(IPhotosService(), TokenType.USER) .flatMap { service -> service.restoreComment(ownerId, commentId) @@ -61,7 +61,7 @@ internal class PhotosApi(accountId: Int, provider: IServiceProvider) : } override fun editComment( - ownerId: Int?, commentId: Int, message: String?, + ownerId: Long?, commentId: Int, message: String?, attachments: Collection? ): Single { return provideService(IPhotosService(), TokenType.USER) @@ -81,7 +81,7 @@ internal class PhotosApi(accountId: Int, provider: IServiceProvider) : override fun createAlbum( title: String?, - groupId: Int?, + groupId: Long?, description: String?, privacyView: VKApiPrivacy?, privacyComment: VKApiPrivacy?, @@ -105,7 +105,7 @@ internal class PhotosApi(accountId: Int, provider: IServiceProvider) : albumId: Int, title: String?, description: String?, - ownerId: Int?, + ownerId: Long?, privacyView: VKApiPrivacy?, privacyComment: VKApiPrivacy?, uploadByAdminsOnly: Boolean?, @@ -125,7 +125,7 @@ internal class PhotosApi(accountId: Int, provider: IServiceProvider) : } } - override fun copy(ownerId: Int, photoId: Int, accessKey: String?): Single { + override fun copy(ownerId: Long, photoId: Int, accessKey: String?): Single { return provideService(IPhotosService(), TokenType.USER) .flatMap { service -> service.copy(ownerId, photoId, accessKey) @@ -134,7 +134,7 @@ internal class PhotosApi(accountId: Int, provider: IServiceProvider) : } override fun createComment( - ownerId: Int?, photoId: Int, fromGroup: Boolean?, message: String?, + ownerId: Long?, photoId: Int, fromGroup: Boolean?, message: String?, replyToComment: Int?, attachments: Collection?, stickerId: Int?, accessKey: String?, generatedUniqueId: Int? ): Single { @@ -160,7 +160,7 @@ internal class PhotosApi(accountId: Int, provider: IServiceProvider) : } override fun getComments( - ownerId: Int?, + ownerId: Long?, photoId: Int, needLikes: Boolean?, startCommentId: Int?, @@ -204,7 +204,7 @@ internal class PhotosApi(accountId: Int, provider: IServiceProvider) : } } - override fun getUploadServer(albumId: Int, groupId: Int?): Single { + override fun getUploadServer(albumId: Int, groupId: Long?): Single { return provideService(IPhotosService(), TokenType.USER) .flatMap { service -> service @@ -226,7 +226,7 @@ internal class PhotosApi(accountId: Int, provider: IServiceProvider) : } } - override fun getOwnerPhotoUploadServer(ownerId: Int?): Single { + override fun getOwnerPhotoUploadServer(ownerId: Long?): Single { return provideService(IPhotosService(), TokenType.USER) .flatMap { service -> service @@ -235,7 +235,7 @@ internal class PhotosApi(accountId: Int, provider: IServiceProvider) : } } - override fun getChatUploadServer(chat_id: Int?): Single { + override fun getChatUploadServer(chat_id: Long?): Single { return provideService(IPhotosService(), TokenType.USER, TokenType.COMMUNITY) .flatMap { service -> service @@ -254,7 +254,7 @@ internal class PhotosApi(accountId: Int, provider: IServiceProvider) : } override fun saveWallPhoto( - userId: Int?, groupId: Int?, photo: String?, + userId: Long?, groupId: Long?, photo: String?, server: Int, hash: String?, latitude: Double?, longitude: Double?, caption: String? ): Single> { @@ -275,7 +275,7 @@ internal class PhotosApi(accountId: Int, provider: IServiceProvider) : } } - override fun getWallUploadServer(groupId: Int?): Single { + override fun getWallUploadServer(groupId: Long?): Single { return provideService(IPhotosService(), TokenType.USER) .flatMap { service -> service @@ -285,7 +285,7 @@ internal class PhotosApi(accountId: Int, provider: IServiceProvider) : } override fun save( - albumId: Int, groupId: Int?, server: Int, photosList: String?, + albumId: Int, groupId: Long?, server: Int, photosList: String?, hash: String?, latitude: Double?, longitude: Double?, caption: String? ): Single> { return provideService(IPhotosService(), TokenType.USER) @@ -297,7 +297,7 @@ internal class PhotosApi(accountId: Int, provider: IServiceProvider) : } override fun get( - ownerId: Int?, albumId: String?, photoIds: Collection?, + ownerId: Long?, albumId: String?, photoIds: Collection?, rev: Boolean?, offset: Int?, count: Int? ): Single> { val photos = join(photoIds, ",") @@ -309,7 +309,7 @@ internal class PhotosApi(accountId: Int, provider: IServiceProvider) : } override fun getUsersPhoto( - ownerId: Int?, + ownerId: Long?, extended: Int?, sort: Int?, offset: Int?, @@ -323,7 +323,7 @@ internal class PhotosApi(accountId: Int, provider: IServiceProvider) : } override fun getAll( - ownerId: Int?, + ownerId: Long?, extended: Int?, photo_sizes: Int?, offset: Int?, @@ -356,7 +356,7 @@ internal class PhotosApi(accountId: Int, provider: IServiceProvider) : } override fun getAlbums( - ownerId: Int?, albumIds: Collection?, + ownerId: Long?, albumIds: Collection?, offset: Int?, count: Int?, needSystem: Boolean?, needCovers: Boolean? ): Single> { @@ -377,7 +377,7 @@ internal class PhotosApi(accountId: Int, provider: IServiceProvider) : } override fun getTags( - ownerId: Int?, + ownerId: Long?, photo_id: Int?, access_key: String? ): Single> { @@ -390,7 +390,7 @@ internal class PhotosApi(accountId: Int, provider: IServiceProvider) : } override fun getAllComments( - ownerId: Int?, + ownerId: Long?, album_id: Int?, need_likes: Int?, offset: Int?, @@ -434,7 +434,11 @@ internal class PhotosApi(accountId: Int, provider: IServiceProvider) : } companion object { - internal fun findAccessKey(data: Collection, id: Int, ownerId: Int): String? { + internal fun findAccessKey( + data: Collection, + id: Int, + ownerId: Long + ): String? { for (pair in data) { if (pair.id == id && pair.ownerId == ownerId) { return pair.accessKey diff --git a/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/api/impl/PollsApi.kt b/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/api/impl/PollsApi.kt index f522d1702..367b2695d 100644 --- a/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/api/impl/PollsApi.kt +++ b/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/api/impl/PollsApi.kt @@ -13,13 +13,13 @@ import io.reactivex.rxjava3.core.Single import kotlinx.serialization.builtins.ListSerializer import kotlinx.serialization.builtins.serializer -internal class PollsApi(accountId: Int, provider: IServiceProvider) : +internal class PollsApi(accountId: Long, provider: IServiceProvider) : AbsApi(accountId, provider), IPollsApi { override fun create( question: String?, isAnonymous: Boolean?, isMultiple: Boolean?, - ownerId: Int, + ownerId: Long, addAnswers: List ): Single { return provideService(IPollsService(), TokenType.USER) @@ -37,7 +37,7 @@ internal class PollsApi(accountId: Int, provider: IServiceProvider) : } override fun deleteVote( - ownerId: Int?, + ownerId: Long?, pollId: Int, answerId: Long, isBoard: Boolean? @@ -51,7 +51,7 @@ internal class PollsApi(accountId: Int, provider: IServiceProvider) : } override fun addVote( - ownerId: Int, + ownerId: Long, pollId: Int, answerIds: Set, isBoard: Boolean? @@ -64,7 +64,7 @@ internal class PollsApi(accountId: Int, provider: IServiceProvider) : } } - override fun getById(ownerId: Int, isBoard: Boolean?, pollId: Int): Single { + override fun getById(ownerId: Long, isBoard: Boolean?, pollId: Int): Single { return provideService(IPollsService(), TokenType.USER) .flatMap { service -> service.getById(ownerId, integerFromBoolean(isBoard), pollId) @@ -73,7 +73,7 @@ internal class PollsApi(accountId: Int, provider: IServiceProvider) : } override fun getVoters( - ownerId: Int, + ownerId: Long, pollId: Int, isBoard: Int?, answer_ids: List, offset: Int?, count: Int? diff --git a/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/api/impl/StatusApi.kt b/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/api/impl/StatusApi.kt index 9102a6255..d4d8980a9 100644 --- a/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/api/impl/StatusApi.kt +++ b/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/api/impl/StatusApi.kt @@ -6,9 +6,9 @@ import dev.ragnarok.fenrir.api.interfaces.IStatusApi import dev.ragnarok.fenrir.api.services.IStatusService import io.reactivex.rxjava3.core.Single -internal class StatusApi(accountId: Int, provider: IServiceProvider) : +internal class StatusApi(accountId: Long, provider: IServiceProvider) : AbsApi(accountId, provider), IStatusApi { - override fun set(text: String?, groupId: Int?): Single { + override fun set(text: String?, groupId: Long?): Single { return provideService(IStatusService(), TokenType.USER) .flatMap { service -> service.set(text, groupId) diff --git a/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/api/impl/StoreApi.kt b/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/api/impl/StoreApi.kt index 1452225bd..e25319171 100644 --- a/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/api/impl/StoreApi.kt +++ b/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/api/impl/StoreApi.kt @@ -9,7 +9,7 @@ import dev.ragnarok.fenrir.api.model.VKApiStickersKeywords import dev.ragnarok.fenrir.api.services.IStoreService import io.reactivex.rxjava3.core.Single -internal class StoreApi(accountId: Int, provider: IServiceProvider) : +internal class StoreApi(accountId: Long, provider: IServiceProvider) : AbsApi(accountId, provider), IStoreApi { override val stickerKeywords: Single get() = provideService(IStoreService(), TokenType.USER) diff --git a/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/api/impl/UsersApi.kt b/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/api/impl/UsersApi.kt index 54fb22f5d..f69db42c2 100644 --- a/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/api/impl/UsersApi.kt +++ b/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/api/impl/UsersApi.kt @@ -15,10 +15,10 @@ import dev.ragnarok.fenrir.requireNonNull import dev.ragnarok.fenrir.util.Utils.safeCountOf import io.reactivex.rxjava3.core.Single -internal class UsersApi(accountId: Int, provider: IServiceProvider) : +internal class UsersApi(accountId: Long, provider: IServiceProvider) : AbsApi(accountId, provider), IUsersApi { override fun getUserWallInfo( - userId: Int, + userId: Long, fields: String?, nameCase: String? ): Single { @@ -59,7 +59,7 @@ internal class UsersApi(accountId: Int, provider: IServiceProvider) : } override fun getFollowers( - userId: Int?, + userId: Long?, offset: Int?, count: Int?, fields: String?, @@ -118,7 +118,7 @@ internal class UsersApi(accountId: Int, provider: IServiceProvider) : interests: String?, company: String?, position: String?, - groupId: Int?, + groupId: Long?, fromList: String? ): Single> { return provideService(IUsersService(), TokenType.USER) @@ -163,7 +163,7 @@ internal class UsersApi(accountId: Int, provider: IServiceProvider) : } } - override fun report(userId: Int?, type: String?, comment: String?): Single { + override fun report(userId: Long?, type: String?, comment: String?): Single { return provideService(IUsersService(), TokenType.USER, TokenType.COMMUNITY) .flatMap { service -> service @@ -172,7 +172,7 @@ internal class UsersApi(accountId: Int, provider: IServiceProvider) : } } - override fun checkAndAddFriend(userId: Int?): Single { + override fun checkAndAddFriend(userId: Long?): Single { return provideService(IUsersService(), TokenType.USER) .flatMap { service -> service @@ -184,7 +184,7 @@ internal class UsersApi(accountId: Int, provider: IServiceProvider) : } } - override fun getStory(owner_id: Int?, extended: Int?, fields: String?): Single { + override fun getStory(owner_id: Long?, extended: Int?, fields: String?): Single { return provideService(IUsersService(), TokenType.USER, TokenType.COMMUNITY) .flatMap { service -> service.getStory(owner_id, extended, fields) @@ -193,7 +193,7 @@ internal class UsersApi(accountId: Int, provider: IServiceProvider) : } override fun getNarratives( - owner_id: Int, + owner_id: Long, offset: Int?, count: Int? ): Single> { @@ -217,7 +217,7 @@ internal class UsersApi(accountId: Int, provider: IServiceProvider) : } } - override fun getGifts(user_id: Int?, count: Int?, offset: Int?): Single> { + override fun getGifts(user_id: Long?, count: Int?, offset: Int?): Single> { return provideService(IUsersService(), TokenType.USER) .flatMap { service -> service.getGifts(user_id, count, offset) @@ -227,7 +227,7 @@ internal class UsersApi(accountId: Int, provider: IServiceProvider) : override fun searchStory( q: String?, - mentioned_id: Int?, + mentioned_id: Long?, count: Int?, extended: Int?, fields: String? @@ -240,7 +240,7 @@ internal class UsersApi(accountId: Int, provider: IServiceProvider) : } override fun get( - userIds: Collection?, + userIds: Collection?, domains: Collection?, fields: String?, nameCase: String? diff --git a/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/api/impl/UtilsApi.kt b/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/api/impl/UtilsApi.kt index 87db88bd6..9df0595b8 100644 --- a/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/api/impl/UtilsApi.kt +++ b/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/api/impl/UtilsApi.kt @@ -12,7 +12,7 @@ import dev.ragnarok.fenrir.api.model.response.VKApiLinkResponse import dev.ragnarok.fenrir.api.services.IUtilsService import io.reactivex.rxjava3.core.Single -internal class UtilsApi(accountId: Int, provider: IServiceProvider) : +internal class UtilsApi(accountId: Long, provider: IServiceProvider) : AbsApi(accountId, provider), IUtilsApi { override fun resolveScreenName(screenName: String?): Single { return provideService( @@ -77,7 +77,7 @@ internal class UtilsApi(accountId: Int, provider: IServiceProvider) : } } - override fun getInviteLink(peer_id: Int?, reset: Int?): Single { + override fun getInviteLink(peer_id: Long?, reset: Int?): Single { return provideService(IUtilsService(), TokenType.USER, TokenType.COMMUNITY) .flatMap { service -> service.getInviteLink(peer_id, reset) diff --git a/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/api/impl/VideoApi.kt b/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/api/impl/VideoApi.kt index f1c228e25..483a3e205 100644 --- a/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/api/impl/VideoApi.kt +++ b/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/api/impl/VideoApi.kt @@ -13,10 +13,10 @@ import dev.ragnarok.fenrir.api.model.response.SearchVideoResponse import dev.ragnarok.fenrir.api.services.IVideoService import io.reactivex.rxjava3.core.Single -internal class VideoApi(accountId: Int, provider: IServiceProvider) : +internal class VideoApi(accountId: Long, provider: IServiceProvider) : AbsApi(accountId, provider), IVideoApi { override fun getComments( - ownerId: Int?, videoId: Int, needLikes: Boolean?, startCommentId: Int?, offset: Int?, + ownerId: Long?, videoId: Int, needLikes: Boolean?, startCommentId: Int?, offset: Int?, count: Int?, sort: String?, extended: Boolean?, fields: String? ): Single { return provideService(IVideoService(), TokenType.USER) @@ -37,7 +37,7 @@ internal class VideoApi(accountId: Int, provider: IServiceProvider) : } } - override fun addVideo(targetId: Int?, videoId: Int?, ownerId: Int?): Single { + override fun addVideo(targetId: Long?, videoId: Int?, ownerId: Long?): Single { return provideService(IVideoService(), TokenType.USER) .flatMap { service -> service.addVideo(targetId, videoId, ownerId) @@ -45,7 +45,7 @@ internal class VideoApi(accountId: Int, provider: IServiceProvider) : } } - override fun deleteVideo(videoId: Int?, ownerId: Int?, targetId: Int?): Single { + override fun deleteVideo(videoId: Int?, ownerId: Long?, targetId: Long?): Single { return provideService(IVideoService(), TokenType.USER) .flatMap { service -> service.deleteVideo(videoId, ownerId, targetId) @@ -54,7 +54,7 @@ internal class VideoApi(accountId: Int, provider: IServiceProvider) : } override fun getAlbums( - ownerId: Int?, + ownerId: Long?, offset: Int?, count: Int?, needSystem: Boolean? @@ -67,8 +67,8 @@ internal class VideoApi(accountId: Int, provider: IServiceProvider) : } override fun getAlbumsByVideo( - target_id: Int?, - owner_id: Int?, + target_id: Long?, + owner_id: Long?, video_id: Int? ): Single> { return provideService(IVideoService(), TokenType.USER) @@ -103,7 +103,7 @@ internal class VideoApi(accountId: Int, provider: IServiceProvider) : } } - override fun restoreComment(ownerId: Int?, commentId: Int): Single { + override fun restoreComment(ownerId: Long?, commentId: Int): Single { return provideService(IVideoService(), TokenType.USER) .flatMap { service -> service.restoreComment(ownerId, commentId) @@ -112,7 +112,7 @@ internal class VideoApi(accountId: Int, provider: IServiceProvider) : } } - override fun deleteComment(ownerId: Int?, commentId: Int): Single { + override fun deleteComment(ownerId: Long?, commentId: Int): Single { return provideService(IVideoService(), TokenType.USER) .flatMap { service -> service.deleteComment(ownerId, commentId) @@ -123,7 +123,7 @@ internal class VideoApi(accountId: Int, provider: IServiceProvider) : override operator fun get( - ownerId: Int?, ids: Collection?, albumId: Int?, + ownerId: Long?, ids: Collection?, albumId: Int?, count: Int?, offset: Int?, extended: Boolean? ): Single> { val videos = @@ -136,7 +136,7 @@ internal class VideoApi(accountId: Int, provider: IServiceProvider) : } override fun createComment( - ownerId: Int, videoId: Int, message: String?, + ownerId: Long, videoId: Int, message: String?, attachments: Collection?, fromGroup: Boolean?, replyToComment: Int?, stickerId: Int?, uniqueGeneratedId: Int? ): Single { @@ -156,7 +156,7 @@ internal class VideoApi(accountId: Int, provider: IServiceProvider) : override fun editComment( - ownerId: Int, commentId: Int, message: String?, + ownerId: Long, commentId: Int, message: String?, attachments: Collection? ): Single { return provideService(IVideoService(), TokenType.USER) @@ -175,7 +175,7 @@ internal class VideoApi(accountId: Int, provider: IServiceProvider) : } override - fun edit(ownerId: Int, video_id: Int, name: String?, desc: String?): Single { + fun edit(ownerId: Long, video_id: Int, name: String?, desc: String?): Single { return provideService(IVideoService(), TokenType.USER) .flatMap { service -> service.edit(ownerId, video_id, name, desc) diff --git a/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/api/impl/VkApies.kt b/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/api/impl/VkApies.kt index caab4f28b..f23720a37 100644 --- a/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/api/impl/VkApies.kt +++ b/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/api/impl/VkApies.kt @@ -11,7 +11,7 @@ import dev.ragnarok.fenrir.util.Utils import io.reactivex.rxjava3.core.Single internal class VkApies private constructor( - accountId: Int, + accountId: Long, useCustomToken: Boolean, customAccessToken: String?, provider: IVkRestProvider @@ -133,13 +133,13 @@ internal class VkApies private constructor( companion object { @SuppressLint("UseSparseArrays") - private val APIS: MutableMap = HashMap(1) - fun create(accountId: Int, accessToken: String?, provider: IVkRestProvider): VkApies { + private val APIS: MutableMap = HashMap(1) + fun create(accountId: Long, accessToken: String?, provider: IVkRestProvider): VkApies { return VkApies(accountId, true, accessToken, provider) } @Synchronized - operator fun get(accountId: Int, provider: IVkRestProvider): VkApies { + operator fun get(accountId: Long, provider: IVkRestProvider): VkApies { var apies = APIS[accountId] if (apies == null) { apies = VkApies(accountId, false, null, provider) @@ -152,7 +152,7 @@ internal class VkApies private constructor( init { val restProvider: IServiceProvider = object : IServiceProvider { override fun provideService( - accountId: Int, + accountId: Long, serviceClass: T, vararg tokenTypes: Int ): Single { @@ -165,7 +165,7 @@ internal class VkApies private constructor( } } - fun provideRest(aid: Int, vararg tokenPolicy: Int): Single { + fun provideRest(aid: Long, vararg tokenPolicy: Int): Single { if (useCustomToken) { return provider.provideCustomRest(aid, customAccessToken!!) } diff --git a/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/api/impl/WallApi.kt b/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/api/impl/WallApi.kt index e34d8e1e7..415ab2589 100644 --- a/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/api/impl/WallApi.kt +++ b/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/api/impl/WallApi.kt @@ -9,10 +9,10 @@ import dev.ragnarok.fenrir.api.model.response.* import dev.ragnarok.fenrir.api.services.IWallService import io.reactivex.rxjava3.core.Single -internal class WallApi(accountId: Int, provider: IServiceProvider) : AbsApi(accountId, provider), +internal class WallApi(accountId: Long, provider: IServiceProvider) : AbsApi(accountId, provider), IWallApi { override fun search( - ownerId: Int, + ownerId: Long, query: String?, ownersOnly: Boolean?, count: Int, @@ -32,7 +32,7 @@ internal class WallApi(accountId: Int, provider: IServiceProvider) : AbsApi(acco } override fun edit( - ownerId: Int?, + ownerId: Long?, postId: Int?, friendsOnly: Boolean?, message: String?, @@ -70,7 +70,7 @@ internal class WallApi(accountId: Int, provider: IServiceProvider) : AbsApi(acco } } - override fun pin(ownerId: Int?, postId: Int): Single { + override fun pin(ownerId: Long?, postId: Int): Single { return provideService(IWallService(), TokenType.USER) .flatMap { service -> service.pin(ownerId, postId) @@ -79,7 +79,7 @@ internal class WallApi(accountId: Int, provider: IServiceProvider) : AbsApi(acco } } - override fun unpin(ownerId: Int?, postId: Int): Single { + override fun unpin(ownerId: Long?, postId: Int): Single { return provideService(IWallService(), TokenType.USER) .flatMap { service -> service.unpin(ownerId, postId) @@ -89,10 +89,10 @@ internal class WallApi(accountId: Int, provider: IServiceProvider) : AbsApi(acco } override fun repost( - postOwnerId: Int, + postOwnerId: Long, postId: Int, message: String?, - groupId: Int?, + groupId: Long?, markAsAds: Boolean? ): Single { val obj = "wall" + postOwnerId + "_" + postId @@ -104,7 +104,7 @@ internal class WallApi(accountId: Int, provider: IServiceProvider) : AbsApi(acco } override fun post( - ownerId: Int?, + ownerId: Long?, friendsOnly: Boolean?, fromGroup: Boolean?, message: String?, @@ -148,7 +148,7 @@ internal class WallApi(accountId: Int, provider: IServiceProvider) : AbsApi(acco } } - override fun delete(ownerId: Int?, postId: Int): Single { + override fun delete(ownerId: Long?, postId: Int): Single { return provideService(IWallService(), TokenType.USER) .flatMap { service -> service.delete(ownerId, postId) @@ -157,7 +157,7 @@ internal class WallApi(accountId: Int, provider: IServiceProvider) : AbsApi(acco } } - override fun restoreComment(ownerId: Int?, commentId: Int): Single { + override fun restoreComment(ownerId: Long?, commentId: Int): Single { return provideService(IWallService(), TokenType.USER) .flatMap { service -> service.restoreComment(ownerId, commentId) @@ -166,7 +166,7 @@ internal class WallApi(accountId: Int, provider: IServiceProvider) : AbsApi(acco } } - override fun deleteComment(ownerId: Int?, commentId: Int): Single { + override fun deleteComment(ownerId: Long?, commentId: Int): Single { return provideService(IWallService(), TokenType.USER) .flatMap { service -> service.deleteComment(ownerId, commentId) @@ -175,7 +175,7 @@ internal class WallApi(accountId: Int, provider: IServiceProvider) : AbsApi(acco } } - override fun restore(ownerId: Int?, postId: Int): Single { + override fun restore(ownerId: Long?, postId: Int): Single { return provideService(IWallService(), TokenType.USER) .flatMap { service -> service.restore(ownerId, postId) @@ -185,7 +185,7 @@ internal class WallApi(accountId: Int, provider: IServiceProvider) : AbsApi(acco } override fun editComment( - ownerId: Int?, commentId: Int, message: String?, + ownerId: Long?, commentId: Int, message: String?, attachments: Collection? ): Single { return provideService(IWallService(), TokenType.USER) @@ -204,7 +204,7 @@ internal class WallApi(accountId: Int, provider: IServiceProvider) : AbsApi(acco } override fun createComment( - ownerId: Int?, postId: Int, fromGroup: Int?, message: String?, + ownerId: Long?, postId: Int, fromGroup: Long?, message: String?, replyToComment: Int?, attachments: Collection?, stickerId: Int?, generatedUniqueId: Int? ): Single { @@ -230,7 +230,7 @@ internal class WallApi(accountId: Int, provider: IServiceProvider) : AbsApi(acco } override fun get( - ownerId: Int?, + ownerId: Long?, domain: String?, offset: Int?, count: Int?, @@ -265,7 +265,7 @@ internal class WallApi(accountId: Int, provider: IServiceProvider) : AbsApi(acco } } - override fun reportPost(owner_id: Int?, post_id: Int?, reason: Int?): Single { + override fun reportPost(owner_id: Long?, post_id: Int?, reason: Int?): Single { return provideService(IWallService(), TokenType.USER) .flatMap { service -> service @@ -274,7 +274,7 @@ internal class WallApi(accountId: Int, provider: IServiceProvider) : AbsApi(acco } } - override fun subscribe(owner_id: Int?): Single { + override fun subscribe(owner_id: Long?): Single { return provideService(IWallService(), TokenType.USER) .flatMap { service -> service @@ -283,7 +283,7 @@ internal class WallApi(accountId: Int, provider: IServiceProvider) : AbsApi(acco } } - override fun unsubscribe(owner_id: Int?): Single { + override fun unsubscribe(owner_id: Long?): Single { return provideService(IWallService(), TokenType.USER) .flatMap { service -> service @@ -292,7 +292,7 @@ internal class WallApi(accountId: Int, provider: IServiceProvider) : AbsApi(acco } } - override fun reportComment(owner_id: Int?, post_id: Int?, reason: Int?): Single { + override fun reportComment(owner_id: Long?, post_id: Int?, reason: Int?): Single { return provideService(IWallService(), TokenType.USER) .flatMap { service -> service @@ -302,7 +302,7 @@ internal class WallApi(accountId: Int, provider: IServiceProvider) : AbsApi(acco } override fun getComments( - ownerId: Int, postId: Int, needLikes: Boolean?, + ownerId: Long, postId: Int, needLikes: Boolean?, startCommentId: Int?, offset: Int?, count: Int?, sort: String?, extended: Boolean?, fields: String? ): Single { diff --git a/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/api/interfaces/IAccountApi.kt b/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/api/interfaces/IAccountApi.kt index 1c9bdabfb..a051713a7 100644 --- a/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/api/interfaces/IAccountApi.kt +++ b/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/api/interfaces/IAccountApi.kt @@ -13,10 +13,10 @@ import io.reactivex.rxjava3.core.Single interface IAccountApi { @CheckResult - fun ban(ownerId: Int): Single + fun ban(ownerId: Long): Single @CheckResult - fun unban(ownerId: Int): Single + fun unban(ownerId: Long): Single fun getBanned(count: Int?, offset: Int?, fields: String?): Single @CheckResult diff --git a/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/api/interfaces/IAudioApi.kt b/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/api/interfaces/IAudioApi.kt index 8ab1a38d2..c74b35ea9 100644 --- a/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/api/interfaces/IAudioApi.kt +++ b/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/api/interfaces/IAudioApi.kt @@ -13,7 +13,7 @@ import io.reactivex.rxjava3.core.Single interface IAudioApi { @CheckResult - fun setBroadcast(audio: AccessIdPair, targetIds: Collection): Single> + fun setBroadcast(audio: AccessIdPair, targetIds: Collection): Single> @CheckResult fun search( @@ -33,14 +33,14 @@ interface IAudioApi { ): Single> @CheckResult - fun restore(audioId: Int, ownerId: Int?): Single + fun restore(audioId: Int, ownerId: Long?): Single @CheckResult - fun delete(audioId: Int, ownerId: Int): Single + fun delete(audioId: Int, ownerId: Long): Single @CheckResult fun edit( - ownerId: Int, + ownerId: Long, audioId: Int, artist: String?, title: String?, @@ -48,18 +48,18 @@ interface IAudioApi { ): Single @CheckResult - fun add(audioId: Int, ownerId: Int, groupId: Int?, accessKey: String?): Single + fun add(audioId: Int, ownerId: Long, groupId: Long?, accessKey: String?): Single @CheckResult fun createPlaylist( - ownerId: Int, + ownerId: Long, title: String?, description: String? ): Single @CheckResult fun editPlaylist( - ownerId: Int, + ownerId: Long, playlist_id: Int, title: String?, description: String? @@ -67,27 +67,27 @@ interface IAudioApi { @CheckResult fun removeFromPlaylist( - ownerId: Int, + ownerId: Long, playlist_id: Int, audio_ids: Collection ): Single @CheckResult fun addToPlaylist( - ownerId: Int, + ownerId: Long, playlist_id: Int, audio_ids: Collection ): Single> @CheckResult - fun reorder(ownerId: Int, audio_id: Int, before: Int?, after: Int?): Single + fun reorder(ownerId: Long, audio_id: Int, before: Int?, after: Int?): Single @CheckResult fun trackEvents(events: String?): Single @CheckResult operator fun get( - playlist_id: Int?, ownerId: Int?, + playlist_id: Int?, ownerId: Long?, offset: Int?, count: Int?, accessKey: String? ): Single> @@ -105,27 +105,27 @@ interface IAudioApi { ): Single> @CheckResult - fun deletePlaylist(playlist_id: Int, ownerId: Int): Single + fun deletePlaylist(playlist_id: Int, ownerId: Long): Single @CheckResult fun followPlaylist( playlist_id: Int, - ownerId: Int, + ownerId: Long, accessKey: String? ): Single @CheckResult - fun clonePlaylist(playlist_id: Int, ownerId: Int): Single + fun clonePlaylist(playlist_id: Int, ownerId: Long): Single @CheckResult fun getPlaylistById( playlist_id: Int, - ownerId: Int, + ownerId: Long, accessKey: String? ): Single @CheckResult - fun getRecommendations(audioOwnerId: Int?, count: Int?): Single> + fun getRecommendations(audioOwnerId: Long?, count: Int?): Single> @CheckResult fun getRecommendationsByAudio(audio: String?, count: Int?): Single> @@ -140,7 +140,7 @@ interface IAudioApi { fun getLyrics(lyrics_id: Int): Single @CheckResult - fun getPlaylists(owner_id: Int, offset: Int, count: Int): Single> + fun getPlaylists(owner_id: Long, offset: Int, count: Int): Single> @CheckResult fun getPlaylistsCustom(code: String?): Single @@ -159,7 +159,7 @@ interface IAudioApi { @CheckResult fun getCatalogV2Sections( - owner_id: Int, artist_id: String?, url: String?, query: String?, context: String? + owner_id: Long, artist_id: String?, url: String?, query: String?, context: String? ): Single @CheckResult diff --git a/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/api/interfaces/IBoardApi.kt b/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/api/interfaces/IBoardApi.kt index 38af898ce..7e16c1442 100644 --- a/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/api/interfaces/IBoardApi.kt +++ b/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/api/interfaces/IBoardApi.kt @@ -9,33 +9,33 @@ import io.reactivex.rxjava3.core.Single interface IBoardApi { @CheckResult fun getComments( - groupId: Int, topicId: Int, needLikes: Boolean?, startCommentId: Int?, + groupId: Long, topicId: Int, needLikes: Boolean?, startCommentId: Int?, offset: Int?, count: Int?, extended: Boolean?, sort: String?, fields: String? ): Single @CheckResult - fun restoreComment(groupId: Int, topicId: Int, commentId: Int): Single + fun restoreComment(groupId: Long, topicId: Int, commentId: Int): Single @CheckResult - fun deleteComment(groupId: Int, topicId: Int, commentId: Int): Single + fun deleteComment(groupId: Long, topicId: Int, commentId: Int): Single @CheckResult fun getTopics( - groupId: Int, topicIds: Collection?, order: Int?, + groupId: Long, topicIds: Collection?, order: Int?, offset: Int?, count: Int?, extended: Boolean?, preview: Int?, previewLength: Int?, fields: String? ): Single @CheckResult fun editComment( - groupId: Int, topicId: Int, commentId: Int, + groupId: Long, topicId: Int, commentId: Int, message: String?, attachments: Collection? ): Single @CheckResult fun addComment( - groupId: Int?, topicId: Int, message: String?, + groupId: Long?, topicId: Int, message: String?, attachments: Collection?, fromGroup: Boolean?, stickerId: Int?, generatedUniqueId: Int? ): Single diff --git a/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/api/interfaces/ICommentsApi.kt b/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/api/interfaces/ICommentsApi.kt index 197db3887..d0238aa36 100644 --- a/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/api/interfaces/ICommentsApi.kt +++ b/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/api/interfaces/ICommentsApi.kt @@ -9,7 +9,7 @@ interface ICommentsApi { @CheckResult operator fun get( sourceType: String?, - ownerId: Int, + ownerId: Long, sourceId: Int, offset: Int?, count: Int?, diff --git a/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/api/interfaces/IDocsApi.kt b/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/api/interfaces/IDocsApi.kt index 76c22d86a..5d7b9523c 100644 --- a/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/api/interfaces/IDocsApi.kt +++ b/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/api/interfaces/IDocsApi.kt @@ -10,10 +10,10 @@ import io.reactivex.rxjava3.core.Single interface IDocsApi { @CheckResult - fun delete(ownerId: Int?, docId: Int): Single + fun delete(ownerId: Long?, docId: Int): Single @CheckResult - fun add(ownerId: Int, docId: Int, accessKey: String?): Single + fun add(ownerId: Long, docId: Int, accessKey: String?): Single @CheckResult fun getById(pairs: Collection): Single> @@ -25,21 +25,21 @@ interface IDocsApi { fun save(file: String?, title: String?, tags: String?): Single @CheckResult - fun getUploadServer(groupId: Int?): Single + fun getUploadServer(groupId: Long?): Single @CheckResult - fun getMessagesUploadServer(peerId: Int?, type: String?): Single + fun getMessagesUploadServer(peerId: Long?, type: String?): Single @CheckResult fun getVideoServer( isPrivate: Int?, - group_id: Int?, + group_id: Long?, name: String? ): Single @CheckResult operator fun get( - ownerId: Int?, + ownerId: Long?, count: Int?, offset: Int?, type: Int? diff --git a/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/api/interfaces/IFaveApi.kt b/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/api/interfaces/IFaveApi.kt index 193e9a149..889b43d61 100644 --- a/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/api/interfaces/IFaveApi.kt +++ b/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/api/interfaces/IFaveApi.kt @@ -29,7 +29,7 @@ interface IFaveApi { @CheckResult fun getOwnerPublishedArticles( - owner_id: Int?, + owner_id: Long?, offset: Int?, count: Int? ): Single> @@ -41,41 +41,41 @@ interface IFaveApi { fun getLinks(offset: Int?, count: Int?): Single> @CheckResult - fun addPage(userId: Int?, groupId: Int?): Single + fun addPage(userId: Long?, groupId: Long?): Single @CheckResult fun addLink(link: String?): Single @CheckResult - fun removePage(userId: Int?, groupId: Int?): Single + fun removePage(userId: Long?, groupId: Long?): Single @CheckResult fun removeLink(linkId: String?): Single @CheckResult - fun removeArticle(owner_id: Int?, article_id: Int?): Single + fun removeArticle(owner_id: Long?, article_id: Int?): Single @CheckResult - fun removePost(owner_id: Int?, id: Int?): Single + fun removePost(owner_id: Long?, id: Int?): Single @CheckResult - fun removeVideo(owner_id: Int?, id: Int?): Single + fun removeVideo(owner_id: Long?, id: Int?): Single @CheckResult - fun pushFirst(owner_id: Int): Single + fun pushFirst(owner_id: Long): Single @CheckResult - fun addVideo(owner_id: Int?, id: Int?, access_key: String?): Single + fun addVideo(owner_id: Long?, id: Int?, access_key: String?): Single @CheckResult fun addArticle(url: String?): Single @CheckResult - fun addProduct(id: Int, owner_id: Int, access_key: String?): Single + fun addProduct(id: Int, owner_id: Long, access_key: String?): Single @CheckResult - fun removeProduct(id: Int?, owner_id: Int?): Single + fun removeProduct(id: Int?, owner_id: Long?): Single @CheckResult - fun addPost(owner_id: Int?, id: Int?, access_key: String?): Single + fun addPost(owner_id: Long?, id: Int?, access_key: String?): Single } \ No newline at end of file diff --git a/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/api/interfaces/IFriendsApi.kt b/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/api/interfaces/IFriendsApi.kt index 103b13c8a..28dce64af 100644 --- a/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/api/interfaces/IFriendsApi.kt +++ b/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/api/interfaces/IFriendsApi.kt @@ -11,13 +11,13 @@ import io.reactivex.rxjava3.core.Single interface IFriendsApi { @CheckResult fun getOnline( - userId: Int, order: String?, count: Int, + userId: Long, order: String?, count: Int, offset: Int, fields: String? ): Single @CheckResult operator fun get( - userId: Int?, order: String?, listId: Int?, count: Int?, offset: Int?, + userId: Long?, order: String?, listId: Int?, count: Int?, offset: Int?, fields: String?, nameCase: String? ): Single> @@ -33,28 +33,28 @@ interface IFriendsApi { @CheckResult fun deleteSubscriber( - subscriber_id: Int + subscriber_id: Long ): Single @CheckResult - fun getLists(userId: Int?, returnSystem: Boolean?): Single> + fun getLists(userId: Long?, returnSystem: Boolean?): Single> @CheckResult - fun delete(userId: Int): Single + fun delete(userId: Long): Single @CheckResult - fun add(userId: Int, text: String?, follow: Boolean?): Single + fun add(userId: Long, text: String?, follow: Boolean?): Single @CheckResult fun search( - userId: Int, query: String?, fields: String?, nameCase: String?, + userId: Long, query: String?, fields: String?, nameCase: String?, offset: Int?, count: Int? ): Single> @CheckResult fun getMutual( - sourceUid: Int?, - targetUid: Int, + sourceUid: Long?, + targetUid: Long, count: Int, offset: Int, fields: String? diff --git a/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/api/interfaces/IGroupsApi.kt b/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/api/interfaces/IGroupsApi.kt index 69bd8d167..7d7cf6180 100644 --- a/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/api/interfaces/IGroupsApi.kt +++ b/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/api/interfaces/IGroupsApi.kt @@ -9,8 +9,8 @@ import io.reactivex.rxjava3.core.Single interface IGroupsApi { @CheckResult fun editManager( - groupId: Int, - userId: Int, + groupId: Long, + userId: Long, role: String?, isContact: Boolean?, contactPosition: String?, @@ -20,7 +20,7 @@ interface IGroupsApi { @CheckResult fun edit( - groupId: Int, + groupId: Long, title: String?, description: String?, screen_name: String?, @@ -35,12 +35,12 @@ interface IGroupsApi { ): Completable @CheckResult - fun unban(groupId: Int, ownerId: Int): Completable + fun unban(groupId: Long, ownerId: Long): Completable @CheckResult fun ban( - groupId: Int, - ownerId: Int, + groupId: Long, + ownerId: Long, endDate: Long?, reason: Int?, comment: String?, @@ -48,14 +48,14 @@ interface IGroupsApi { ): Completable @CheckResult - fun getSettings(groupId: Int): Single + fun getSettings(groupId: Long): Single @CheckResult - fun getMarketAlbums(owner_id: Int, offset: Int, count: Int): Single> + fun getMarketAlbums(owner_id: Long, offset: Int, count: Int): Single> @CheckResult fun getMarket( - owner_id: Int, + owner_id: Long, album_id: Int?, offset: Int, count: Int, @@ -64,7 +64,7 @@ interface IGroupsApi { @CheckResult fun getMarketServices( - owner_id: Int, + owner_id: Long, offset: Int, count: Int, extended: Int? @@ -75,11 +75,11 @@ interface IGroupsApi { @CheckResult fun getBanned( - groupId: Int, + groupId: Long, offset: Int?, count: Int?, fields: String?, - userId: Int? + userId: Long? ): Single> @CheckResult @@ -98,26 +98,26 @@ interface IGroupsApi { ): Single> @CheckResult - fun leave(groupId: Int): Single + fun leave(groupId: Long): Single @CheckResult - fun join(groupId: Int, notSure: Int?): Single + fun join(groupId: Long, notSure: Int?): Single @CheckResult operator fun get( - userId: Int?, extended: Boolean?, filter: String?, + userId: Long?, extended: Boolean?, filter: String?, fields: String?, offset: Int?, count: Int? ): Single> @CheckResult fun getById( - ids: Collection, domains: Collection?, + ids: Collection, domains: Collection?, groupId: String?, fields: String? ): Single> @CheckResult - fun getLongPollServer(groupId: Int): Single + fun getLongPollServer(groupId: Long): Single @CheckResult - fun getChats(groupId: Int, offset: Int?, count: Int?): Single> + fun getChats(groupId: Long, offset: Int?, count: Int?): Single> } \ No newline at end of file diff --git a/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/api/interfaces/ILikesApi.kt b/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/api/interfaces/ILikesApi.kt index 47d7f60ea..41282396c 100644 --- a/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/api/interfaces/ILikesApi.kt +++ b/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/api/interfaces/ILikesApi.kt @@ -7,23 +7,23 @@ import io.reactivex.rxjava3.core.Single interface ILikesApi { @CheckResult fun getList( - type: String?, ownerId: Int?, itemId: Int?, pageUrl: String?, filter: String?, + type: String?, ownerId: Long?, itemId: Int?, pageUrl: String?, filter: String?, friendsOnly: Boolean?, offset: Int?, count: Int?, skipOwn: Boolean?, fields: String? ): Single @CheckResult - fun delete(type: String?, ownerId: Int?, itemId: Int, accessKey: String?): Single + fun delete(type: String?, ownerId: Long?, itemId: Int, accessKey: String?): Single @CheckResult - fun add(type: String?, ownerId: Int?, itemId: Int, accessKey: String?): Single + fun add(type: String?, ownerId: Long?, itemId: Int, accessKey: String?): Single @CheckResult - fun isLiked(type: String?, ownerId: Int?, itemId: Int): Single + fun isLiked(type: String?, ownerId: Long?, itemId: Int): Single @CheckResult fun checkAndAddLike( type: String?, - ownerId: Int?, + ownerId: Long?, itemId: Int, accessKey: String? ): Single diff --git a/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/api/interfaces/IMessagesApi.kt b/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/api/interfaces/IMessagesApi.kt index bca330eb7..f7971b317 100644 --- a/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/api/interfaces/IMessagesApi.kt +++ b/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/api/interfaces/IMessagesApi.kt @@ -10,7 +10,7 @@ import io.reactivex.rxjava3.core.Single interface IMessagesApi { @CheckResult fun edit( - peerId: Int, + peerId: Long, messageId: Int, message: String?, attachments: List?, @@ -19,36 +19,36 @@ interface IMessagesApi { ): Completable @CheckResult - fun removeChatMember(chatId: Int, memberId: Int): Single + fun removeChatMember(chatId: Long, memberId: Long): Single @CheckResult - fun deleteChatPhoto(chatId: Int): Single + fun deleteChatPhoto(chatId: Long): Single @CheckResult - fun addChatUser(chatId: Int, userId: Int): Single + fun addChatUser(chatId: Long, userId: Long): Single @CheckResult fun getChat( - chatId: Int?, - chatIds: Collection?, + chatId: Long?, + chatIds: Collection?, fields: String?, name_case: String? ): Single> @CheckResult fun getConversationMembers( - peer_id: Int?, + peer_id: Long?, fields: String? ): Single @CheckResult - fun editChat(chatId: Int, title: String?): Single + fun editChat(chatId: Long, title: String?): Single @CheckResult - fun createChat(userIds: Collection, title: String?): Single + fun createChat(userIds: Collection, title: String?): Single @CheckResult - fun deleteDialog(peerId: Int): Single + fun deleteDialog(peerId: Long): Single @CheckResult fun restore(messageId: Int): Single @@ -61,14 +61,14 @@ interface IMessagesApi { ): Single> @CheckResult - fun markAsRead(peerId: Int?, startMessageId: Int?): Single + fun markAsRead(peerId: Long?, startMessageId: Int?): Single @CheckResult - fun setActivity(peerId: Int, typing: Boolean): Single + fun setActivity(peerId: Long, typing: Boolean): Single @CheckResult fun search( - query: String?, peerId: Int?, date: Long?, previewLength: Int?, + query: String?, peerId: Long?, date: Long?, previewLength: Int?, offset: Int?, count: Int? ): Single> @@ -85,13 +85,13 @@ interface IMessagesApi { @CheckResult fun getHistoryAttachments( - peerId: Int, mediaType: String?, startFrom: String?, photoSizes: Int?, + peerId: Long, mediaType: String?, startFrom: String?, photoSizes: Int?, count: Int?, fields: String? ): Single @CheckResult fun send( - randomId: Long?, peerId: Int?, domain: String?, message: String?, + randomId: Long?, peerId: Long?, domain: String?, message: String?, latitude: Double?, longitude: Double?, attachments: Collection?, forwardMessages: Collection?, stickerId: Int?, payload: String?, reply_to: Int? ): Single @@ -107,7 +107,7 @@ interface IMessagesApi { @CheckResult fun getConversations( - peers: List, + peers: List, extended: Boolean?, fields: String? ): Single> @@ -119,7 +119,7 @@ interface IMessagesApi { fun getHistory( offset: Int?, count: Int?, - peerId: Int, + peerId: Long, startMessageId: Int?, rev: Boolean?, extended: Boolean?, @@ -127,7 +127,7 @@ interface IMessagesApi { ): Single @CheckResult - fun getJsonHistory(offset: Int?, count: Int?, peerId: Int): Single> + fun getJsonHistory(offset: Int?, count: Int?, peerId: Long): Single> @CheckResult fun getImportantMessages( @@ -150,13 +150,13 @@ interface IMessagesApi { ): Single @CheckResult - fun pin(peerId: Int, messageId: Int): Completable + fun pin(peerId: Long, messageId: Int): Completable @CheckResult - fun unpin(peerId: Int): Completable + fun unpin(peerId: Long): Completable @CheckResult - fun pinUnPinConversation(peerId: Int, peen: Boolean): Completable + fun pinUnPinConversation(peerId: Long, peen: Boolean): Completable @CheckResult fun markAsListened(message_id: Int): Completable @@ -165,5 +165,5 @@ interface IMessagesApi { fun recogniseAudioMessage(message_id: Int?, audio_message_id: String?): Single @CheckResult - fun setMemberRole(peer_id: Int?, member_id: Int?, role: String?): Single + fun setMemberRole(peer_id: Long?, member_id: Long?, role: String?): Single } \ No newline at end of file diff --git a/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/api/interfaces/INetworker.kt b/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/api/interfaces/INetworker.kt index ca29330ad..9284dbc17 100644 --- a/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/api/interfaces/INetworker.kt +++ b/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/api/interfaces/INetworker.kt @@ -4,8 +4,8 @@ import dev.ragnarok.fenrir.api.IVkRestProvider interface INetworker { fun getVkRestProvider(): IVkRestProvider - fun vkDefault(accountId: Int): IAccountApis - fun vkManual(accountId: Int, accessToken: String): IAccountApis + fun vkDefault(accountId: Long): IAccountApis + fun vkManual(accountId: Long, accessToken: String): IAccountApis fun vkDirectAuth(): IAuthApi fun vkAuth(): IAuthApi fun localServerApi(): ILocalServerApi diff --git a/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/api/interfaces/INewsfeedApi.kt b/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/api/interfaces/INewsfeedApi.kt index fc4fb1fc2..6c5f6ef27 100644 --- a/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/api/interfaces/INewsfeedApi.kt +++ b/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/api/interfaces/INewsfeedApi.kt @@ -21,7 +21,7 @@ interface INewsfeedApi { ): Single @CheckResult - fun saveList(title: String?, listIds: Collection?): Single + fun saveList(title: String?, listIds: Collection?): Single @CheckResult fun deleteList(list_id: Int?): Single @@ -35,7 +35,7 @@ interface INewsfeedApi { @CheckResult fun getMentions( - owner_id: Int?, + owner_id: Long?, count: Int?, offset: Int?, startTime: Long?, @@ -70,13 +70,13 @@ interface INewsfeedApi { ): Single @CheckResult - fun addBan(listIds: Collection): Single + fun addBan(listIds: Collection): Single @CheckResult - fun ignoreItem(type: String?, owner_id: Int?, item_id: Int?): Single + fun ignoreItem(type: String?, owner_id: Long?, item_id: Int?): Single @CheckResult - fun deleteBan(listIds: Collection): Single + fun deleteBan(listIds: Collection): Single @CheckResult fun getBanned(): Single diff --git a/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/api/interfaces/IPagesApi.kt b/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/api/interfaces/IPagesApi.kt index 8af8dad2a..b8fd0ec3c 100644 --- a/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/api/interfaces/IPagesApi.kt +++ b/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/api/interfaces/IPagesApi.kt @@ -5,7 +5,7 @@ import io.reactivex.rxjava3.core.Single interface IPagesApi { operator fun get( - ownerId: Int, pageId: Int, global: Boolean?, sitePreview: Boolean?, + ownerId: Long, pageId: Int, global: Boolean?, sitePreview: Boolean?, title: String?, needSource: Boolean?, needHtml: Boolean? ): Single } \ No newline at end of file diff --git a/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/api/interfaces/IPhotosApi.kt b/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/api/interfaces/IPhotosApi.kt index bac3c2817..da2eba85c 100644 --- a/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/api/interfaces/IPhotosApi.kt +++ b/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/api/interfaces/IPhotosApi.kt @@ -11,53 +11,53 @@ import io.reactivex.rxjava3.core.Single interface IPhotosApi { @CheckResult - fun deleteAlbum(albumId: Int, groupId: Int?): Single + fun deleteAlbum(albumId: Int, groupId: Long?): Single @CheckResult - fun restore(ownerId: Int?, photoId: Int): Single + fun restore(ownerId: Long?, photoId: Int): Single @CheckResult - fun delete(ownerId: Int?, photoId: Int): Single + fun delete(ownerId: Long?, photoId: Int): Single @CheckResult - fun deleteComment(ownerId: Int?, commentId: Int): Single + fun deleteComment(ownerId: Long?, commentId: Int): Single @CheckResult - fun restoreComment(ownerId: Int?, commentId: Int): Single + fun restoreComment(ownerId: Long?, commentId: Int): Single @CheckResult fun editComment( - ownerId: Int?, commentId: Int, message: String?, + ownerId: Long?, commentId: Int, message: String?, attachments: Collection? ): Single @CheckResult fun createAlbum( - title: String?, groupId: Int?, description: String?, + title: String?, groupId: Long?, description: String?, privacyView: VKApiPrivacy?, privacyComment: VKApiPrivacy?, uploadByAdminsOnly: Boolean?, commentsDisabled: Boolean? ): Single @CheckResult fun editAlbum( - albumId: Int, title: String?, description: String?, ownerId: Int?, + albumId: Int, title: String?, description: String?, ownerId: Long?, privacyView: VKApiPrivacy?, privacyComment: VKApiPrivacy?, uploadByAdminsOnly: Boolean?, commentsDisabled: Boolean? ): Single @CheckResult - fun copy(ownerId: Int, photoId: Int, accessKey: String?): Single + fun copy(ownerId: Long, photoId: Int, accessKey: String?): Single @CheckResult fun createComment( - ownerId: Int?, photoId: Int, fromGroup: Boolean?, message: String?, + ownerId: Long?, photoId: Int, fromGroup: Boolean?, message: String?, replyToComment: Int?, attachments: Collection?, stickerId: Int?, accessKey: String?, generatedUniqueId: Int? ): Single @CheckResult fun getComments( - ownerId: Int?, photoId: Int, needLikes: Boolean?, + ownerId: Long?, photoId: Int, needLikes: Boolean?, startCommentId: Int?, offset: Int?, count: Int?, sort: String?, accessKey: String?, extended: Boolean?, fields: String? ): Single @@ -66,7 +66,7 @@ interface IPhotosApi { fun getById(ids: Collection): Single> @CheckResult - fun getUploadServer(albumId: Int, groupId: Int?): Single + fun getUploadServer(albumId: Int, groupId: Long?): Single @CheckResult fun saveOwnerPhoto( @@ -76,38 +76,38 @@ interface IPhotosApi { ): Single @CheckResult - fun getOwnerPhotoUploadServer(ownerId: Int?): Single + fun getOwnerPhotoUploadServer(ownerId: Long?): Single @CheckResult - fun getChatUploadServer(chat_id: Int?): Single + fun getChatUploadServer(chat_id: Long?): Single @CheckResult fun setChatPhoto(file: String?): Single @CheckResult fun saveWallPhoto( - userId: Int?, groupId: Int?, photo: String?, server: Int, + userId: Long?, groupId: Long?, photo: String?, server: Int, hash: String?, latitude: Double?, longitude: Double?, caption: String? ): Single> @CheckResult - fun getWallUploadServer(groupId: Int?): Single + fun getWallUploadServer(groupId: Long?): Single @CheckResult fun save( - albumId: Int, groupId: Int?, server: Int, photosList: String?, hash: String?, + albumId: Int, groupId: Long?, server: Int, photosList: String?, hash: String?, latitude: Double?, longitude: Double?, caption: String? ): Single> @CheckResult operator fun get( - ownerId: Int?, albumId: String?, photoIds: Collection?, rev: Boolean?, + ownerId: Long?, albumId: String?, photoIds: Collection?, rev: Boolean?, offset: Int?, count: Int? ): Single> @CheckResult fun getUsersPhoto( - ownerId: Int?, + ownerId: Long?, extended: Int?, sort: Int?, offset: Int?, @@ -116,7 +116,7 @@ interface IPhotosApi { @CheckResult fun getAll( - ownerId: Int?, + ownerId: Long?, extended: Int?, photo_sizes: Int?, offset: Int?, @@ -131,16 +131,16 @@ interface IPhotosApi { @CheckResult fun getAlbums( - ownerId: Int?, albumIds: Collection?, offset: Int?, + ownerId: Long?, albumIds: Collection?, offset: Int?, count: Int?, needSystem: Boolean?, needCovers: Boolean? ): Single> @CheckResult - fun getTags(ownerId: Int?, photo_id: Int?, access_key: String?): Single> + fun getTags(ownerId: Long?, photo_id: Int?, access_key: String?): Single> @CheckResult fun getAllComments( - ownerId: Int?, + ownerId: Long?, album_id: Int?, need_likes: Int?, offset: Int?, diff --git a/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/api/interfaces/IPollsApi.kt b/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/api/interfaces/IPollsApi.kt index ad46a09d7..8991e1f0a 100644 --- a/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/api/interfaces/IPollsApi.kt +++ b/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/api/interfaces/IPollsApi.kt @@ -11,27 +11,27 @@ interface IPollsApi { question: String?, isAnonymous: Boolean?, isMultiple: Boolean?, - ownerId: Int, + ownerId: Long, addAnswers: List ): Single @CheckResult - fun deleteVote(ownerId: Int?, pollId: Int, answerId: Long, isBoard: Boolean?): Single + fun deleteVote(ownerId: Long?, pollId: Int, answerId: Long, isBoard: Boolean?): Single @CheckResult fun addVote( - ownerId: Int, + ownerId: Long, pollId: Int, answerIds: Set, isBoard: Boolean? ): Single @CheckResult - fun getById(ownerId: Int, isBoard: Boolean?, pollId: Int): Single + fun getById(ownerId: Long, isBoard: Boolean?, pollId: Int): Single @CheckResult fun getVoters( - ownerId: Int, + ownerId: Long, pollId: Int, isBoard: Int?, answer_ids: List, diff --git a/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/api/interfaces/IStatusApi.kt b/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/api/interfaces/IStatusApi.kt index 48bcbbd0d..e9e28b8f3 100644 --- a/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/api/interfaces/IStatusApi.kt +++ b/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/api/interfaces/IStatusApi.kt @@ -5,5 +5,5 @@ import io.reactivex.rxjava3.core.Single interface IStatusApi { @CheckResult - operator fun set(text: String?, groupId: Int?): Single + operator fun set(text: String?, groupId: Long?): Single } \ No newline at end of file diff --git a/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/api/interfaces/IUsersApi.kt b/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/api/interfaces/IUsersApi.kt index ca6f15e85..d085a709c 100644 --- a/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/api/interfaces/IUsersApi.kt +++ b/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/api/interfaces/IUsersApi.kt @@ -9,11 +9,11 @@ import io.reactivex.rxjava3.core.Single interface IUsersApi { @CheckResult - fun getUserWallInfo(userId: Int, fields: String?, nameCase: String?): Single + fun getUserWallInfo(userId: Long, fields: String?, nameCase: String?): Single @CheckResult fun getFollowers( - userId: Int?, offset: Int?, count: Int?, + userId: Long?, offset: Int?, count: Int?, fields: String?, nameCase: String? ): Single> @@ -37,12 +37,12 @@ interface IUsersApi { hasPhoto: Boolean?, schoolCountry: Int?, schoolCity: Int?, schoolClass: Int?, school: Int?, schoolYear: Int?, religion: String?, interests: String?, company: String?, - position: String?, groupId: Int?, fromList: String? + position: String?, groupId: Long?, fromList: String? ): Single> @CheckResult operator fun get( - userIds: Collection?, domains: Collection?, + userIds: Collection?, domains: Collection?, fields: String?, nameCase: String? ): Single> @@ -56,10 +56,10 @@ interface IUsersApi { fun stories_save(upload_results: String?): Single> @CheckResult - fun getStory(owner_id: Int?, extended: Int?, fields: String?): Single + fun getStory(owner_id: Long?, extended: Int?, fields: String?): Single @CheckResult - fun getNarratives(owner_id: Int, offset: Int?, count: Int?): Single> + fun getNarratives(owner_id: Long, offset: Int?, count: Int?): Single> @CheckResult fun getStoryById( @@ -69,20 +69,20 @@ interface IUsersApi { ): Single @CheckResult - fun checkAndAddFriend(userId: Int?): Single + fun checkAndAddFriend(userId: Long?): Single @CheckResult - fun getGifts(user_id: Int?, count: Int?, offset: Int?): Single> + fun getGifts(user_id: Long?, count: Int?, offset: Int?): Single> @CheckResult fun searchStory( q: String?, - mentioned_id: Int?, + mentioned_id: Long?, count: Int?, extended: Int?, fields: String? ): Single @CheckResult - fun report(userId: Int?, type: String?, comment: String?): Single + fun report(userId: Long?, type: String?, comment: String?): Single } \ No newline at end of file diff --git a/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/api/interfaces/IUtilsApi.kt b/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/api/interfaces/IUtilsApi.kt index f29bc3f60..a5d74cdb6 100644 --- a/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/api/interfaces/IUtilsApi.kt +++ b/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/api/interfaces/IUtilsApi.kt @@ -29,7 +29,7 @@ interface IUtilsApi { fun joinChatByInviteLink(link: String?): Single @CheckResult - fun getInviteLink(peer_id: Int?, reset: Int?): Single + fun getInviteLink(peer_id: Long?, reset: Int?): Single @CheckResult fun customScript(code: String?): Single diff --git a/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/api/interfaces/IVideoApi.kt b/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/api/interfaces/IVideoApi.kt index 2d79c2402..079b1df0a 100644 --- a/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/api/interfaces/IVideoApi.kt +++ b/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/api/interfaces/IVideoApi.kt @@ -13,20 +13,20 @@ import io.reactivex.rxjava3.core.Single interface IVideoApi { @CheckResult fun getComments( - ownerId: Int?, videoId: Int, needLikes: Boolean?, + ownerId: Long?, videoId: Int, needLikes: Boolean?, startCommentId: Int?, offset: Int?, count: Int?, sort: String?, extended: Boolean?, fields: String? ): Single @CheckResult - fun addVideo(targetId: Int?, videoId: Int?, ownerId: Int?): Single + fun addVideo(targetId: Long?, videoId: Int?, ownerId: Long?): Single @CheckResult - fun deleteVideo(videoId: Int?, ownerId: Int?, targetId: Int?): Single + fun deleteVideo(videoId: Int?, ownerId: Long?, targetId: Long?): Single @CheckResult fun getAlbums( - ownerId: Int?, + ownerId: Long?, offset: Int?, count: Int?, needSystem: Boolean? @@ -34,8 +34,8 @@ interface IVideoApi { @CheckResult fun getAlbumsByVideo( - target_id: Int?, - owner_id: Int?, + target_id: Long?, + owner_id: Long?, video_id: Int? ): Single> @@ -47,32 +47,32 @@ interface IVideoApi { ): Single @CheckResult - fun restoreComment(ownerId: Int?, commentId: Int): Single + fun restoreComment(ownerId: Long?, commentId: Int): Single @CheckResult - fun deleteComment(ownerId: Int?, commentId: Int): Single + fun deleteComment(ownerId: Long?, commentId: Int): Single @CheckResult operator fun get( - ownerId: Int?, ids: Collection?, albumId: Int?, + ownerId: Long?, ids: Collection?, albumId: Int?, count: Int?, offset: Int?, extended: Boolean? ): Single> @CheckResult fun createComment( - ownerId: Int, videoId: Int, message: String?, + ownerId: Long, videoId: Int, message: String?, attachments: Collection?, fromGroup: Boolean?, replyToComment: Int?, stickerId: Int?, uniqueGeneratedId: Int? ): Single @CheckResult fun editComment( - ownerId: Int, + ownerId: Long, commentId: Int, message: String?, attachments: Collection? ): Single @CheckResult - fun edit(ownerId: Int, video_id: Int, name: String?, desc: String?): Single + fun edit(ownerId: Long, video_id: Int, name: String?, desc: String?): Single } \ No newline at end of file diff --git a/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/api/interfaces/IWallApi.kt b/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/api/interfaces/IWallApi.kt index 3fa3cc489..8d82d0a07 100644 --- a/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/api/interfaces/IWallApi.kt +++ b/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/api/interfaces/IWallApi.kt @@ -8,56 +8,56 @@ import io.reactivex.rxjava3.core.Single interface IWallApi { fun search( - ownerId: Int, query: String?, ownersOnly: Boolean?, + ownerId: Long, query: String?, ownersOnly: Boolean?, count: Int, offset: Int, extended: Boolean?, fields: String? ): Single @CheckResult fun edit( - ownerId: Int?, postId: Int?, friendsOnly: Boolean?, message: String?, + ownerId: Long?, postId: Int?, friendsOnly: Boolean?, message: String?, attachments: Collection?, services: String?, signed: Boolean?, publishDate: Long?, latitude: Double?, longitude: Double?, placeId: Int?, markAsAds: Boolean? ): Single @CheckResult - fun pin(ownerId: Int?, postId: Int): Single + fun pin(ownerId: Long?, postId: Int): Single @CheckResult - fun unpin(ownerId: Int?, postId: Int): Single + fun unpin(ownerId: Long?, postId: Int): Single @CheckResult fun repost( - postOwnerId: Int, + postOwnerId: Long, postId: Int, message: String?, - groupId: Int?, + groupId: Long?, markAsAds: Boolean? ): Single @CheckResult fun post( - ownerId: Int?, friendsOnly: Boolean?, fromGroup: Boolean?, message: String?, + ownerId: Long?, friendsOnly: Boolean?, fromGroup: Boolean?, message: String?, attachments: Collection?, services: String?, signed: Boolean?, publishDate: Long?, latitude: Double?, longitude: Double?, placeId: Int?, postId: Int?, guid: Int?, markAsAds: Boolean?, adsPromotedStealth: Boolean? ): Single @CheckResult - fun delete(ownerId: Int?, postId: Int): Single + fun delete(ownerId: Long?, postId: Int): Single @CheckResult - fun restoreComment(ownerId: Int?, commentId: Int): Single + fun restoreComment(ownerId: Long?, commentId: Int): Single @CheckResult - fun deleteComment(ownerId: Int?, commentId: Int): Single + fun deleteComment(ownerId: Long?, commentId: Int): Single @CheckResult - fun restore(ownerId: Int?, postId: Int): Single + fun restore(ownerId: Long?, postId: Int): Single @CheckResult fun editComment( - ownerId: Int?, + ownerId: Long?, commentId: Int, message: String?, attachments: Collection? @@ -65,7 +65,7 @@ interface IWallApi { @CheckResult fun createComment( - ownerId: Int?, postId: Int, fromGroup: Int?, + ownerId: Long?, postId: Int, fromGroup: Long?, message: String?, replyToComment: Int?, attachments: Collection?, stickerId: Int?, generatedUniqueId: Int? @@ -73,7 +73,7 @@ interface IWallApi { @CheckResult operator fun get( - ownerId: Int?, domain: String?, offset: Int?, count: Int?, + ownerId: Long?, domain: String?, offset: Int?, count: Int?, filter: String?, extended: Boolean?, fields: String? ): Single @@ -85,20 +85,20 @@ interface IWallApi { @CheckResult fun getComments( - ownerId: Int, postId: Int, needLikes: Boolean?, + ownerId: Long, postId: Int, needLikes: Boolean?, startCommentId: Int?, offset: Int?, count: Int?, sort: String?, extended: Boolean?, fields: String? ): Single @CheckResult - fun reportPost(owner_id: Int?, post_id: Int?, reason: Int?): Single + fun reportPost(owner_id: Long?, post_id: Int?, reason: Int?): Single @CheckResult - fun reportComment(owner_id: Int?, post_id: Int?, reason: Int?): Single + fun reportComment(owner_id: Long?, post_id: Int?, reason: Int?): Single @CheckResult - fun subscribe(owner_id: Int?): Single + fun subscribe(owner_id: Long?): Single @CheckResult - fun unsubscribe(owner_id: Int?): Single + fun unsubscribe(owner_id: Long?): Single } \ No newline at end of file diff --git a/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/api/model/AccessIdPair.kt b/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/api/model/AccessIdPair.kt index 61c317c45..4650edbb8 100644 --- a/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/api/model/AccessIdPair.kt +++ b/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/api/model/AccessIdPair.kt @@ -3,7 +3,7 @@ package dev.ragnarok.fenrir.api.model import kotlinx.serialization.Serializable @Serializable -class AccessIdPair(val id: Int, val ownerId: Int, val accessKey: String?) { +class AccessIdPair(val id: Int, val ownerId: Long, val accessKey: String?) { companion object { fun format(pair: AccessIdPair): String { diff --git a/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/api/model/AttachmentTokens.kt b/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/api/model/AttachmentTokens.kt index 940ca6b40..ab8ded7dc 100644 --- a/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/api/model/AttachmentTokens.kt +++ b/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/api/model/AttachmentTokens.kt @@ -8,17 +8,17 @@ object AttachmentTokens { class AttachmentToken : IAttachmentToken { val type: String val id: Int - val ownerId: Int + val ownerId: Long val accessKey: String? - constructor(type: String, id: Int, ownerId: Int) { + constructor(type: String, id: Int, ownerId: Long) { this.type = type this.id = id this.ownerId = ownerId accessKey = null } - constructor(type: String, id: Int, ownerId: Int, accessKey: String?) { + constructor(type: String, id: Int, ownerId: Long, accessKey: String?) { this.type = type this.id = id this.ownerId = ownerId @@ -51,4 +51,4 @@ object AttachmentTokens { return url ?: "null" } } -} +} \ No newline at end of file diff --git a/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/api/model/AttachmentsTokenCreator.kt b/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/api/model/AttachmentsTokenCreator.kt index 16b7acdd1..ae28efd47 100644 --- a/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/api/model/AttachmentsTokenCreator.kt +++ b/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/api/model/AttachmentsTokenCreator.kt @@ -3,11 +3,11 @@ package dev.ragnarok.fenrir.api.model import dev.ragnarok.fenrir.api.model.interfaces.IAttachmentToken object AttachmentsTokenCreator { - fun ofDocument(id: Int, ownerId: Int, accessKey: String?): IAttachmentToken { + fun ofDocument(id: Int, ownerId: Long, accessKey: String?): IAttachmentToken { return AttachmentTokens.AttachmentToken("doc", id, ownerId, accessKey) } - fun ofAudio(id: Int, ownerId: Int, accessKey: String?): IAttachmentToken { + fun ofAudio(id: Int, ownerId: Long, accessKey: String?): IAttachmentToken { return AttachmentTokens.AttachmentToken("audio", id, ownerId, accessKey) } @@ -15,29 +15,29 @@ object AttachmentsTokenCreator { return AttachmentTokens.LinkAttachmentToken(url) } - fun ofArticle(id: Int, ownerId: Int, accessKey: String?): IAttachmentToken { + fun ofArticle(id: Int, ownerId: Long, accessKey: String?): IAttachmentToken { return AttachmentTokens.AttachmentToken("article", id, ownerId, accessKey) } - fun ofStory(id: Int, ownerId: Int, accessKey: String?): IAttachmentToken { + fun ofStory(id: Int, ownerId: Long, accessKey: String?): IAttachmentToken { return AttachmentTokens.AttachmentToken("story", id, ownerId, accessKey) } - fun ofPhotoAlbum(id: Int, ownerId: Int): IAttachmentToken { + fun ofPhotoAlbum(id: Int, ownerId: Long): IAttachmentToken { return AttachmentTokens.AttachmentToken("album", id, ownerId) } - fun ofAudioPlaylist(id: Int, ownerId: Int, accessKey: String?): IAttachmentToken { + fun ofAudioPlaylist(id: Int, ownerId: Long, accessKey: String?): IAttachmentToken { return AttachmentTokens.AttachmentToken("audio_playlist", id, ownerId, accessKey) } - fun ofGraffiti(id: Int, ownerId: Int, accessKey: String?): IAttachmentToken { + fun ofGraffiti(id: Int, ownerId: Long, accessKey: String?): IAttachmentToken { return AttachmentTokens.AttachmentToken("graffiti", id, ownerId, accessKey) } fun ofCall( - initiator_id: Int, - receiver_id: Int, + initiator_id: Long, + receiver_id: Long, state: String?, time: Long ): IAttachmentToken { @@ -49,46 +49,54 @@ object AttachmentsTokenCreator { } fun ofGeo(latitude: String?, longitude: String?): IAttachmentToken { - return AttachmentTokens.AttachmentToken("geo", latitude.hashCode(), longitude.hashCode()) + return AttachmentTokens.AttachmentToken( + "geo", + latitude.hashCode(), + longitude.hashCode().toLong() + ) } - fun ofPhoto(id: Int, ownerId: Int, accessKey: String?): IAttachmentToken { + fun ofPhoto(id: Int, ownerId: Long, accessKey: String?): IAttachmentToken { return AttachmentTokens.AttachmentToken("photo", id, ownerId, accessKey) } - fun ofPoll(id: Int, ownerId: Int): IAttachmentToken { + fun ofPoll(id: Int, ownerId: Long): IAttachmentToken { return AttachmentTokens.AttachmentToken("poll", id, ownerId) } - fun ofWallReply(id: Int, ownerId: Int): IAttachmentToken { + fun ofWallReply(id: Int, ownerId: Long): IAttachmentToken { return AttachmentTokens.AttachmentToken("wall_reply", id, ownerId) } - fun ofPost(id: Int, ownerId: Int): IAttachmentToken { + fun ofPost(id: Int, ownerId: Long): IAttachmentToken { return AttachmentTokens.AttachmentToken("wall", id, ownerId) } fun ofError(type: String?, data: String?): IAttachmentToken { - return AttachmentTokens.AttachmentToken("error", type.hashCode(), data.hashCode()) + return AttachmentTokens.AttachmentToken("error", type.hashCode(), data.hashCode().toLong()) } - fun ofEvent(id: Int, button_text: String?): IAttachmentToken { - return AttachmentTokens.AttachmentToken("event", id, button_text.hashCode()) + fun ofEvent(id: Long, button_text: String?): IAttachmentToken { + return AttachmentTokens.AttachmentToken( + "event", + id.hashCode(), + button_text.hashCode().toLong() + ) } - fun ofMarket(id: Int, ownerId: Int, accessKey: String?): IAttachmentToken { + fun ofMarket(id: Int, ownerId: Long, accessKey: String?): IAttachmentToken { return AttachmentTokens.AttachmentToken("market", id, ownerId, accessKey) } - fun ofMarketAlbum(id: Int, ownerId: Int, accessKey: String?): IAttachmentToken { + fun ofMarketAlbum(id: Int, ownerId: Long, accessKey: String?): IAttachmentToken { return AttachmentTokens.AttachmentToken("market_album", id, ownerId, accessKey) } - fun ofVideo(id: Int, ownerId: Int, accessKey: String?): IAttachmentToken { + fun ofVideo(id: Int, ownerId: Long, accessKey: String?): IAttachmentToken { return AttachmentTokens.AttachmentToken("video", id, ownerId, accessKey) } fun ofArtist(id: String?): IAttachmentToken { return AttachmentTokens.AttachmentTokenForArtist("artist", id) } -} +} \ No newline at end of file diff --git a/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/api/model/ChatUserDto.kt b/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/api/model/ChatUserDto.kt index 62df1930e..f759fdfd8 100644 --- a/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/api/model/ChatUserDto.kt +++ b/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/api/model/ChatUserDto.kt @@ -6,6 +6,6 @@ import kotlinx.serialization.Serializable @Serializable(with = ChatUserDtoAdapter::class) class ChatUserDto { var user: VKApiOwner? = null - var invited_by = 0 + var invited_by = 0L var type: String? = null } \ No newline at end of file diff --git a/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/api/model/CountersDto.kt b/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/api/model/CountersDto.kt index 8790e00e8..1c89e246b 100644 --- a/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/api/model/CountersDto.kt +++ b/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/api/model/CountersDto.kt @@ -31,4 +31,4 @@ class CountersDto { @SerialName("notifications") var notifications = 0 -} +} \ No newline at end of file diff --git a/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/api/model/GroupSettingsDto.kt b/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/api/model/GroupSettingsDto.kt index 57f01ae59..688f9ad79 100644 --- a/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/api/model/GroupSettingsDto.kt +++ b/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/api/model/GroupSettingsDto.kt @@ -105,4 +105,4 @@ class GroupSettingsDto { @SerialName("name") var name: String? = null } -} +} \ No newline at end of file diff --git a/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/api/model/IdPair.kt b/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/api/model/IdPair.kt index fdf059105..2cd586d75 100644 --- a/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/api/model/IdPair.kt +++ b/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/api/model/IdPair.kt @@ -3,4 +3,4 @@ package dev.ragnarok.fenrir.api.model import kotlinx.serialization.Serializable @Serializable -class IdPair(val id: Int, val ownerId: Int) \ No newline at end of file +class IdPair(val id: Int, val ownerId: Long) \ No newline at end of file diff --git a/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/api/model/LoginResponse.kt b/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/api/model/LoginResponse.kt index a12c4f8cf..3dced12e6 100644 --- a/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/api/model/LoginResponse.kt +++ b/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/api/model/LoginResponse.kt @@ -10,7 +10,7 @@ class LoginResponse { var access_token: String? = null @SerialName("user_id") - var user_id = 0 + var user_id = 0L @SerialName("error") var error: String? = null diff --git a/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/api/model/VKApiArticle.kt b/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/api/model/VKApiArticle.kt index a12319aa3..f9621f002 100644 --- a/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/api/model/VKApiArticle.kt +++ b/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/api/model/VKApiArticle.kt @@ -7,7 +7,7 @@ import kotlinx.serialization.Serializable @Serializable(with = ArticleDtoAdapter::class) class VKApiArticle : VKApiAttachment { var id = 0 - var owner_id = 0 + var owner_id = 0L var owner_name: String? = null var url: String? = null var title: String? = null diff --git a/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/api/model/VKApiAudio.kt b/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/api/model/VKApiAudio.kt index ea205a7ff..b11f7ef3a 100644 --- a/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/api/model/VKApiAudio.kt +++ b/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/api/model/VKApiAudio.kt @@ -24,7 +24,7 @@ class VKApiAudio /** * Audio owner ID. */ - var owner_id = 0 + var owner_id = 0L /** * Artist name. @@ -57,7 +57,7 @@ class VKApiAudio * ID of the album containing the audio file (if assigned). */ var album_id = 0 - var album_owner_id = 0 + var album_owner_id = 0L var album_access_key: String? = null /** diff --git a/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/api/model/VKApiAudioMessage.kt b/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/api/model/VKApiAudioMessage.kt index 1dd7c87af..0c4443f53 100644 --- a/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/api/model/VKApiAudioMessage.kt +++ b/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/api/model/VKApiAudioMessage.kt @@ -10,7 +10,7 @@ class VKApiAudioMessage : VKApiAttachment { var id = 0 @SerialName("owner_id") - var owner_id = 0 + var owner_id = 0L @SerialName("duration") var duration = 0 diff --git a/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/api/model/VKApiAudioPlaylist.kt b/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/api/model/VKApiAudioPlaylist.kt index 366b3ba98..12eab8299 100644 --- a/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/api/model/VKApiAudioPlaylist.kt +++ b/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/api/model/VKApiAudioPlaylist.kt @@ -8,7 +8,7 @@ import kotlinx.serialization.Serializable @Serializable(with = AudioPlaylistDtoAdapter::class) class VKApiAudioPlaylist : VKApiAttachment, IIdComparable { var id = 0 - var owner_id = 0 + var owner_id = 0L var count = 0 var update_time: Long = 0 var Year = 0 @@ -20,7 +20,7 @@ class VKApiAudioPlaylist : VKApiAttachment, IIdComparable { var access_key: String? = null var original_access_key: String? = null var original_id = 0 - var original_owner_id = 0 + var original_owner_id = 0L override fun getType(): String { return VKApiAttachment.TYPE_AUDIO_PLAYLIST } diff --git a/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/api/model/VKApiBanned.kt b/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/api/model/VKApiBanned.kt index 52628c91f..ac5b5e8c2 100644 --- a/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/api/model/VKApiBanned.kt +++ b/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/api/model/VKApiBanned.kt @@ -23,7 +23,7 @@ class VKApiBanned { * идентификатор администратора, который добавил пользователя в черный список. */ @SerialName("admin_id") - var adminId = 0 + var adminId = 0L /** * дата добавления пользователя в черный список в формате Unixtime. diff --git a/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/api/model/VKApiCall.kt b/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/api/model/VKApiCall.kt index 8812b6fd9..d952bf816 100644 --- a/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/api/model/VKApiCall.kt +++ b/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/api/model/VKApiCall.kt @@ -7,10 +7,10 @@ import kotlinx.serialization.Serializable @Serializable class VKApiCall : VKApiAttachment { @SerialName("initiator_id") - var initiator_id = 0 + var initiator_id = 0L @SerialName("receiver_id") - var receiver_id = 0 + var receiver_id = 0L @SerialName("state") var state: String? = null diff --git a/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/api/model/VKApiCareer.kt b/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/api/model/VKApiCareer.kt index ed3ac8ad1..a5177db23 100644 --- a/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/api/model/VKApiCareer.kt +++ b/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/api/model/VKApiCareer.kt @@ -12,7 +12,7 @@ class VKApiCareer * Creates empty School instance. */ : IUserActivityPoint { - var group_id = 0 + var group_id = 0L var company: String? = null var country_id = 0 var city_id = 0 diff --git a/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/api/model/VKApiChat.kt b/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/api/model/VKApiChat.kt index 3e7ebb86b..99a6b6031 100644 --- a/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/api/model/VKApiChat.kt +++ b/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/api/model/VKApiChat.kt @@ -15,7 +15,7 @@ class VKApiChat /** * Chat ID, positive number. */ - var id = 0 + var id = 0L /** * Type of chat. @@ -30,7 +30,7 @@ class VKApiChat /** * ID of the chat starter, positive number */ - var admin_id = 0 + var admin_id = 0L /** * List of chat participants' IDs. diff --git a/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/api/model/VKApiComment.kt b/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/api/model/VKApiComment.kt index 4faa7181f..77a4c2e5a 100644 --- a/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/api/model/VKApiComment.kt +++ b/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/api/model/VKApiComment.kt @@ -22,7 +22,7 @@ class VKApiComment /** * Comment author ID. */ - var from_id = 0 + var from_id = 0L /** * Date when the comment was added as unixtime. @@ -37,7 +37,7 @@ class VKApiComment /** * ID of the user or community to whom the reply is addressed (if the comment is a reply to another comment). */ - var reply_to_user = 0 + var reply_to_user = 0L /** * ID of the comment the reply to which is represented by the current comment (if the comment is a reply to another comment). diff --git a/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/api/model/VKApiCommunity.kt b/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/api/model/VKApiCommunity.kt index 4fdb5af6e..2a9cb9e8e 100644 --- a/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/api/model/VKApiCommunity.kt +++ b/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/api/model/VKApiCommunity.kt @@ -1,7 +1,7 @@ package dev.ragnarok.fenrir.api.model import dev.ragnarok.fenrir.api.adapters.CommunityDtoAdapter -import dev.ragnarok.fenrir.api.model.interfaces.Identificable +import dev.ragnarok.fenrir.api.model.interfaces.IdentificableOwner import dev.ragnarok.fenrir.nonNullNoEmpty import kotlinx.serialization.Serializable @@ -293,12 +293,12 @@ class VKApiCommunity } @Serializable - class Contact : Identificable { - var user_id = 0 + class Contact : IdentificableOwner { + var user_id = 0L var email: String? = null var phone: String? = null var desc: String? = null - override fun getObjectId(): Int { + override fun getOwnerObjectId(): Long { return user_id } } @@ -328,7 +328,7 @@ class VKApiCommunity const val PHOTO_50 = "http://vk.com/images/community_50.gif" const val PHOTO_100 = "http://vk.com/images/community_100.gif" - fun create(id: Int): VKApiCommunity { + fun create(id: Long): VKApiCommunity { val community = VKApiCommunity() community.id = id return community diff --git a/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/api/model/VKApiConversation.kt b/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/api/model/VKApiConversation.kt index 54cd38456..abda81914 100644 --- a/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/api/model/VKApiConversation.kt +++ b/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/api/model/VKApiConversation.kt @@ -85,14 +85,14 @@ class VKApiConversation { * идентификатор назначения. */ @SerialName("id") - var id = 0 + var id = 0L /** * local_id (integer) — локальный идентификатор назначения. Для чатов — id - 2000000000, для сообществ — -id, для e-mail — -(id+2000000000). * для контактов - (id-1900000000) */ @SerialName("local_id") - var local_id = 0 + var local_id = 0L @SerialName("type") var type: String? = null @@ -113,7 +113,7 @@ class VKApiConversation { var photo: Photo? = null @SerialName("active_ids") - var activeIds: IntArray? = null + var activeIds: LongArray? = null @SerialName("state") var state: String? = null @@ -194,7 +194,7 @@ class VKApiConversation { @Serializable class ContactElement { @SerialName("id") - var id = 0 + var id = 0L @SerialName("name") var name: String? = null @@ -227,7 +227,7 @@ class VKApiConversation { var inline = false @SerialName("author_id") - var author_id = 0 + var author_id = 0L @SerialName("buttons") var buttons: List>? = null diff --git a/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/api/model/VKApiConversationMembers.kt b/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/api/model/VKApiConversationMembers.kt index fd129e5b7..ce87da314 100644 --- a/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/api/model/VKApiConversationMembers.kt +++ b/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/api/model/VKApiConversationMembers.kt @@ -6,10 +6,10 @@ import kotlinx.serialization.Serializable @Serializable class VKApiConversationMembers { @SerialName("member_id") - var member_id = 0 + var member_id = 0L @SerialName("invited_by") - var invited_by = 0 + var invited_by = 0L @SerialName("join_date") var join_date: Long = 0 diff --git a/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/api/model/VKApiDoc.kt b/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/api/model/VKApiDoc.kt index 26c3c490f..eddac07d9 100644 --- a/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/api/model/VKApiDoc.kt +++ b/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/api/model/VKApiDoc.kt @@ -11,7 +11,7 @@ class VKApiDoc : VKApiAttachment { var id = 0 @SerialName("owner_id") - var ownerId = 0 + var ownerId = 0L @SerialName("title") var title: String? = null diff --git a/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/api/model/VKApiEvent.kt b/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/api/model/VKApiEvent.kt index 8ea27d6a6..5b319cbe5 100644 --- a/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/api/model/VKApiEvent.kt +++ b/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/api/model/VKApiEvent.kt @@ -7,7 +7,7 @@ import kotlinx.serialization.Serializable @Serializable class VKApiEvent : VKApiAttachment { @SerialName("id") - var id = 0 + var id = 0L @SerialName("button_text") var button_text: String? = null diff --git a/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/api/model/VKApiFeedList.kt b/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/api/model/VKApiFeedList.kt index 71ee1aaa7..8436ca2ac 100644 --- a/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/api/model/VKApiFeedList.kt +++ b/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/api/model/VKApiFeedList.kt @@ -15,5 +15,5 @@ class VKApiFeedList { var no_reposts = false @SerialName("source_ids") - var source_ids: IntArray? = null + var source_ids: LongArray? = null } \ No newline at end of file diff --git a/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/api/model/VKApiFriendList.kt b/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/api/model/VKApiFriendList.kt index 76676bc87..d8b376426 100644 --- a/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/api/model/VKApiFriendList.kt +++ b/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/api/model/VKApiFriendList.kt @@ -7,7 +7,7 @@ class VKApiFriendList { /** * идентификатор списка друзей */ - var id = 0 + var id = 0L /** * название списка друзей diff --git a/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/api/model/VKApiGift.kt b/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/api/model/VKApiGift.kt index 9bdc8b06f..c04e7f36f 100644 --- a/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/api/model/VKApiGift.kt +++ b/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/api/model/VKApiGift.kt @@ -5,7 +5,7 @@ import kotlinx.serialization.Serializable @Serializable class VKApiGift { var id = 0 - var from_id = 0 + var from_id = 0L var message: String? = null var date: Long = 0 var gift: VKApiGiftItem? = null diff --git a/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/api/model/VKApiGraffiti.kt b/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/api/model/VKApiGraffiti.kt index 95fbf40ca..f1ffc2708 100644 --- a/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/api/model/VKApiGraffiti.kt +++ b/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/api/model/VKApiGraffiti.kt @@ -10,7 +10,7 @@ class VKApiGraffiti : VKApiAttachment { var id = 0 @SerialName("owner_id") - var owner_id = 0 + var owner_id = 0L @SerialName("url") var url: String? = null diff --git a/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/api/model/VKApiMarket.kt b/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/api/model/VKApiMarket.kt index 8a81f9c64..7ef2b44ca 100644 --- a/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/api/model/VKApiMarket.kt +++ b/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/api/model/VKApiMarket.kt @@ -7,7 +7,7 @@ import kotlinx.serialization.Serializable @Serializable(with = MarketDtoAdapter::class) class VKApiMarket : VKApiAttachment { var id = 0 - var owner_id = 0 + var owner_id = 0L var access_key: String? = null var weight = 0 var availability = 0 diff --git a/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/api/model/VKApiMarketAlbum.kt b/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/api/model/VKApiMarketAlbum.kt index 2e548eee4..107c2533c 100644 --- a/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/api/model/VKApiMarketAlbum.kt +++ b/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/api/model/VKApiMarketAlbum.kt @@ -10,7 +10,7 @@ class VKApiMarketAlbum : VKApiAttachment { var id = 0 @SerialName("owner_id") - var owner_id = 0 + var owner_id = 0L @SerialName("access_key") var access_key: String? = null diff --git a/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/api/model/VKApiMessage.kt b/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/api/model/VKApiMessage.kt index 74cdcd96f..bec343468 100644 --- a/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/api/model/VKApiMessage.kt +++ b/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/api/model/VKApiMessage.kt @@ -21,12 +21,12 @@ class VKApiMessage /** * For an incoming message, the user ID of the author. For an outgoing message, the user ID of the receiver. */ - var peer_id = 0 + var peer_id = 0L /** * For an incoming message, the user ID of the author. For an outgoing message, the user ID of the receiver. */ - var from_id = 0 + var from_id = 0L /** * Date (in Unix time) when the message was sent. @@ -80,7 +80,7 @@ class VKApiMessage * идентификатор пользователя (если > 0) или email (если < 0), которого пригласили или исключили * число, для служебных сообщений с action равным chat_invite_user или chat_kick_user */ - var action_mid = 0 + var action_mid = 0L /** * email, который пригласили или исключили diff --git a/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/api/model/VKApiNarratives.kt b/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/api/model/VKApiNarratives.kt index 51fbddf30..04a7eef8b 100644 --- a/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/api/model/VKApiNarratives.kt +++ b/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/api/model/VKApiNarratives.kt @@ -10,7 +10,7 @@ class VKApiNarratives { var id = 0 @SerialName("owner_id") - var owner_id = 0 + var owner_id = 0L @SerialName("title") var title: String? = null diff --git a/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/api/model/VKApiNews.kt b/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/api/model/VKApiNews.kt index f4fad1ed1..70d96b96e 100644 --- a/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/api/model/VKApiNews.kt +++ b/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/api/model/VKApiNews.kt @@ -9,12 +9,12 @@ import kotlinx.serialization.Serializable class VKApiNews { var type //friends_recomm //post : String? = null - var source_id = 0 + var source_id = 0L var date: Long = 0 var post_id = 0 var post_type: String? = null var final_post = false - var copy_owner_id = 0 + var copy_owner_id = 0L var copy_post_id = 0 var copy_history: List? = null var copy_post_date: Long = 0 @@ -36,7 +36,7 @@ class VKApiNews { * Information about attachments to the post (photos, links, etc.), if any; */ var attachments: VKApiAttachments? = null - var friends: ArrayList? = null + var friends: ArrayList? = null var views = 0 val attachmentsCount: Int get() = attachments?.size().orZero() diff --git a/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/api/model/VKApiNote.kt b/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/api/model/VKApiNote.kt index a7b047837..feadff1e0 100644 --- a/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/api/model/VKApiNote.kt +++ b/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/api/model/VKApiNote.kt @@ -20,7 +20,7 @@ class VKApiNote /** * Note owner ID. */ - var user_id = 0 + var user_id = 0L /** * Note title. diff --git a/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/api/model/VKApiOwner.kt b/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/api/model/VKApiOwner.kt index cb93b75db..a22454ae6 100644 --- a/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/api/model/VKApiOwner.kt +++ b/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/api/model/VKApiOwner.kt @@ -14,9 +14,9 @@ open class VKApiOwner /** * User or group ID. */ - var id = 0 + var id = 0L override fun hashCode(): Int { - return id + return id.hashCode() } override fun equals(other: Any?): Boolean { diff --git a/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/api/model/VKApiPhoto.kt b/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/api/model/VKApiPhoto.kt index adb0a5612..1bda8e939 100644 --- a/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/api/model/VKApiPhoto.kt +++ b/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/api/model/VKApiPhoto.kt @@ -29,7 +29,7 @@ class VKApiPhoto /** * ID of the user or community that owns the photo. */ - var owner_id = 0 + var owner_id = 0L /** * Width (in pixels) of the original photo. diff --git a/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/api/model/VKApiPhotoAlbum.kt b/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/api/model/VKApiPhotoAlbum.kt index 9541c4fef..8b34ac1ec 100644 --- a/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/api/model/VKApiPhotoAlbum.kt +++ b/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/api/model/VKApiPhotoAlbum.kt @@ -36,7 +36,7 @@ class VKApiPhotoAlbum /** * ID of the user or community that owns the album. */ - var owner_id = 0 + var owner_id = 0L /** * Whether a user can upload photos to this album(false — cannot, true — can). diff --git a/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/api/model/VKApiPhotoTags.kt b/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/api/model/VKApiPhotoTags.kt index c337cf915..5517863ac 100644 --- a/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/api/model/VKApiPhotoTags.kt +++ b/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/api/model/VKApiPhotoTags.kt @@ -5,7 +5,7 @@ import kotlinx.serialization.Serializable @Serializable class VKApiPhotoTags { var id = 0 - var user_id = 0 + var user_id = 0L var placer_id = 0 var tagged_name: String? = null var date: Long = 0 diff --git a/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/api/model/VKApiPoll.kt b/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/api/model/VKApiPoll.kt index 96934890d..1437bf42b 100644 --- a/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/api/model/VKApiPoll.kt +++ b/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/api/model/VKApiPoll.kt @@ -20,7 +20,7 @@ class VKApiPoll /** * ID of the user or community that owns this poll. */ - var owner_id = 0 + var owner_id = 0L /** * Date (in Unix time) the poll was created. @@ -56,7 +56,7 @@ class VKApiPoll */ var is_board = false var closed = false - var author_id = 0 + var author_id = 0L var can_vote = false var can_edit = false var can_report = false diff --git a/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/api/model/VKApiPost.kt b/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/api/model/VKApiPost.kt index ca2234e8d..2cfffc78c 100644 --- a/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/api/model/VKApiPost.kt +++ b/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/api/model/VKApiPost.kt @@ -22,12 +22,12 @@ class VKApiPost : VKApiAttachment, Commentable, Likeable, Copyable { /** * Wall owner ID. */ - var owner_id = 0 + var owner_id = 0L /** * ID of the user who posted. */ - var from_id = 0 + var from_id = 0L /** * Date (in Unix time) the post was added. @@ -42,7 +42,7 @@ class VKApiPost : VKApiAttachment, Commentable, Likeable, Copyable { /** * ID of the wall owner the post to which the reply is addressed (if the post is a reply to another wall post). */ - var reply_owner_id = 0 + var reply_owner_id = 0L /** * ID of the wall post to which the reply is addressed (if the post is a reply to another wall post). @@ -102,7 +102,7 @@ class VKApiPost : VKApiAttachment, Commentable, Likeable, Copyable { /** * ID of the author (if the post was published by a community and signed by a user). */ - var signer_id = 0 + var signer_id = 0L /** * информация о том, может ли текущий пользователь закрепить запись. R.Kolbasa @@ -122,7 +122,7 @@ class VKApiPost : VKApiAttachment, Commentable, Likeable, Copyable { var copy_history: ArrayList? = null var post_source: VKApiPostSource? = null var views = 0 - var created_by = 0 + var created_by = 0L var can_edit = false var is_favorite = false diff --git a/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/api/model/VKApiPrivacy.kt b/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/api/model/VKApiPrivacy.kt index 51a034f5f..ffaee47d6 100644 --- a/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/api/model/VKApiPrivacy.kt +++ b/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/api/model/VKApiPrivacy.kt @@ -30,24 +30,24 @@ class VKApiPrivacy(var category: String?) { return buildJsonArray() } - fun includeOwner(id: Int) { + fun includeOwner(id: Long) { putIfNotExist(Entry.includedOwner(id)) } - fun excludeOwner(id: Int) { + fun excludeOwner(id: Long) { putIfNotExist(Entry.excludedOwner(id)) } - fun includeFriendsList(id: Int) { + fun includeFriendsList(id: Long) { putIfNotExist(Entry.includedFriendsList(id)) } - fun excludeFriendsList(id: Int) { + fun excludeFriendsList(id: Long) { putIfNotExist(Entry.excludedFriendsList(id)) } @Serializable - class Entry(var type: Int, var id: Int, var allowed: Boolean) { + class Entry(var type: Int, var id: Long, var allowed: Boolean) { override fun toString(): String { return when (type) { TYPE_FRIENDS_LIST -> if (allowed) "list$id" else "-list$id" @@ -59,22 +59,22 @@ class VKApiPrivacy(var category: String?) { companion object { const val TYPE_OWNER = 1 const val TYPE_FRIENDS_LIST = 2 - fun excludedOwner(id: Int): Entry { + fun excludedOwner(id: Long): Entry { return Entry(TYPE_OWNER, id, false) } - fun includedOwner(id: Int): Entry { + fun includedOwner(id: Long): Entry { return Entry(TYPE_OWNER, id, true) } - fun includedFriendsList(id: Int): Entry { + fun includedFriendsList(id: Long): Entry { return Entry(TYPE_FRIENDS_LIST, id, true) } - fun excludedFriendsList(id: Int): Entry { + fun excludedFriendsList(id: Long): Entry { return Entry(TYPE_FRIENDS_LIST, id, false) } } } -} \ No newline at end of file +} diff --git a/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/api/model/VKApiStory.kt b/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/api/model/VKApiStory.kt index e35660dd2..15eae518f 100644 --- a/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/api/model/VKApiStory.kt +++ b/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/api/model/VKApiStory.kt @@ -14,7 +14,7 @@ class VKApiStory : VKApiAttachment { /** * Note owner ID. */ - var owner_id = 0 + var owner_id = 0L /** * Date (in Unix time) when the note was created. diff --git a/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/api/model/VKApiTopic.kt b/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/api/model/VKApiTopic.kt index 325d41697..a75177baa 100644 --- a/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/api/model/VKApiTopic.kt +++ b/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/api/model/VKApiTopic.kt @@ -10,12 +10,12 @@ import kotlinx.serialization.Serializable @Serializable(with = TopicDtoAdapter::class) class VKApiTopic : Commentable { var id = 0 - var owner_id = 0 + var owner_id = 0L var title: String? = null var created: Long = 0 - var created_by = 0 + var created_by = 0L var updated: Long = 0 - var updated_by = 0 + var updated_by = 0L var is_closed = false var is_fixed = false var comments: CommentsDto? = null diff --git a/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/api/model/VKApiUser.kt b/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/api/model/VKApiUser.kt index ec8047b9a..10b88e7dd 100644 --- a/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/api/model/VKApiUser.kt +++ b/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/api/model/VKApiUser.kt @@ -411,7 +411,7 @@ class VKApiUser */ var role: String? = null - constructor(id: Int) : this() { + constructor(id: Long) : this() { this.id = id } @@ -508,7 +508,7 @@ class VKApiUser @Serializable class Relative { var type: String? = null - var id = 0 + var id = 0L var name: String? = null } @@ -521,7 +521,7 @@ class VKApiUser const val FRIEND_STATUS_HAS_INPUT_REQUEST = 2 const val FRIEND_STATUS_IS_FRIEDND = 3 - fun create(id: Int): VKApiUser { + fun create(id: Long): VKApiUser { val user = VKApiUser() user.id = id return user diff --git a/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/api/model/VKApiVideo.kt b/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/api/model/VKApiVideo.kt index 166b0a7fe..abce6195c 100644 --- a/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/api/model/VKApiVideo.kt +++ b/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/api/model/VKApiVideo.kt @@ -21,7 +21,7 @@ class VKApiVideo : VKApiAttachment, Commentable, Likeable, Copyable, IIdComparab /** * Video owner ID. */ - var owner_id = 0 + var owner_id = 0L /** * Video album ID. diff --git a/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/api/model/VKApiVideoAlbum.kt b/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/api/model/VKApiVideoAlbum.kt index 964b4f469..ed9e58b75 100644 --- a/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/api/model/VKApiVideoAlbum.kt +++ b/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/api/model/VKApiVideoAlbum.kt @@ -21,7 +21,7 @@ class VKApiVideoAlbum { /** * ID of the user or community that owns the album. */ - var owner_id = 0 + var owner_id = 0L var count = 0 /** diff --git a/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/api/model/VKApiWallReply.kt b/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/api/model/VKApiWallReply.kt index 721e123ee..68ed54051 100644 --- a/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/api/model/VKApiWallReply.kt +++ b/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/api/model/VKApiWallReply.kt @@ -11,13 +11,13 @@ class VKApiWallReply : VKApiAttachment { var id = 0 @SerialName("from_id") - var from_id = 0 + var from_id = 0L @SerialName("post_id") var post_id = 0 @SerialName("owner_id") - var owner_id = 0 + var owner_id = 0L @SerialName("text") var text: String? = null diff --git a/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/api/model/VKApiWikiPage.kt b/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/api/model/VKApiWikiPage.kt index e9bf380c9..63ad9c2ea 100644 --- a/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/api/model/VKApiWikiPage.kt +++ b/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/api/model/VKApiWikiPage.kt @@ -16,12 +16,12 @@ class VKApiWikiPage : VKApiAttachment { /** * ID of the group the wiki page belongs to; */ - var owner_id = 0 + var owner_id = 0L /** * ID of the page creator. */ - var creator_id = 0 + var creator_id = 0L /** * Wiki page name. @@ -56,7 +56,7 @@ class VKApiWikiPage : VKApiAttachment { /** * ID of the last user who edited the page. */ - var editor_id = 0 + var editor_id = 0L /** * Date of the last change. diff --git a/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/api/model/catalog_v2_audio/VKApiCatalogV2Button.kt b/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/api/model/catalog_v2_audio/VKApiCatalogV2Button.kt index 0c859d17f..845a87f1b 100644 --- a/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/api/model/catalog_v2_audio/VKApiCatalogV2Button.kt +++ b/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/api/model/catalog_v2_audio/VKApiCatalogV2Button.kt @@ -18,7 +18,7 @@ class VKApiCatalogV2Button { var title: String? = null @SerialName("owner_id") - var owner_id: Int = 0 + var owner_id: Long = 0 @SerialName("target_block_ids") var target_block_ids: List? = null diff --git a/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/api/model/feedback/Copies.kt b/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/api/model/feedback/Copies.kt index 17a949817..e10626af3 100644 --- a/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/api/model/feedback/Copies.kt +++ b/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/api/model/feedback/Copies.kt @@ -17,6 +17,6 @@ class Copies { var id = 0 @SerialName("from_id") - var owner_id = 0 + var owner_id = 0L } } \ No newline at end of file diff --git a/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/api/model/feedback/UserArray.kt b/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/api/model/feedback/UserArray.kt index ff5905c83..620e21d18 100644 --- a/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/api/model/feedback/UserArray.kt +++ b/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/api/model/feedback/UserArray.kt @@ -6,5 +6,5 @@ import kotlinx.serialization.Serializable @Serializable(with = FeedbackUserArrayDtoAdapter::class) class UserArray { var count = 0 - var ids: IntArray? = null + var ids: LongArray? = null } \ No newline at end of file diff --git a/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/api/model/interfaces/IdentificableOwner.kt b/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/api/model/interfaces/IdentificableOwner.kt new file mode 100644 index 000000000..36e184ded --- /dev/null +++ b/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/api/model/interfaces/IdentificableOwner.kt @@ -0,0 +1,11 @@ +package dev.ragnarok.fenrir.api.model.interfaces + +/** + * Describes objects that contains an "id" field. + */ +interface IdentificableOwner { + /** + * Returns unique identifier of this object(usually it's value of JSON field "id"). + */ + fun getOwnerObjectId(): Long +} \ No newline at end of file diff --git a/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/api/model/local_json/ChatJsonResponse.kt b/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/api/model/local_json/ChatJsonResponse.kt index 68309d85d..9587104ff 100644 --- a/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/api/model/local_json/ChatJsonResponse.kt +++ b/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/api/model/local_json/ChatJsonResponse.kt @@ -10,7 +10,7 @@ class ChatJsonResponse { var type: String? = null var messages: List? = null var version: Version? = null - var page_id = 0 + var page_id = 0L var page_title: String? = null var page_avatar: String? = null var page_phone_number: String? = null diff --git a/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/api/model/longpoll/AddMessageUpdate.kt b/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/api/model/longpoll/AddMessageUpdate.kt index d917551fb..fe81ff8bc 100644 --- a/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/api/model/longpoll/AddMessageUpdate.kt +++ b/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/api/model/longpoll/AddMessageUpdate.kt @@ -7,7 +7,7 @@ class AddMessageUpdate : AbsLongpollEvent(ACTION_MESSAGE_ADDED) { var messageId = 0 var timestamp: Long = 0 var text: String? = null - var from = 0 + var from = 0L var isOut = false var unread = false var important = false @@ -15,12 +15,12 @@ class AddMessageUpdate : AbsLongpollEvent(ACTION_MESSAGE_ADDED) { var hasMedia = false var sourceText: String? = null var sourceAct: String? = null - var sourceMid = 0 + var sourceMid = 0L var fwds: ArrayList? = null var keyboard: CurrentKeyboard? = null var payload: String? = null var reply: String? = null - var peerId = 0 + var peerId = 0L var random_id: String? = null var edit_time: Long = 0 diff --git a/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/api/model/longpoll/InputMessagesSetReadUpdate.kt b/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/api/model/longpoll/InputMessagesSetReadUpdate.kt index 8c3d82220..1b90624ed 100644 --- a/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/api/model/longpoll/InputMessagesSetReadUpdate.kt +++ b/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/api/model/longpoll/InputMessagesSetReadUpdate.kt @@ -2,11 +2,11 @@ package dev.ragnarok.fenrir.api.model.longpoll class InputMessagesSetReadUpdate : AbsLongpollEvent(ACTION_SET_INPUT_MESSAGES_AS_READ) { - var peerId = 0 + var peerId = 0L var localId = 0 var unreadCount = 0 - fun set(peerId: Int, localId: Int, unreadCount: Int): InputMessagesSetReadUpdate { + fun set(peerId: Long, localId: Int, unreadCount: Int): InputMessagesSetReadUpdate { this.peerId = peerId this.localId = localId this.unreadCount = unreadCount diff --git a/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/api/model/longpoll/MessageFlagsResetUpdate.kt b/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/api/model/longpoll/MessageFlagsResetUpdate.kt index dc1d2ebe8..49035cfed 100644 --- a/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/api/model/longpoll/MessageFlagsResetUpdate.kt +++ b/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/api/model/longpoll/MessageFlagsResetUpdate.kt @@ -4,5 +4,5 @@ class MessageFlagsResetUpdate : AbsLongpollEvent(ACTION_MESSAGES_FLAGS_RESET) { var messageId = 0 var mask = 0 - var peerId = 0 + var peerId = 0L } \ No newline at end of file diff --git a/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/api/model/longpoll/MessageFlagsSetUpdate.kt b/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/api/model/longpoll/MessageFlagsSetUpdate.kt index 82053053f..abd2acf0a 100644 --- a/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/api/model/longpoll/MessageFlagsSetUpdate.kt +++ b/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/api/model/longpoll/MessageFlagsSetUpdate.kt @@ -5,5 +5,5 @@ class MessageFlagsSetUpdate : //[[2,1030891,128,216143660]] var messageId = 0 var mask = 0 - var peerId = 0 + var peerId = 0L } \ No newline at end of file diff --git a/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/api/model/longpoll/OutputMessagesSetReadUpdate.kt b/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/api/model/longpoll/OutputMessagesSetReadUpdate.kt index 819e75224..ae815e24f 100644 --- a/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/api/model/longpoll/OutputMessagesSetReadUpdate.kt +++ b/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/api/model/longpoll/OutputMessagesSetReadUpdate.kt @@ -2,7 +2,7 @@ package dev.ragnarok.fenrir.api.model.longpoll class OutputMessagesSetReadUpdate : AbsLongpollEvent(ACTION_SET_OUTPUT_MESSAGES_AS_READ) { - var peerId = 0 + var peerId = 0L var localId = 0 var unreadCount = 0 } \ No newline at end of file diff --git a/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/api/model/longpoll/UserIsOfflineUpdate.kt b/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/api/model/longpoll/UserIsOfflineUpdate.kt index 9441c7892..5cbb3e04e 100644 --- a/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/api/model/longpoll/UserIsOfflineUpdate.kt +++ b/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/api/model/longpoll/UserIsOfflineUpdate.kt @@ -1,8 +1,8 @@ package dev.ragnarok.fenrir.api.model.longpoll class UserIsOfflineUpdate : AbsLongpollEvent(ACTION_USER_IS_OFFLINE) { - var userId = 0 + var userId = 0L var timestamp = 0L var isTimeout = false var app_id = 0 -} +} \ No newline at end of file diff --git a/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/api/model/longpoll/UserIsOnlineUpdate.kt b/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/api/model/longpoll/UserIsOnlineUpdate.kt index 3a881a9ca..4dac65b35 100644 --- a/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/api/model/longpoll/UserIsOnlineUpdate.kt +++ b/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/api/model/longpoll/UserIsOnlineUpdate.kt @@ -1,8 +1,8 @@ package dev.ragnarok.fenrir.api.model.longpoll class UserIsOnlineUpdate : AbsLongpollEvent(ACTION_USER_IS_ONLINE) { - var userId = 0 + var userId = 0L var platform = 0 var timestamp = 0L var app_id = 0 -} +} \ No newline at end of file diff --git a/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/api/model/longpoll/WriteTextInDialogUpdate.kt b/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/api/model/longpoll/WriteTextInDialogUpdate.kt index f35c59ae2..af2b3fcd5 100644 --- a/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/api/model/longpoll/WriteTextInDialogUpdate.kt +++ b/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/api/model/longpoll/WriteTextInDialogUpdate.kt @@ -2,7 +2,7 @@ package dev.ragnarok.fenrir.api.model.longpoll class WriteTextInDialogUpdate(var is_text: Boolean) : AbsLongpollEvent(if (is_text) ACTION_USER_WRITE_TEXT_IN_DIALOG else ACTION_USER_WRITE_VOICE_IN_DIALOG) { - var peer_id = 0 - var from_ids: IntArray? = null + var peer_id = 0L + var from_ids: LongArray? = null var from_ids_count = 0 } \ No newline at end of file diff --git a/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/api/model/response/AccountsBannedResponse.kt b/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/api/model/response/AccountsBannedResponse.kt index 1707b1e81..06affbaf4 100644 --- a/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/api/model/response/AccountsBannedResponse.kt +++ b/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/api/model/response/AccountsBannedResponse.kt @@ -8,7 +8,7 @@ import kotlinx.serialization.Serializable @Serializable class AccountsBannedResponse { @SerialName("items") - var items: List? = null + var items: List? = null @SerialName("profiles") var profiles: List? = null diff --git a/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/api/model/response/BaseResponse.kt b/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/api/model/response/BaseResponse.kt index dbed377d4..8c375b48d 100644 --- a/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/api/model/response/BaseResponse.kt +++ b/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/api/model/response/BaseResponse.kt @@ -7,4 +7,4 @@ import kotlinx.serialization.Serializable class BaseResponse : VkResponse() { @SerialName("response") var response: T? = null -} +} \ No newline at end of file diff --git a/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/api/model/response/ContactsResponse.kt b/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/api/model/response/ContactsResponse.kt index e612edf07..67196828f 100644 --- a/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/api/model/response/ContactsResponse.kt +++ b/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/api/model/response/ContactsResponse.kt @@ -8,7 +8,7 @@ import kotlinx.serialization.Serializable @Serializable class ContactsResponse { @SerialName("items") - var items: List? = null + var items: List? = null @SerialName("profiles") var profiles: List? = null diff --git a/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/api/model/response/ConversationDeleteResult.kt b/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/api/model/response/ConversationDeleteResult.kt index cfc7d7429..a0e892085 100644 --- a/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/api/model/response/ConversationDeleteResult.kt +++ b/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/api/model/response/ConversationDeleteResult.kt @@ -6,5 +6,5 @@ import kotlinx.serialization.Serializable @Serializable class ConversationDeleteResult { @SerialName("last_deleted_id") - var lastDeletedId = 0 + var lastDeletedId = 0L } \ No newline at end of file diff --git a/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/api/model/response/MessageImportantResponse.kt b/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/api/model/response/MessageImportantResponse.kt index 882bde29e..c538168b5 100644 --- a/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/api/model/response/MessageImportantResponse.kt +++ b/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/api/model/response/MessageImportantResponse.kt @@ -25,4 +25,4 @@ class MessageImportantResponse { @SerialName("count") var count = 0 } -} +} \ No newline at end of file diff --git a/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/api/model/response/PushSettingsResponse.kt b/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/api/model/response/PushSettingsResponse.kt index a7bc60746..cd1c6c0f2 100644 --- a/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/api/model/response/PushSettingsResponse.kt +++ b/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/api/model/response/PushSettingsResponse.kt @@ -22,7 +22,7 @@ class PushSettingsResponse { var disabled_until = 0L @SerialName("peer_id") - var peer_id = 0 + var peer_id = 0L } } -} +} \ No newline at end of file diff --git a/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/api/model/response/VKApiChatResponse.kt b/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/api/model/response/VKApiChatResponse.kt index 2aaec7b4f..aa66e6652 100644 --- a/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/api/model/response/VKApiChatResponse.kt +++ b/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/api/model/response/VKApiChatResponse.kt @@ -6,5 +6,5 @@ import kotlinx.serialization.Serializable @Serializable class VKApiChatResponse { @SerialName("chat_id") - var chat_id = 0 + var chat_id = 0L } \ No newline at end of file diff --git a/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/api/model/response/VkResponse.kt b/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/api/model/response/VkResponse.kt index 87544e46f..1d4a59672 100644 --- a/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/api/model/response/VkResponse.kt +++ b/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/api/model/response/VkResponse.kt @@ -13,4 +13,4 @@ open class VkResponse { @SerialName("execute_errors") var executeErrors: List? = null */ -} +} \ No newline at end of file diff --git a/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/api/model/server/VKApiPhotoMessageServer.kt b/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/api/model/server/VKApiPhotoMessageServer.kt index 87ab68df1..4170924c5 100644 --- a/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/api/model/server/VKApiPhotoMessageServer.kt +++ b/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/api/model/server/VKApiPhotoMessageServer.kt @@ -26,14 +26,14 @@ class VKApiPhotoMessageServer : Parcelable, UploadServer { * id текущего пользователя */ @SerialName("user_id") - var user_id = 0 + var user_id = 0L @Suppress("UNUSED") constructor() internal constructor(parcel: Parcel) { url = parcel.readString() album_id = parcel.readInt() - user_id = parcel.readInt() + user_id = parcel.readLong() } override fun describeContents(): Int { @@ -43,7 +43,7 @@ class VKApiPhotoMessageServer : Parcelable, UploadServer { override fun writeToParcel(dest: Parcel, flags: Int) { dest.writeString(url) dest.writeInt(album_id) - dest.writeInt(user_id) + dest.writeLong(user_id) } override fun toString(): String { diff --git a/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/api/model/server/VKApiUploadServer.kt b/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/api/model/server/VKApiUploadServer.kt index 13f04ef55..a59056141 100644 --- a/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/api/model/server/VKApiUploadServer.kt +++ b/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/api/model/server/VKApiUploadServer.kt @@ -21,12 +21,12 @@ class VKApiUploadServer : Parcelable, UploadServer { /** * идентификатор пользователя, от чьего имени будет загружено фото */ - var user_id = 0 + var user_id = 0L internal constructor(parcel: Parcel) { url = parcel.readString() album_id = parcel.readInt() - user_id = parcel.readInt() + user_id = parcel.readLong() } @Suppress("UNUSED") @@ -39,7 +39,7 @@ class VKApiUploadServer : Parcelable, UploadServer { override fun writeToParcel(dest: Parcel, flags: Int) { dest.writeString(url) dest.writeInt(album_id) - dest.writeInt(user_id) + dest.writeLong(user_id) } override fun toString(): String { diff --git a/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/api/model/server/VKApiWallUploadServer.kt b/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/api/model/server/VKApiWallUploadServer.kt index bd7897c3a..42bf240ca 100644 --- a/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/api/model/server/VKApiWallUploadServer.kt +++ b/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/api/model/server/VKApiWallUploadServer.kt @@ -21,14 +21,14 @@ class VKApiWallUploadServer : Parcelable, UploadServer { /** * идентификатор пользователя, от чьего имени будет загружено фото */ - var user_id = 0 + var user_id = 0L @Suppress("UNUSED") constructor() internal constructor(parcel: Parcel) { url = parcel.readString() album_id = parcel.readInt() - user_id = parcel.readInt() + user_id = parcel.readLong() } override fun describeContents(): Int { @@ -38,7 +38,7 @@ class VKApiWallUploadServer : Parcelable, UploadServer { override fun writeToParcel(dest: Parcel, flags: Int) { dest.writeString(url) dest.writeInt(album_id) - dest.writeInt(user_id) + dest.writeLong(user_id) } companion object CREATOR : Parcelable.Creator { diff --git a/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/api/model/upload/UploadPhotoToAlbumDto.kt b/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/api/model/upload/UploadPhotoToAlbumDto.kt index 756c528c0..74151d287 100644 --- a/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/api/model/upload/UploadPhotoToAlbumDto.kt +++ b/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/api/model/upload/UploadPhotoToAlbumDto.kt @@ -12,7 +12,7 @@ class UploadPhotoToAlbumDto { var photos_list: String? = null @SerialName("aid") - var aid = 0 + var aid = 0L @SerialName("hash") var hash: String? = null diff --git a/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/api/model/upload/UploadVideoDto.kt b/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/api/model/upload/UploadVideoDto.kt index d68773464..dac919b4e 100644 --- a/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/api/model/upload/UploadVideoDto.kt +++ b/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/api/model/upload/UploadVideoDto.kt @@ -6,7 +6,7 @@ import kotlinx.serialization.Serializable @Serializable class UploadVideoDto { @SerialName("owner_id") - var owner_id = 0 + var owner_id = 0L @SerialName("video_id") var video_id = 0 diff --git a/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/api/services/IAccountService.kt b/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/api/services/IAccountService.kt index a3c132d4e..98d0e9d3d 100644 --- a/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/api/services/IAccountService.kt +++ b/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/api/services/IAccountService.kt @@ -9,11 +9,11 @@ import dev.ragnarok.fenrir.api.rest.IServiceRest import io.reactivex.rxjava3.core.Single class IAccountService : IServiceRest() { - fun ban(owner_id: Int): Single> { + fun ban(owner_id: Long): Single> { return rest.request("account.ban", form("owner_id" to owner_id), baseInt) } - fun unban(owner_id: Int): Single> { + fun unban(owner_id: Long): Single> { return rest.request("account.unban", form("owner_id" to owner_id), baseInt) } @@ -170,4 +170,4 @@ class IAccountService : IServiceRest() { base(ContactsResponse.serializer()) ) } -} \ No newline at end of file +} diff --git a/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/api/services/IAudioService.kt b/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/api/services/IAudioService.kt index 72eeb3c78..cfc974e2b 100644 --- a/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/api/services/IAudioService.kt +++ b/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/api/services/IAudioService.kt @@ -79,7 +79,7 @@ class IAudioService : IServiceRest() { //https://vk.com/dev/audio.restore fun restore( audioId: Int, - ownerId: Int? + ownerId: Long? ): Single> { return rest.request( "audio.restore", @@ -91,7 +91,7 @@ class IAudioService : IServiceRest() { //https://vk.com/dev/audio.delete fun delete( audioId: Int, - ownerId: Int + ownerId: Long ): Single> { return rest.request( "audio.delete", @@ -103,8 +103,8 @@ class IAudioService : IServiceRest() { //https://vk.com/dev/audio.add fun add( audioId: Int, - ownerId: Int, - groupId: Int?, + ownerId: Long, + groupId: Long?, accessKey: String? ): Single> { return rest.request( @@ -132,7 +132,7 @@ class IAudioService : IServiceRest() { //https://vk.com/dev/audio.get operator fun get( playlist_id: Int?, - ownerId: Int?, + ownerId: Long?, offset: Int?, count: Int?, accessKey: String? @@ -175,7 +175,7 @@ class IAudioService : IServiceRest() { } fun getRecommendations( - user_id: Int?, + user_id: Long?, count: Int? ): Single>> { return rest.request( @@ -224,7 +224,7 @@ class IAudioService : IServiceRest() { } fun getPlaylists( - owner_id: Int, + owner_id: Long, offset: Int, count: Int ): Single>> { @@ -241,7 +241,7 @@ class IAudioService : IServiceRest() { fun deletePlaylist( playlist_id: Int, - ownerId: Int + ownerId: Long ): Single> { return rest.request( "audio.deletePlaylist", @@ -252,7 +252,7 @@ class IAudioService : IServiceRest() { fun followPlaylist( playlist_id: Int, - ownerId: Int, + ownerId: Long, accessKey: String? ): Single> { return rest.request( @@ -264,7 +264,7 @@ class IAudioService : IServiceRest() { fun clonePlaylist( playlist_id: Int, - ownerId: Int + ownerId: Long ): Single> { return rest.request( "audio.savePlaylistAsCopy", @@ -275,7 +275,7 @@ class IAudioService : IServiceRest() { fun getPlaylistById( playlist_id: Int, - ownerId: Int, + ownerId: Long, accessKey: String? ): Single> { return rest.request( @@ -313,7 +313,7 @@ class IAudioService : IServiceRest() { } fun edit( - ownerId: Int, + ownerId: Long, audioId: Int, artist: String?, title: String?, @@ -333,7 +333,7 @@ class IAudioService : IServiceRest() { } fun createPlaylist( - ownerId: Int, + ownerId: Long, title: String?, description: String? ): Single> { @@ -345,7 +345,7 @@ class IAudioService : IServiceRest() { } fun editPlaylist( - ownerId: Int, + ownerId: Long, playlist_id: Int, title: String?, description: String? @@ -362,7 +362,7 @@ class IAudioService : IServiceRest() { } fun removeFromPlaylist( - ownerId: Int, + ownerId: Long, playlist_id: Int, audio_ids: String? ): Single> { @@ -374,7 +374,7 @@ class IAudioService : IServiceRest() { } fun addToPlaylist( - ownerId: Int, + ownerId: Long, playlist_id: Int, audio_ids: String? ): Single>> { @@ -386,7 +386,7 @@ class IAudioService : IServiceRest() { } fun reorder( - ownerId: Int, + ownerId: Long, audio_id: Int, before: Int?, after: Int? @@ -408,7 +408,7 @@ class IAudioService : IServiceRest() { } fun getCatalogV2Sections( - owner_id: Int, + owner_id: Long, need_blocks: Int, url: String? ): Single> { diff --git a/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/api/services/IBoardService.kt b/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/api/services/IBoardService.kt index 11b215f31..837473c51 100644 --- a/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/api/services/IBoardService.kt +++ b/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/api/services/IBoardService.kt @@ -9,7 +9,7 @@ import io.reactivex.rxjava3.core.Single class IBoardService : IServiceRest() { //https://vk.com/dev/board.getComments fun getComments( - groupId: Int, + groupId: Long, topicId: Int, needLikes: Int?, startCommentId: Int?, @@ -37,7 +37,7 @@ class IBoardService : IServiceRest() { //https://vk.com/dev/board.restoreComment fun restoreComment( - groupId: Int, + groupId: Long, topicId: Int, commentId: Int ): Single> { @@ -50,7 +50,7 @@ class IBoardService : IServiceRest() { //https://vk.com/dev/board.deleteComment fun deleteComment( - groupId: Int, + groupId: Long, topicId: Int, commentId: Int ): Single> { @@ -88,7 +88,7 @@ class IBoardService : IServiceRest() { * @return array of objects describing topics. */ fun getTopics( - groupId: Int, + groupId: Long, topicIds: String?, order: Int?, offset: Int?, @@ -136,7 +136,7 @@ class IBoardService : IServiceRest() { * @return 1 */ fun editComment( - groupId: Int, + groupId: Long, topicId: Int, commentId: Int, message: String?, @@ -155,7 +155,7 @@ class IBoardService : IServiceRest() { } fun addComment( - groupId: Int?, + groupId: Long?, topicId: Int, message: String?, attachments: String?, diff --git a/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/api/services/ICommentsService.kt b/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/api/services/ICommentsService.kt index 3658b9ff4..2eb66513d 100644 --- a/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/api/services/ICommentsService.kt +++ b/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/api/services/ICommentsService.kt @@ -9,7 +9,7 @@ class ICommentsService : IServiceRest() { operator fun get( code: String?, sourceType: String?, - ownerId: Int, + ownerId: Long, sourceId: Int, offset: Int?, count: Int?, diff --git a/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/api/services/IDocsService.kt b/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/api/services/IDocsService.kt index 9b9921eed..b2727f958 100644 --- a/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/api/services/IDocsService.kt +++ b/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/api/services/IDocsService.kt @@ -11,7 +11,7 @@ import io.reactivex.rxjava3.core.Single class IDocsService : IServiceRest() { //https://vk.com/dev/docs.delete fun delete( - ownerId: Int?, + ownerId: Long?, docId: Int ): Single> { return rest.request( @@ -31,7 +31,7 @@ class IDocsService : IServiceRest() { * @return the ID of the created document. */ fun add( - ownerId: Int, + ownerId: Long, docId: Int, accessKey: String? ): Single> { @@ -107,7 +107,7 @@ class IDocsService : IServiceRest() { * @return an object with an upload_url field. After the document is uploaded, use the [.save] method. */ fun getMessagesUploadServer( - peer_id: Int?, + peer_id: Long?, type: String? ): Single> { return rest.request( @@ -118,7 +118,7 @@ class IDocsService : IServiceRest() { ) } - fun getUploadServer(groupId: Int?): Single> { + fun getUploadServer(groupId: Long?): Single> { return rest.request( "docs.getUploadServer", form("group_id" to groupId), @@ -128,7 +128,7 @@ class IDocsService : IServiceRest() { fun getVideoServer( is_private: Int?, - group_id: Int?, + group_id: Long?, name: String? ): Single> { return rest.request( @@ -160,7 +160,7 @@ class IDocsService : IServiceRest() { * @return Returns the total results number in count field and an array of objects describing documents in items field */ operator fun get( - ownerId: Int?, + ownerId: Long?, count: Int?, offset: Int?, type: Int? diff --git a/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/api/services/IFaveService.kt b/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/api/services/IFaveService.kt index e638b794d..c50bb43d4 100644 --- a/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/api/services/IFaveService.kt +++ b/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/api/services/IFaveService.kt @@ -61,7 +61,7 @@ class IFaveService : IServiceRest() { } fun getOwnerPublishedArticles( - owner_id: Int?, + owner_id: Long?, offset: Int?, count: Int?, sort_by: String?, @@ -151,8 +151,8 @@ class IFaveService : IServiceRest() { } fun addPage( - userId: Int?, - groupId: Int? + userId: Long?, + groupId: Long? ): Single> { return rest.request( "fave.addPage", form( @@ -163,7 +163,7 @@ class IFaveService : IServiceRest() { } fun addVideo( - owner_id: Int?, + owner_id: Long?, id: Int?, access_key: String? ): Single> { @@ -182,7 +182,7 @@ class IFaveService : IServiceRest() { fun addProduct( id: Int, - owner_id: Int, + owner_id: Long, access_key: String? ): Single> { return rest.request( @@ -195,7 +195,7 @@ class IFaveService : IServiceRest() { } fun addPost( - owner_id: Int?, + owner_id: Long?, id: Int?, access_key: String? ): Single> { @@ -210,8 +210,8 @@ class IFaveService : IServiceRest() { //https://vk.com/dev/fave.removePage fun removePage( - userId: Int?, - groupId: Int? + userId: Long?, + groupId: Long? ): Single> { return rest.request( "fave.removePage", form( @@ -226,7 +226,7 @@ class IFaveService : IServiceRest() { } fun removeArticle( - owner_id: Int?, + owner_id: Long?, article_id: Int? ): Single> { return rest.request( @@ -239,7 +239,7 @@ class IFaveService : IServiceRest() { fun removeProduct( id: Int?, - owner_id: Int? + owner_id: Long? ): Single> { return rest.request( "fave.removeProduct", form( @@ -250,7 +250,7 @@ class IFaveService : IServiceRest() { } fun removePost( - owner_id: Int?, + owner_id: Long?, id: Int? ): Single> { return rest.request( @@ -262,7 +262,7 @@ class IFaveService : IServiceRest() { } fun removeVideo( - owner_id: Int?, + owner_id: Long?, id: Int? ): Single> { return rest.request( @@ -275,7 +275,7 @@ class IFaveService : IServiceRest() { fun pushFirst( code: String?, - ownerId: Int + ownerId: Long ): Single> { return rest.request( "execute", form( diff --git a/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/api/services/IFriendsService.kt b/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/api/services/IFriendsService.kt index 9fd7515ee..f54837079 100644 --- a/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/api/services/IFriendsService.kt +++ b/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/api/services/IFriendsService.kt @@ -23,7 +23,7 @@ class IFriendsService : IServiceRest() { @POST("execute") Single> getWithMyCounters(@Field("code") String code);*/ operator fun get( - userId: Int?, + userId: Long?, order: String?, listId: Int?, count: Int?, @@ -60,7 +60,7 @@ class IFriendsService : IServiceRest() { //https://vk.com/dev/friends.getLists fun getLists( - userId: Int?, + userId: Long?, returnSystem: Int? ): Single>> { return rest.request( @@ -72,7 +72,7 @@ class IFriendsService : IServiceRest() { } //https://vk.com/dev/friends.delete - fun delete(userId: Int): Single> { + fun delete(userId: Long): Single> { return rest.request( "friends.delete", form("user_id" to userId), @@ -82,7 +82,7 @@ class IFriendsService : IServiceRest() { //https://vk.com/dev/friends.add fun add( - userId: Int, + userId: Long, text: String?, follow: Int? ): Single> { @@ -96,7 +96,7 @@ class IFriendsService : IServiceRest() { } fun deleteSubscriber( - subscriber_id: Int + subscriber_id: Long ): Single> { return rest.request( "friends.deleteSubscriber", form( @@ -107,7 +107,7 @@ class IFriendsService : IServiceRest() { //https://vk.com/dev/friends.search fun search( - userId: Int, + userId: Long, query: String?, fields: String?, nameCase: String?, diff --git a/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/api/services/IGroupsService.kt b/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/api/services/IGroupsService.kt index 58acd88b7..71ccb85aa 100644 --- a/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/api/services/IGroupsService.kt +++ b/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/api/services/IGroupsService.kt @@ -9,8 +9,8 @@ import io.reactivex.rxjava3.core.Single class IGroupsService : IServiceRest() { fun editManager( - groupId: Int, - userId: Int, + groupId: Long, + userId: Long, role: String?, isContact: Int?, contactPosition: String?, @@ -31,7 +31,7 @@ class IGroupsService : IServiceRest() { } fun edit( - groupId: Int, + groupId: Long, title: String?, description: String?, screen_name: String?, @@ -63,8 +63,8 @@ class IGroupsService : IServiceRest() { } fun unban( - groupId: Int, - ownerId: Int + groupId: Long, + ownerId: Long ): Single> { return rest.request( "groups.unban", form( @@ -75,7 +75,7 @@ class IGroupsService : IServiceRest() { } fun getMarketAlbums( - owner_id: Int, + owner_id: Long, offset: Int, count: Int ): Single>> { @@ -89,7 +89,7 @@ class IGroupsService : IServiceRest() { } fun getMarket( - owner_id: Int, + owner_id: Long, album_id: Int?, offset: Int, count: Int, @@ -107,7 +107,7 @@ class IGroupsService : IServiceRest() { } fun getMarketServices( - owner_id: Int, + owner_id: Long, offset: Int, count: Int, extended: Int? @@ -135,8 +135,8 @@ class IGroupsService : IServiceRest() { } fun ban( - groupId: Int, - ownerId: Int, + groupId: Long, + ownerId: Long, endDate: Long?, reason: Int?, comment: String?, @@ -154,7 +154,7 @@ class IGroupsService : IServiceRest() { ) } - fun getSettings(groupId: Int): Single> { + fun getSettings(groupId: Long): Single> { return rest.request( "groups.getSettings", form("group_id" to groupId), @@ -164,11 +164,11 @@ class IGroupsService : IServiceRest() { //https://vk.com/dev/groups.getBanned fun getBanned( - groupId: Int, + groupId: Long, offset: Int?, count: Int?, fields: String?, - userId: Int? + userId: Long? ): Single>> { return rest.request( "groups.getBanned", form( @@ -244,7 +244,7 @@ class IGroupsService : IServiceRest() { ) } - fun getLongPollServer(groupId: Int): Single> { + fun getLongPollServer(groupId: Long): Single> { return rest.request( "groups.getLongPollServer", form("group_id" to groupId), @@ -253,13 +253,13 @@ class IGroupsService : IServiceRest() { } //https://vk.com/dev/groups.leave - fun leave(groupId: Int): Single> { + fun leave(groupId: Long): Single> { return rest.request("groups.leave", form("group_id" to groupId), baseInt) } //https://vk.com/dev/groups.join fun join( - groupId: Int, + groupId: Long, notSure: Int? ): Single> { return rest.request( @@ -272,7 +272,7 @@ class IGroupsService : IServiceRest() { //https://vk.com/dev/groups.get operator fun get( - userId: Int?, + userId: Long?, extended: Int?, filter: String?, fields: String?, @@ -315,7 +315,7 @@ class IGroupsService : IServiceRest() { } fun getChats( - groupId: Int, + groupId: Long, offset: Int?, count: Int? ): Single>> { diff --git a/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/api/services/ILikesService.kt b/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/api/services/ILikesService.kt index 58acb929d..42ffad462 100644 --- a/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/api/services/ILikesService.kt +++ b/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/api/services/ILikesService.kt @@ -11,7 +11,7 @@ class ILikesService : IServiceRest() { //https://vk.com/dev/likes.getList fun getList( type: String?, - ownerId: Int?, + ownerId: Long?, itemId: Int?, pageUrl: String?, filter: String?, @@ -42,7 +42,7 @@ class ILikesService : IServiceRest() { //https://vk.com/dev/likes.delete fun delete( type: String?, - ownerId: Int?, + ownerId: Long?, itemId: Int, accessKey: String? ): Single> { @@ -59,7 +59,7 @@ class ILikesService : IServiceRest() { //https://vk.com/dev/likes.add fun add( type: String?, - ownerId: Int?, + ownerId: Long?, itemId: Int, accessKey: String? ): Single> { @@ -76,7 +76,7 @@ class ILikesService : IServiceRest() { //https://vk.com/dev/likes.isLiked fun isLiked( type: String?, - ownerId: Int?, + ownerId: Long?, itemId: Int ): Single> { return rest.request( @@ -91,7 +91,7 @@ class ILikesService : IServiceRest() { fun checkAndAddLike( code: String?, type: String?, - ownerId: Int?, + ownerId: Long?, itemId: Int, accessKey: String? ): Single> { diff --git a/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/api/services/IMessageService.kt b/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/api/services/IMessageService.kt index 516d79e0c..1378bb045 100644 --- a/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/api/services/IMessageService.kt +++ b/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/api/services/IMessageService.kt @@ -9,7 +9,7 @@ import kotlinx.serialization.builtins.serializer class IMessageService : IServiceRest() { fun editMessage( - peedId: Int, + peedId: Long, messageId: Int, message: String?, attachment: String?, @@ -29,7 +29,7 @@ class IMessageService : IServiceRest() { } fun pin( - peerId: Int, + peerId: Long, messageId: Int ): Single> { return rest.request( @@ -40,11 +40,11 @@ class IMessageService : IServiceRest() { ) } - fun pinConversation(peerId: Int): Single> { + fun pinConversation(peerId: Long): Single> { return rest.request("messages.pinConversation", form("peer_id" to peerId), baseInt) } - fun unpinConversation(peerId: Int): Single> { + fun unpinConversation(peerId: Long): Single> { return rest.request("messages.unpinConversation", form("peer_id" to peerId), baseInt) } @@ -52,7 +52,7 @@ class IMessageService : IServiceRest() { return rest.request("messages.markAsListened", form("message_id" to message_id), baseInt) } - fun unpin(peerId: Int): Single> { + fun unpin(peerId: Long): Single> { return rest.request("messages.unpin", form("peer_id" to peerId), baseInt) } @@ -65,8 +65,8 @@ class IMessageService : IServiceRest() { * @return 1 */ fun removeChatUser( - chatId: Int, - memberId: Int + chatId: Long, + memberId: Long ): Single> { return rest.request( "messages.removeChatUser", form( @@ -76,7 +76,7 @@ class IMessageService : IServiceRest() { ) } - fun deleteChatPhoto(chatId: Int): Single> { + fun deleteChatPhoto(chatId: Long): Single> { return rest.request( "messages.deleteChatPhoto", form("chat_id" to chatId), @@ -92,8 +92,8 @@ class IMessageService : IServiceRest() { * @return 1 */ fun addChatUser( - chatId: Int, - userId: Int + chatId: Long, + userId: Long ): Single> { return rest.request( "messages.addChatUser", form( @@ -119,7 +119,7 @@ class IMessageService : IServiceRest() { * @return Returns a list of chat objects. */ fun getChat( - chatId: Int?, + chatId: Long?, chatIds: String?, fields: String?, nameCase: String? @@ -135,7 +135,7 @@ class IMessageService : IServiceRest() { } fun getConversationMembers( - peer_id: Int?, + peer_id: Long?, fields: String? ): Single> { return rest.request( @@ -156,7 +156,7 @@ class IMessageService : IServiceRest() { * @return 1 */ fun editChat( - chatId: Int, + chatId: Long, title: String? ): Single> { return rest.request( @@ -177,12 +177,12 @@ class IMessageService : IServiceRest() { fun createChat( userIds: String?, title: String? - ): Single> { + ): Single> { return rest.request( "messages.createChat", form( "user_ids" to userIds, "title" to title - ), baseInt + ), baseLong ) } @@ -192,7 +192,7 @@ class IMessageService : IServiceRest() { * @param peerId Destination ID. * @return 1 */ - fun deleteDialog(peerId: Int): Single> { + fun deleteDialog(peerId: Long): Single> { return rest.request( "messages.deleteConversation", form("peer_id" to peerId), @@ -241,7 +241,7 @@ class IMessageService : IServiceRest() { * @return 1 */ fun markAsRead( - peerId: Int?, + peerId: Long?, startMessageId: Int? ): Single> { return rest.request( @@ -272,7 +272,7 @@ class IMessageService : IServiceRest() { * @return 1 */ fun setActivity( - peerId: Int, + peerId: Long, type: String? ): Single> { return rest.request( @@ -298,7 +298,7 @@ class IMessageService : IServiceRest() { */ fun search( query: String?, - peerId: Int?, + peerId: Long?, date: Long?, previewLength: Int?, offset: Int?, @@ -381,7 +381,7 @@ class IMessageService : IServiceRest() { * and additional next_from field containing new offset value. */ fun getHistoryAttachments( - peerId: Int, + peerId: Long, mediaType: String?, startFrom: String?, count: Int?, @@ -420,7 +420,7 @@ class IMessageService : IServiceRest() { */ fun send( randomId: Long?, - peerId: Int?, + peerId: Long?, domain: String?, message: String?, latitude: Double?, @@ -534,7 +534,7 @@ class IMessageService : IServiceRest() { fun getHistory( offset: Int?, count: Int?, - peerId: Int, + peerId: Long, startMessageId: Int?, rev: Int?, extended: Int?, @@ -558,7 +558,7 @@ class IMessageService : IServiceRest() { fun getJsonHistory( offset: Int?, count: Int?, - peerId: Int + peerId: Long ): Single>> { return rest.request( "messages.getHistory", form( @@ -621,8 +621,8 @@ class IMessageService : IServiceRest() { } fun setMemberRole( - peer_id: Int?, - member_id: Int?, + peer_id: Long?, + member_id: Long?, role: String? ): Single> { return rest.request( diff --git a/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/api/services/INewsfeedService.kt b/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/api/services/INewsfeedService.kt index 41d633ca4..4d671169f 100644 --- a/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/api/services/INewsfeedService.kt +++ b/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/api/services/INewsfeedService.kt @@ -39,7 +39,7 @@ class INewsfeedService : IServiceRest() { //https://vk.com/dev/newsfeed.getMentions fun getMentions( - owner_id: Int?, + owner_id: Long?, count: Int?, offset: Int?, startTime: Long?, @@ -124,7 +124,7 @@ class INewsfeedService : IServiceRest() { //https://vk.com/dev/newsfeed.ignoreItem fun ignoreItem( type: String?, - owner_id: Int?, + owner_id: Long?, item_id: Int? ): Single> { return rest.request( diff --git a/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/api/services/IPagesService.kt b/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/api/services/IPagesService.kt index 2d8f034bf..f6df38feb 100644 --- a/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/api/services/IPagesService.kt +++ b/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/api/services/IPagesService.kt @@ -8,7 +8,7 @@ import io.reactivex.rxjava3.core.Single class IPagesService : IServiceRest() { //https://vk.com/dev/pages.get operator fun get( - ownerId: Int, + ownerId: Long, pageId: Int, global: Int?, sitePreview: Int?, diff --git a/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/api/services/IPhotosService.kt b/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/api/services/IPhotosService.kt index 9bc29cd00..fad4ad17b 100644 --- a/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/api/services/IPhotosService.kt +++ b/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/api/services/IPhotosService.kt @@ -13,7 +13,7 @@ class IPhotosService : IServiceRest() { //https://vk.com/dev/photos.deleteAlbum fun deleteAlbum( albumId: Int, - groupId: Int? + groupId: Long? ): Single> { return rest.request( "photos.deleteAlbum", form( @@ -25,7 +25,7 @@ class IPhotosService : IServiceRest() { //https://vk.com/dev/photos.restore fun restore( - ownerId: Int?, + ownerId: Long?, photoId: Int ): Single> { return rest.request( @@ -38,7 +38,7 @@ class IPhotosService : IServiceRest() { //https://vk.com/dev/photos.delete fun delete( - ownerId: Int?, + ownerId: Long?, photoId: Int ): Single> { return rest.request( @@ -51,7 +51,7 @@ class IPhotosService : IServiceRest() { //https://vk.com/dev/photos.deleteComment fun deleteComment( - ownerId: Int?, + ownerId: Long?, commentId: Int ): Single> { return rest.request( @@ -64,7 +64,7 @@ class IPhotosService : IServiceRest() { //https://vk.com/dev/photos.restoreComment fun restoreComment( - ownerId: Int?, + ownerId: Long?, commentId: Int ): Single> { return rest.request( @@ -77,7 +77,7 @@ class IPhotosService : IServiceRest() { //https://vk.com/dev/photos.getComments fun getComments( - ownerId: Int?, + ownerId: Long?, photoId: Int, needLikes: Int?, startCommentId: Int?, @@ -127,7 +127,7 @@ class IPhotosService : IServiceRest() { * @return 1 */ fun editComment( - ownerId: Int?, + ownerId: Long?, commentId: Int, message: String?, attachments: String? @@ -160,7 +160,7 @@ class IPhotosService : IServiceRest() { */ fun createAlbum( title: String?, - groupId: Int?, + groupId: Long?, description: String?, privacyView: String?, privacyComment: String?, @@ -201,7 +201,7 @@ class IPhotosService : IServiceRest() { albumId: Int, title: String?, description: String?, - ownerId: Int?, + ownerId: Long?, privacyView: String?, privacyComment: String?, uploadByAdminsOnly: Int?, @@ -230,7 +230,7 @@ class IPhotosService : IServiceRest() { * @return Returns the created photo ID. */ fun copy( - ownerId: Int, + ownerId: Long, photoId: Int, accessKey: String? ): Single> { @@ -244,7 +244,7 @@ class IPhotosService : IServiceRest() { } fun createComment( - ownerId: Int?, + ownerId: Long?, photoId: Int, fromGroup: Int?, message: String?, @@ -285,7 +285,7 @@ class IPhotosService : IServiceRest() { fun getUploadServer( albumId: Int, - groupId: Int? + groupId: Long? ): Single> { return rest.request( "photos.getUploadServer", form( @@ -319,7 +319,7 @@ class IPhotosService : IServiceRest() { ) } - fun getOwnerPhotoUploadServer(ownerId: Int?): Single> { + fun getOwnerPhotoUploadServer(ownerId: Long?): Single> { return rest.request( "photos.getOwnerPhotoUploadServer", form("owner_id" to ownerId), @@ -327,7 +327,7 @@ class IPhotosService : IServiceRest() { ) } - fun getChatUploadServer(chat_id: Int?): Single> { + fun getChatUploadServer(chat_id: Long?): Single> { return rest.request( "photos.getChatUploadServer", form("chat_id" to chat_id), @@ -336,8 +336,8 @@ class IPhotosService : IServiceRest() { } fun saveWallPhoto( - userId: Int?, - groupId: Int?, + userId: Long?, + groupId: Long?, photo: String?, server: Int, hash: String?, @@ -359,7 +359,7 @@ class IPhotosService : IServiceRest() { ) } - fun getWallUploadServer(groupId: Int?): Single> { + fun getWallUploadServer(groupId: Long?): Single> { return rest.request( "photos.getWallUploadServer", form("group_id" to groupId), @@ -369,7 +369,7 @@ class IPhotosService : IServiceRest() { fun save( albumId: Int, - groupId: Int?, + groupId: Long?, server: Int, photosList: String?, hash: String?, @@ -392,7 +392,7 @@ class IPhotosService : IServiceRest() { } operator fun get( - ownerId: Int?, + ownerId: Long?, albumId: String?, photoIds: String?, rev: Int?, @@ -416,7 +416,7 @@ class IPhotosService : IServiceRest() { } fun getUserPhotos( - ownerId: Int?, + ownerId: Long?, extended: Int?, sort: Int?, offset: Int?, @@ -434,7 +434,7 @@ class IPhotosService : IServiceRest() { } fun getAll( - ownerId: Int?, + ownerId: Long?, extended: Int?, photo_sizes: Int?, offset: Int?, @@ -479,7 +479,7 @@ class IPhotosService : IServiceRest() { } fun getAlbums( - ownerId: Int?, + ownerId: Long?, albumIds: String?, offset: Int?, count: Int?, @@ -501,7 +501,7 @@ class IPhotosService : IServiceRest() { } fun getTags( - ownerId: Int?, + ownerId: Long?, photo_id: Int?, access_key: String? ): Single>> { @@ -515,7 +515,7 @@ class IPhotosService : IServiceRest() { } fun getAllComments( - ownerId: Int?, + ownerId: Long?, album_id: Int?, need_likes: Int?, offset: Int?, diff --git a/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/api/services/IPollsService.kt b/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/api/services/IPollsService.kt index 1551bc819..4c6725e66 100644 --- a/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/api/services/IPollsService.kt +++ b/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/api/services/IPollsService.kt @@ -11,7 +11,7 @@ class IPollsService : IServiceRest() { question: String?, isAnonymous: Int?, isMultiple: Int?, - ownerId: Int?, + ownerId: Long?, addAnswers: String? ): Single> { return rest.request( @@ -27,7 +27,7 @@ class IPollsService : IServiceRest() { //https://vk.com/dev/polls.deleteVote fun deleteVote( - ownerId: Int?, + ownerId: Long?, pollId: Int, answerId: Long, isBoard: Int? @@ -44,7 +44,7 @@ class IPollsService : IServiceRest() { //https://vk.com/dev/polls.addVote fun addVote( - ownerId: Int?, + ownerId: Long?, pollId: Int, answerIds: String?, isBoard: Int? @@ -60,7 +60,7 @@ class IPollsService : IServiceRest() { } fun getById( - ownerId: Int?, + ownerId: Long?, isBoard: Int?, pollId: Int? ): Single> { @@ -74,7 +74,7 @@ class IPollsService : IServiceRest() { } fun getVoters( - ownerId: Int, + ownerId: Long, pollId: Int, isBoard: Int?, answer_ids: String, diff --git a/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/api/services/IStatusService.kt b/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/api/services/IStatusService.kt index 1cec90062..423f28d62 100644 --- a/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/api/services/IStatusService.kt +++ b/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/api/services/IStatusService.kt @@ -14,7 +14,7 @@ class IStatusService : IServiceRest() { */ operator fun set( text: String?, - groupId: Int? + groupId: Long? ): Single> { return rest.request( "status.set", form( diff --git a/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/api/services/IUsersService.kt b/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/api/services/IUsersService.kt index b92c7d15e..a7dbcece5 100644 --- a/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/api/services/IUsersService.kt +++ b/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/api/services/IUsersService.kt @@ -12,7 +12,7 @@ import io.reactivex.rxjava3.core.Single class IUsersService : IServiceRest() { fun getUserWallInfo( code: String?, - userId: Int, + userId: Long, fields: String?, nameCase: String? ): Single> { @@ -28,7 +28,7 @@ class IUsersService : IServiceRest() { //https://vk.com/dev/users.getFollowers fun getFollowers( - userId: Int?, + userId: Long?, offset: Int?, count: Int?, fields: String?, @@ -96,7 +96,7 @@ class IUsersService : IServiceRest() { interests: String?, company: String?, position: String?, - groupId: Int?, + groupId: Long?, fromList: String? ): Single>> { return rest.request( @@ -193,7 +193,7 @@ class IUsersService : IServiceRest() { } fun report( - userId: Int?, + userId: Long?, type: String?, comment: String? ): Single> { @@ -207,7 +207,7 @@ class IUsersService : IServiceRest() { } fun getStory( - owner_id: Int?, + owner_id: Long?, extended: Int?, fields: String? ): Single> { @@ -221,7 +221,7 @@ class IUsersService : IServiceRest() { } fun getNarratives( - owner_id: Int, + owner_id: Long, offset: Int?, count: Int? ): Single>> { @@ -249,7 +249,7 @@ class IUsersService : IServiceRest() { } fun getGifts( - user_id: Int?, + user_id: Long?, count: Int?, offset: Int? ): Single>> { @@ -264,7 +264,7 @@ class IUsersService : IServiceRest() { fun searchStory( q: String?, - mentioned_id: Int?, + mentioned_id: Long?, count: Int?, extended: Int?, fields: String? @@ -282,7 +282,7 @@ class IUsersService : IServiceRest() { fun checkAndAddFriend( code: String?, - user_id: Int? + user_id: Long? ): Single> { return rest.request( "execute", form( diff --git a/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/api/services/IUtilsService.kt b/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/api/services/IUtilsService.kt index 0f9badb9d..db9e3fd80 100644 --- a/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/api/services/IUtilsService.kt +++ b/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/api/services/IUtilsService.kt @@ -60,7 +60,7 @@ class IUtilsService : IServiceRest() { } fun getInviteLink( - peer_id: Int?, + peer_id: Long?, reset: Int? ): Single> { return rest.request( diff --git a/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/api/services/IVideoService.kt b/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/api/services/IVideoService.kt index 6f4cde8be..8758bddf7 100644 --- a/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/api/services/IVideoService.kt +++ b/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/api/services/IVideoService.kt @@ -11,7 +11,7 @@ import io.reactivex.rxjava3.core.Single class IVideoService : IServiceRest() { fun getComments( - ownerId: Int?, + ownerId: Long?, videoId: Int, needLikes: Int?, startCommentId: Int?, @@ -37,9 +37,9 @@ class IVideoService : IServiceRest() { } fun addVideo( - targetId: Int?, + targetId: Long?, videoId: Int?, - ownerId: Int? + ownerId: Long? ): Single> { return rest.request( "video.add", form( @@ -52,8 +52,8 @@ class IVideoService : IServiceRest() { fun deleteVideo( videoId: Int?, - ownerId: Int?, - targetId: Int? + ownerId: Long?, + targetId: Long? ): Single> { return rest.request( "video.delete", form( @@ -65,7 +65,7 @@ class IVideoService : IServiceRest() { } fun getAlbums( - ownerId: Int?, + ownerId: Long?, offset: Int?, count: Int?, extended: Int?, @@ -83,8 +83,8 @@ class IVideoService : IServiceRest() { } fun getAlbumsByVideo( - target_id: Int?, - owner_id: Int?, + target_id: Long?, + owner_id: Long?, video_id: Int?, extended: Int? ): Single>> { @@ -129,7 +129,7 @@ class IVideoService : IServiceRest() { } fun restoreComment( - ownerId: Int?, + ownerId: Long?, commentId: Int ): Single> { return rest.request( @@ -141,7 +141,7 @@ class IVideoService : IServiceRest() { } fun deleteComment( - ownerId: Int?, + ownerId: Long?, commentId: Int ): Single> { return rest.request( @@ -153,7 +153,7 @@ class IVideoService : IServiceRest() { } operator fun get( - ownerId: Int?, + ownerId: Long?, videos: String?, albumId: Int?, count: Int?, @@ -173,7 +173,7 @@ class IVideoService : IServiceRest() { } fun createComment( - ownerId: Int?, + ownerId: Long?, videoId: Int, message: String?, attachments: String?, @@ -197,7 +197,7 @@ class IVideoService : IServiceRest() { } fun editComment( - ownerId: Int?, + ownerId: Long?, commentId: Int, message: String?, attachments: String? @@ -213,7 +213,7 @@ class IVideoService : IServiceRest() { } fun edit( - ownerId: Int?, + ownerId: Long?, video_id: Int, name: String?, desc: String? diff --git a/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/api/services/IWallService.kt b/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/api/services/IWallService.kt index 6447c830e..45f21c61b 100644 --- a/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/api/services/IWallService.kt +++ b/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/api/services/IWallService.kt @@ -7,7 +7,7 @@ import io.reactivex.rxjava3.core.Single class IWallService : IServiceRest() { //https://vk.com/dev/wall.search fun search( - ownerId: Int?, + ownerId: Long?, domain: String?, query: String?, ownersOnly: Int?, @@ -32,7 +32,7 @@ class IWallService : IServiceRest() { //https://vk.com/dev/wall.edit fun edit( - ownerId: Int?, + ownerId: Long?, postId: Int?, friendsOnly: Int?, message: String?, @@ -65,7 +65,7 @@ class IWallService : IServiceRest() { //https://vk.com/dev/wall.pin fun pin( - ownerId: Int?, + ownerId: Long?, postId: Int ): Single> { return rest.request( @@ -78,7 +78,7 @@ class IWallService : IServiceRest() { //https://vk.com/dev/wall.unpin fun unpin( - ownerId: Int?, + ownerId: Long?, postId: Int ): Single> { return rest.request( @@ -93,7 +93,7 @@ class IWallService : IServiceRest() { fun repost( pobject: String?, message: String?, - groupId: Int?, + groupId: Long?, markAsAds: Int? ): Single> { return rest.request( @@ -108,7 +108,7 @@ class IWallService : IServiceRest() { //https://vk.com/dev/wall.post fun post( - ownerId: Int?, + ownerId: Long?, friendsOnly: Int?, fromGroup: Int?, message: String?, @@ -154,7 +154,7 @@ class IWallService : IServiceRest() { * @return 1 */ fun delete( - ownerId: Int?, + ownerId: Long?, postId: Int ): Single> { return rest.request( @@ -174,7 +174,7 @@ class IWallService : IServiceRest() { * @return 1 */ fun restoreComment( - ownerId: Int?, + ownerId: Long?, commentId: Int ): Single> { return rest.request( @@ -194,7 +194,7 @@ class IWallService : IServiceRest() { * @return 1 */ fun deleteComment( - ownerId: Int?, + ownerId: Long?, commentId: Int ): Single> { return rest.request( @@ -215,7 +215,7 @@ class IWallService : IServiceRest() { * @return 1 */ fun restore( - ownerId: Int?, + ownerId: Long?, postId: Int ): Single> { return rest.request( @@ -248,7 +248,7 @@ class IWallService : IServiceRest() { * @return 1 */ fun editComment( - ownerId: Int?, + ownerId: Long?, commentId: Int, message: String?, attachments: String? @@ -264,9 +264,9 @@ class IWallService : IServiceRest() { } fun createComment( - ownerId: Int?, + ownerId: Long?, postId: Int, - fromGroup: Int?, + fromGroup: Long?, message: String?, replyToComment: Int?, attachments: String?, @@ -289,7 +289,7 @@ class IWallService : IServiceRest() { //https://vk.com/dev/wall.getComments fun getComments( - ownerId: Int?, + ownerId: Long?, postId: Int, needLikes: Int?, startCommentId: Int?, @@ -317,7 +317,7 @@ class IWallService : IServiceRest() { } operator fun get( - ownerId: Int?, + ownerId: Long?, domain: String?, offset: Int?, count: Int?, @@ -355,7 +355,7 @@ class IWallService : IServiceRest() { } fun reportComment( - owner_id: Int?, + owner_id: Long?, comment_id: Int?, reason: Int? ): Single> { @@ -369,7 +369,7 @@ class IWallService : IServiceRest() { } fun reportPost( - owner_id: Int?, + owner_id: Long?, post_id: Int?, reason: Int? ): Single> { @@ -382,11 +382,11 @@ class IWallService : IServiceRest() { ) } - fun subscribe(owner_id: Int?): Single> { + fun subscribe(owner_id: Long?): Single> { return rest.request("wall.subscribe", form("owner_id" to owner_id), baseInt) } - fun unsubscribe(owner_id: Int?): Single> { + fun unsubscribe(owner_id: Long?): Single> { return rest.request("wall.unsubscribe", form("owner_id" to owner_id), baseInt) } } \ No newline at end of file diff --git a/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/crypt/AesKeyPair.kt b/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/crypt/AesKeyPair.kt index ced7cb7be..bfe7c403b 100644 --- a/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/crypt/AesKeyPair.kt +++ b/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/crypt/AesKeyPair.kt @@ -3,9 +3,9 @@ package dev.ragnarok.fenrir.crypt class AesKeyPair { var version = 0 private set - var accountId = 0 + var accountId = 0L private set - var peerId = 0 + var peerId = 0L private set var sessionId: Long = 0 private set @@ -20,12 +20,12 @@ class AesKeyPair { lateinit var hisAesKey: String private set - fun setAccountId(accountId: Int): AesKeyPair { + fun setAccountId(accountId: Long): AesKeyPair { this.accountId = accountId return this } - fun setPeerId(peerId: Int): AesKeyPair { + fun setPeerId(peerId: Long): AesKeyPair { this.peerId = peerId return this } diff --git a/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/crypt/KeyExchangeService.kt b/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/crypt/KeyExchangeService.kt index a51fd035d..ab52b533b 100644 --- a/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/crypt/KeyExchangeService.kt +++ b/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/crypt/KeyExchangeService.kt @@ -78,23 +78,23 @@ class KeyExchangeService : Service() { override fun onStartCommand(intent: Intent?, flags: Int, startId: Int): Int { when (intent?.action) { ACTION_PROCESS_MESSAGE -> { - val accountId = intent.extras!!.getInt(Extra.ACCOUNT_ID) - val peerId = intent.extras!!.getInt(Extra.PEER_ID) + val accountId = intent.extras!!.getLong(Extra.ACCOUNT_ID) + val peerId = intent.extras!!.getLong(Extra.PEER_ID) val messageId = intent.extras!!.getInt(Extra.MESSAGE_ID) val message: ExchangeMessage = intent.getParcelableExtraCompat(Extra.MESSAGE)!! processNewKeyExchangeMessage(accountId, peerId, messageId, message) } ACTION_INICIATE_KEY_EXCHANGE -> { - val accountId = intent.extras!!.getInt(Extra.ACCOUNT_ID) - val peerId = intent.extras!!.getInt(Extra.PEER_ID) + val accountId = intent.extras!!.getLong(Extra.ACCOUNT_ID) + val peerId = intent.extras!!.getLong(Extra.PEER_ID) @KeyLocationPolicy val keyLocationPolicy = intent.extras!!.getInt( EXTRA_KEY_LOCATION_POLICY ) initiateKeyExchange(accountId, peerId, keyLocationPolicy) } ACTION_APPLY_EXHANGE -> { - val accountId = intent.extras!!.getInt(Extra.ACCOUNT_ID) - val peerId = intent.extras!!.getInt(Extra.PEER_ID) + val accountId = intent.extras!!.getLong(Extra.ACCOUNT_ID) + val peerId = intent.extras!!.getLong(Extra.PEER_ID) val messageId = intent.extras!!.getInt(Extra.MESSAGE_ID) val message: ExchangeMessage = intent.getParcelableExtraCompat(Extra.MESSAGE)!! if (AppPerms.hasNotificationPermissionSimple(this)) { @@ -106,8 +106,8 @@ class KeyExchangeService : Service() { processKeyExchangeMessage(accountId, peerId, messageId, message, false) } ACTION_DECLINE -> { - val accountId = intent.extras!!.getInt(Extra.ACCOUNT_ID) - val peerId = intent.extras!!.getInt(Extra.PEER_ID) + val accountId = intent.extras!!.getLong(Extra.ACCOUNT_ID) + val peerId = intent.extras!!.getLong(Extra.PEER_ID) val message: ExchangeMessage = intent.getParcelableExtraCompat(Extra.MESSAGE)!! declineInputSession(accountId, peerId, message) } @@ -116,7 +116,7 @@ class KeyExchangeService : Service() { return START_NOT_STICKY } - private fun declineInputSession(accountId: Int, peerId: Int, message: ExchangeMessage) { + private fun declineInputSession(accountId: Long, peerId: Long, message: ExchangeMessage) { notifyOpponentAboutSessionFail( accountId, peerId, @@ -126,8 +126,8 @@ class KeyExchangeService : Service() { } private fun processNewKeyExchangeMessage( - accountId: Int, - peerId: Int, + accountId: Long, + peerId: Long, messageId: Int, message: ExchangeMessage ) { @@ -151,7 +151,7 @@ class KeyExchangeService : Service() { return null } - private fun findSessionFor(accountId: Int, peerId: Int): KeyExchangeSession? { + private fun findSessionFor(accountId: Long, peerId: Long): KeyExchangeSession? { for (i in 0 until mCurrentActiveSessions.size()) { val key = mCurrentActiveSessions.keyAt(i) val session = mCurrentActiveSessions[key] @@ -168,8 +168,8 @@ class KeyExchangeService : Service() { @SuppressLint("CheckResult") private fun initiateKeyExchange( - accountId: Int, - peerId: Int, + accountId: Long, + peerId: Long, @KeyLocationPolicy keyLocationPolicy: Int ) { val existsSession = findSessionFor(accountId, peerId) @@ -229,8 +229,8 @@ class KeyExchangeService : Service() { } private fun notifyOpponentAboutSessionFail( - accountId: Int, - peerId: Int, + accountId: Long, + peerId: Long, sessionId: Long, errorCode: Int ) { @@ -242,8 +242,8 @@ class KeyExchangeService : Service() { } private fun displayUserConfirmNotification( - accountId: Int, - peerId: Int, + accountId: Long, + peerId: Long, messageId: Int, message: ExchangeMessage ) { @@ -270,7 +270,7 @@ class KeyExchangeService : Service() { return mCurrentActiveNotifications.get(sessionId, null) } - private fun notifyAboutKeyExchangeAsync(accountId: Int, peerId: Int, sessionId: Long) { + private fun notifyAboutKeyExchangeAsync(accountId: Long, peerId: Long, sessionId: Long) { mCompositeSubscription.add(OwnerInfo.getRx(this, accountId, Peer.toUserId(peerId)) .fromIOToMain() .subscribe({ userInfo -> @@ -301,8 +301,8 @@ class KeyExchangeService : Service() { @SuppressLint("MissingPermission") private fun displayUserConfirmNotificationImpl( - accountId: Int, - peerId: Int, + accountId: Long, + peerId: Long, messageId: Int, message: ExchangeMessage, ownerInfo: OwnerInfo @@ -358,7 +358,7 @@ class KeyExchangeService : Service() { } private fun processKeyExchangeMessage( - accountId: Int, peerId: Int, messageId: Int, + accountId: Long, peerId: Long, messageId: Int, message: ExchangeMessage, needConfirmIfSessionNotStarted: Boolean ) { var session = mCurrentActiveSessions[message.sessionId] @@ -437,8 +437,8 @@ class KeyExchangeService : Service() { } private fun processNoIniciatorFinished( - accountId: Int, - peerId: Int, + accountId: Long, + peerId: Long, session: KeyExchangeSession ) { storeKeyToDatabase(accountId, peerId, session) @@ -508,7 +508,7 @@ class KeyExchangeService : Service() { } @SuppressLint("CheckResult") - private fun storeKeyToDatabase(accountId: Int, peerId: Int, session: KeyExchangeSession) { + private fun storeKeyToDatabase(accountId: Long, peerId: Long, session: KeyExchangeSession) { val pair = AesKeyPair() .setVersion(currentVersion) .setAccountId(accountId) @@ -527,8 +527,8 @@ class KeyExchangeService : Service() { } private fun processIniciatorState2( - accountId: Int, - peerId: Int, + accountId: Long, + peerId: Long, session: KeyExchangeSession, message: ExchangeMessage ) { @@ -544,8 +544,8 @@ class KeyExchangeService : Service() { } private fun processIniciatorState1( - accountId: Int, - peerId: Int, + accountId: Long, + peerId: Long, session: KeyExchangeSession, message: ExchangeMessage ) { @@ -586,8 +586,8 @@ class KeyExchangeService : Service() { //NO_INITIATOR_STATE_1 private fun processNoIniciatorState1( - accountId: Int, - peerId: Int, + accountId: Long, + peerId: Long, session: KeyExchangeSession, message: ExchangeMessage ) { @@ -620,8 +620,8 @@ class KeyExchangeService : Service() { //NO_INITIATOR_EMPTY private fun processNoIniciatorEmptyState( - accountId: Int, - peerId: Int, + accountId: Long, + peerId: Long, session: KeyExchangeSession, message: ExchangeMessage ) { @@ -661,7 +661,7 @@ class KeyExchangeService : Service() { } @SuppressLint("CheckResult") - private fun sendMessage(accountId: Int, peerId: Int, message: ExchangeMessage) { + private fun sendMessage(accountId: Long, peerId: Long, message: ExchangeMessage) { d(TAG, "sendMessage, message: $message") sendMessageImpl(accountId, peerId, message) .fromIOToMain() @@ -735,7 +735,7 @@ class KeyExchangeService : Service() { private const val NOTIFICATION_KEY_EXCHANGE = 20 private const val NOTIFICATION_KEY_EXCHANGE_REQUEST = 10 private const val WHAT_STOP_SERVICE = 12 - fun intercept(context: Context, accountId: Int, dto: VKApiMessage?): Boolean { + fun intercept(context: Context, accountId: Long, dto: VKApiMessage?): Boolean { return if (dto == null) { false } else intercept( @@ -750,8 +750,8 @@ class KeyExchangeService : Service() { fun intercept( context: Context, - accountId: Int, - peerId: Int, + accountId: Long, + peerId: Long, messageId: Int, messageBody: String?, out: Boolean @@ -788,8 +788,8 @@ class KeyExchangeService : Service() { } internal fun sendMessageImpl( - accountId: Int, - peerId: Int, + accountId: Long, + peerId: Long, message: ExchangeMessage ): Single { return Single.just(Any()) @@ -815,8 +815,8 @@ class KeyExchangeService : Service() { } fun iniciateKeyExchangeSession( - context: Context, accountId: Int, - peerId: Int, @KeyLocationPolicy policy: Int + context: Context, accountId: Long, + peerId: Long, @KeyLocationPolicy policy: Int ) { val intent = Intent(context, KeyExchangeService::class.java) intent.action = ACTION_INICIATE_KEY_EXCHANGE @@ -828,8 +828,8 @@ class KeyExchangeService : Service() { private fun processMessage( context: Context, - accountId: Int, - peerId: Int, + accountId: Long, + peerId: Long, messageId: Int, message: ExchangeMessage ) { @@ -845,8 +845,8 @@ class KeyExchangeService : Service() { fun createIntentForApply( context: Context, message: ExchangeMessage, - accountId: Int, - peerId: Int, + accountId: Long, + peerId: Long, messageId: Int ): Intent { val apply = Intent(context, KeyExchangeService::class.java) @@ -861,8 +861,8 @@ class KeyExchangeService : Service() { fun createIntentForDecline( context: Context, message: ExchangeMessage, - accountId: Int, - peerId: Int, + accountId: Long, + peerId: Long, messageId: Int ): Intent { val intent = Intent(context, KeyExchangeService::class.java) diff --git a/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/crypt/KeyExchangeSession.kt b/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/crypt/KeyExchangeSession.kt index 3d641976d..ea2c78699 100644 --- a/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/crypt/KeyExchangeSession.kt +++ b/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/crypt/KeyExchangeSession.kt @@ -5,8 +5,8 @@ import java.util.* class KeyExchangeSession private constructor( val id: Long, - val accountId: Int, - val peerId: Int, + val accountId: Long, + val peerId: Long, @KeyLocationPolicy val keyLocationPolicy: Int ) { @@ -37,8 +37,8 @@ class KeyExchangeSession private constructor( companion object { fun createOutSession( id: Long, - accountId: Int, - peerId: Int, + accountId: Long, + peerId: Long, @KeyLocationPolicy keyLocationPolicy: Int ): KeyExchangeSession { val session = KeyExchangeSession(id, accountId, peerId, keyLocationPolicy) @@ -48,8 +48,8 @@ class KeyExchangeSession private constructor( fun createInputSession( id: Long, - accountId: Int, - peerId: Int, + accountId: Long, + peerId: Long, @KeyLocationPolicy keyLocationPolicy: Int ): KeyExchangeSession { val session = KeyExchangeSession(id, accountId, peerId, keyLocationPolicy) diff --git a/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/db/DBHelper.kt b/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/db/DBHelper.kt index e825b0e1e..0c8ab9392 100644 --- a/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/db/DBHelper.kt +++ b/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/db/DBHelper.kt @@ -12,7 +12,7 @@ import dev.ragnarok.fenrir.db.column.attachments.WallAttachmentsColumns import dev.ragnarok.fenrir.module.FenrirNative import java.util.concurrent.ConcurrentHashMap -class DBHelper private constructor(context: Context, aid: Int) : +class DBHelper private constructor(context: Context, aid: Long) : SQLiteOpenHelper(context, getDatabaseFileName(aid), null, Constants.DATABASE_FENRIR_VERSION) { override fun onOpen(db: SQLiteDatabase) { super.onOpen(db) @@ -795,10 +795,10 @@ class DBHelper private constructor(context: Context, aid: Int) : companion object { const val TAG = "DBHelper" - private val dbHelperMap: MutableMap = ConcurrentHashMap() + private val dbHelperMap: MutableMap = ConcurrentHashMap() @Synchronized - fun getInstance(context: Context, aid: Int): DBHelper { + fun getInstance(context: Context, aid: Long): DBHelper { var helper = dbHelperMap[aid] if (helper == null) { helper = DBHelper(context, aid) @@ -807,12 +807,12 @@ class DBHelper private constructor(context: Context, aid: Int) : return helper } - fun removeDatabaseFor(context: Context, aid: Int) { + fun removeDatabaseFor(context: Context, aid: Long) { dbHelperMap.remove(aid) context.deleteDatabase(getDatabaseFileName(aid)) } - internal fun getDatabaseFileName(aid: Int): String { + internal fun getDatabaseFileName(aid: Long): String { return if (!FenrirNative.isNativeLoaded) "fenrir_uncompressed_$aid.sqlite" else "fenrir_$aid.sqlite" } } diff --git a/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/db/FenrirContentProvider.kt b/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/db/FenrirContentProvider.kt index fdcd712ac..56245bd9f 100644 --- a/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/db/FenrirContentProvider.kt +++ b/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/db/FenrirContentProvider.kt @@ -328,57 +328,57 @@ class FenrirContentProvider : ContentProvider() { } */ - fun getKeysContentUriFor(aid: Int): Uri { + fun getKeysContentUriFor(aid: Long): Uri { return appendAccountId(KEYS_CONTENT_URI, aid) } - fun getGroupsDetContentUriFor(aid: Int): Uri { + fun getGroupsDetContentUriFor(aid: Long): Uri { return appendAccountId(GROUPS_DET_CONTENT_URI, aid) } - fun getFavePostsContentUriFor(aid: Int): Uri { + fun getFavePostsContentUriFor(aid: Long): Uri { return appendAccountId(FAVE_POSTS_CONTENT_URI, aid) } - fun getFaveLinksContentUriFor(aid: Int): Uri { + fun getFaveLinksContentUriFor(aid: Long): Uri { return appendAccountId(FAVE_LINKS_CONTENT_URI, aid) } - fun getFavePhotosContentUriFor(aid: Int): Uri { + fun getFavePhotosContentUriFor(aid: Long): Uri { return appendAccountId(FAVE_PHOTOS_CONTENT_URI, aid) } - fun getFaveUsersContentUriFor(aid: Int): Uri { + fun getFaveUsersContentUriFor(aid: Long): Uri { return appendAccountId(FAVE_PAGES_CONTENT_URI, aid) } - fun getFaveGroupsContentUriFor(aid: Int): Uri { + fun getFaveGroupsContentUriFor(aid: Long): Uri { return appendAccountId(FAVE_GROUPS_CONTENT_URI, aid) } - fun getFaveVideosContentUriFor(aid: Int): Uri { + fun getFaveVideosContentUriFor(aid: Long): Uri { return appendAccountId(FAVE_VIDEOS_CONTENT_URI, aid) } - fun getFaveArticlesContentUriFor(aid: Int): Uri { + fun getFaveArticlesContentUriFor(aid: Long): Uri { return appendAccountId(FAVE_ARTICLES_CONTENT_URI, aid) } - fun getFaveProductsContentUriFor(aid: Int): Uri { + fun getFaveProductsContentUriFor(aid: Long): Uri { return appendAccountId(FAVE_PRODUCTS_CONTENT_URI, aid) } - fun getTopicsContentUriFor(aid: Int): Uri { + fun getTopicsContentUriFor(aid: Long): Uri { return appendAccountId(TOPICS_CONTENT_URI, aid) } @@ -386,120 +386,120 @@ class FenrirContentProvider : ContentProvider() { // return appendAccountId(POLL_CONTENT_URI, aid); //} - fun getMessagesAttachmentsContentUriFor(aid: Int): Uri { + fun getMessagesAttachmentsContentUriFor(aid: Long): Uri { return appendAccountId(MESSAGES_ATTACHMENTS_CONTENT_URI, aid) } - fun getPostsAttachmentsContentUriFor(aid: Int): Uri { + fun getPostsAttachmentsContentUriFor(aid: Long): Uri { return appendAccountId(POSTS_ATTACHMENTS_CONTENT_URI, aid) } - fun getPostsContentUriFor(aid: Int): Uri { + fun getPostsContentUriFor(aid: Long): Uri { return appendAccountId(POSTS_CONTENT_URI, aid) } - fun getVideosContentUriFor(aid: Int): Uri { + fun getVideosContentUriFor(aid: Long): Uri { return appendAccountId(VIDEOS_CONTENT_URI, aid) } - fun getVideoAlbumsContentUriFor(aid: Int): Uri { + fun getVideoAlbumsContentUriFor(aid: Long): Uri { return appendAccountId(VIDEO_ALBUMS_CONTENT_URI, aid) } - fun getDocsContentUriFor(aid: Int): Uri { + fun getDocsContentUriFor(aid: Long): Uri { return appendAccountId(DOCS_CONTENT_URI, aid) } - fun getPhotosContentUriFor(aid: Int): Uri { + fun getPhotosContentUriFor(aid: Long): Uri { return appendAccountId(PHOTOS_CONTENT_URI, aid) } - fun getPhotosExtendedContentUriFor(aid: Int): Uri { + fun getPhotosExtendedContentUriFor(aid: Long): Uri { return appendAccountId(PHOTOS_EXTENDED_CONTENT_URI, aid) } - fun getCommentsContentUriFor(aid: Int): Uri { + fun getCommentsContentUriFor(aid: Long): Uri { return appendAccountId(COMMENTS_CONTENT_URI, aid) } - fun getCommentsAttachmentsContentUriFor(aid: Int): Uri { + fun getCommentsAttachmentsContentUriFor(aid: Long): Uri { return appendAccountId(COMMENTS_ATTACHMENTS_CONTENT_URI, aid) } - fun getDialogsContentUriFor(aid: Int): Uri { + fun getDialogsContentUriFor(aid: Long): Uri { return appendAccountId(DIALOGS_CONTENT_URI, aid) } - fun getPeersContentUriFor(aid: Int): Uri { + fun getPeersContentUriFor(aid: Long): Uri { return appendAccountId(PEERS_CONTENT_URI, aid) } - fun getRelativeshipContentUriFor(aid: Int): Uri { + fun getRelativeshipContentUriFor(aid: Long): Uri { return appendAccountId(RELATIVESHIP_CONTENT_URI, aid) } - fun getUserContentUriFor(aid: Int): Uri { + fun getUserContentUriFor(aid: Long): Uri { return appendAccountId(USER_CONTENT_URI, aid) } - fun getUserDetContentUriFor(aid: Int): Uri { + fun getUserDetContentUriFor(aid: Long): Uri { return appendAccountId(USER_DET_CONTENT_URI, aid) } - fun getGroupsContentUriFor(aid: Int): Uri { + fun getGroupsContentUriFor(aid: Long): Uri { return appendAccountId(GROUPS_CONTENT_URI, aid) } - fun getNewsContentUriFor(aid: Int): Uri { + fun getNewsContentUriFor(aid: Long): Uri { return appendAccountId(NEWS_CONTENT_URI, aid) } - fun getMessageContentUriFor(aid: Int): Uri { + fun getMessageContentUriFor(aid: Long): Uri { return appendAccountId(MESSAGE_CONTENT_URI, aid) } - fun getCountriesContentUriFor(aid: Int): Uri { + fun getCountriesContentUriFor(aid: Long): Uri { return appendAccountId(COUNTRIES_CONTENT_URI, aid) } - fun getNotificationsContentUriFor(aid: Int): Uri { + fun getNotificationsContentUriFor(aid: Long): Uri { return appendAccountId(NOTIFICATIONS_CONTENT_URI, aid) } - fun getFeedListsContentUriFor(aid: Int): Uri { + fun getFeedListsContentUriFor(aid: Long): Uri { return appendAccountId(FEED_LISTS_CONTENT_URI, aid) } - fun getPhotoAlbumsContentUriFor(aid: Int): Uri { + fun getPhotoAlbumsContentUriFor(aid: Long): Uri { return appendAccountId(PHOTO_ALBUMS_CONTENT_URI, aid) } - fun getFriendListsContentUriFor(aid: Int): Uri { + fun getFriendListsContentUriFor(aid: Long): Uri { return appendAccountId(FRIEND_LISTS_CONTENT_URI, aid) } - private fun appendAccountId(uri: Uri, aid: Int): Uri { + private fun appendAccountId(uri: Uri, aid: Long): Uri { return Uri.Builder() .scheme(uri.scheme) .authority(uri.authority) @@ -1301,15 +1301,15 @@ class FenrirContentProvider : ContentProvider() { return true } - private fun getDbHelper(aid: Int): DBHelper { + private fun getDbHelper(aid: Long): DBHelper { return DBHelper.getInstance(context!!, aid) } - private fun extractAidFromUri(uri: Uri): Int { + private fun extractAidFromUri(uri: Uri): Long { val said = uri.getQueryParameter(AID) require(said.nonNullNoEmpty()) { "AID query parameter not found, uri: $uri" } - val targetAid = said.toInt() - require(targetAid != 0) { "Invalid account id=0, uri: $uri" } + val targetAid = said.toLong() + require(targetAid != 0L) { "Invalid account id=0, uri: $uri" } return targetAid } @@ -1318,7 +1318,7 @@ class FenrirContentProvider : ContentProvider() { * Потому что будет открыватся транзакция только к одной базе данных */ private fun validateUris(operations: List) { - var aid: Int? = null + var aid: Long? = null for (operation in operations) { val uri: Uri = operation.uri if (aid == null) { @@ -1502,8 +1502,8 @@ class FenrirContentProvider : ContentProvider() { } safeNotifyChange(resultUri) if (matchUri == URI_MESSAGES && values != null) { - val peerId: Int = values.getAsInteger(MessageColumns.PEER_ID) - val dUri: Uri = ContentUris.withAppendedId(DIALOGS_CONTENT_URI, peerId.toLong()) + val peerId: Long = values.getAsLong(MessageColumns.PEER_ID) + val dUri: Uri = ContentUris.withAppendedId(DIALOGS_CONTENT_URI, peerId) safeNotifyChange(dUri) } return resultUri diff --git a/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/db/OwnerHelper.kt b/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/db/OwnerHelper.kt index 4f23ce006..52981063c 100644 --- a/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/db/OwnerHelper.kt +++ b/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/db/OwnerHelper.kt @@ -9,8 +9,8 @@ import dev.ragnarok.fenrir.db.column.UserColumns import dev.ragnarok.fenrir.getString object OwnerHelper { - fun loadOwnerFullName(context: Context, aid: Int, ownerId: Int): String? { - if (ownerId == 0) return null + fun loadOwnerFullName(context: Context, aid: Long, ownerId: Long): String? { + if (ownerId == 0L) return null var result: String? = null if (ownerId > 0) { val uCursor = context.contentResolver.query( diff --git a/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/db/PeerStateEntity.kt b/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/db/PeerStateEntity.kt index f41afa16f..6ba33f7c1 100644 --- a/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/db/PeerStateEntity.kt +++ b/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/db/PeerStateEntity.kt @@ -1,6 +1,6 @@ package dev.ragnarok.fenrir.db -class PeerStateEntity(val peerId: Int) { +class PeerStateEntity(val peerId: Long) { var unreadCount = 0 private set var lastMessageId = 0 diff --git a/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/db/column/FriendListsColumns.kt b/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/db/column/FriendListsColumns.kt index e5b2cc792..2a206492e 100644 --- a/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/db/column/FriendListsColumns.kt +++ b/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/db/column/FriendListsColumns.kt @@ -13,7 +13,7 @@ object FriendListsColumns : BaseColumns { const val FULL_USER_ID = "$TABLENAME.$USER_ID" const val FULL_LIST_ID = "$TABLENAME.$LIST_ID" const val FULL_NAME = "$TABLENAME.$NAME" - fun getCv(userId: Int, list: VKApiFriendList): ContentValues { + fun getCv(userId: Long, list: VKApiFriendList): ContentValues { val cv = ContentValues() cv.put(USER_ID, userId) cv.put(LIST_ID, list.id) diff --git a/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/db/column/RelationshipColumns.kt b/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/db/column/RelationshipColumns.kt index cb9e2baab..93e32956b 100644 --- a/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/db/column/RelationshipColumns.kt +++ b/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/db/column/RelationshipColumns.kt @@ -56,7 +56,7 @@ object RelationshipColumns : BaseColumns { const val FOREIGN_SUBJECT_GROUP_TYPE = "subject_group_type" const val FOREIGN_SUBJECT_GROUP_HAS_UNSEEN_STORIES = "subject_group_has_unseen_stories" - fun getCV(objectId: Int, subjectId: Int, type: Int): ContentValues { + fun getCV(objectId: Long, subjectId: Long, type: Int): ContentValues { val cv = ContentValues() cv.put(OBJECT_ID, objectId) cv.put(SUBJECT_ID, subjectId) diff --git a/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/db/impl/AbsStorage.kt b/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/db/impl/AbsStorage.kt index a21ab75a4..ea3da3643 100644 --- a/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/db/impl/AbsStorage.kt +++ b/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/db/impl/AbsStorage.kt @@ -15,7 +15,7 @@ open class AbsStorage(private val mRepositoryContext: AppStorages) : IStorage { val context: Context get() = mRepositoryContext.applicationContext - fun helper(accountId: Int): DBHelper { + fun helper(accountId: Long): DBHelper { return DBHelper.getInstance(context, accountId) } diff --git a/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/db/impl/AttachmentsStorage.kt b/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/db/impl/AttachmentsStorage.kt index c330f534e..4633ec6cc 100644 --- a/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/db/impl/AttachmentsStorage.kt +++ b/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/db/impl/AttachmentsStorage.kt @@ -30,7 +30,7 @@ import io.reactivex.rxjava3.core.SingleEmitter internal class AttachmentsStorage(base: AppStorages) : AbsStorage(base), IAttachmentsStorage { override fun attachDbos( - accountId: Int, + accountId: Long, attachToType: Int, attachToDbid: Int, entities: List @@ -60,7 +60,7 @@ internal class AttachmentsStorage(base: AppStorages) : AbsStorage(base), IAttach } override fun getAttachmentsDbosWithIds( - accountId: Int, + accountId: Long, @AttachToType attachToType: Int, attachToDbid: Int ): Single>> { @@ -84,7 +84,7 @@ internal class AttachmentsStorage(base: AppStorages) : AbsStorage(base), IAttach } } - private fun createCursor(accountId: Int, attachToType: Int, attachToDbid: Int): Cursor? { + private fun createCursor(accountId: Long, attachToType: Int, attachToDbid: Int): Cursor? { val uri = uriForType(attachToType, accountId) return contentResolver.query( uri, null, @@ -93,7 +93,7 @@ internal class AttachmentsStorage(base: AppStorages) : AbsStorage(base), IAttach } override fun getAttachmentsDbosSync( - accountId: Int, + accountId: Long, attachToType: Int, attachToDbid: Int, cancelable: Cancelable @@ -115,7 +115,7 @@ internal class AttachmentsStorage(base: AppStorages) : AbsStorage(base), IAttach } override fun remove( - accountId: Int, + accountId: Long, @AttachToType attachToType: Int, attachToDbid: Int, generatedAttachmentId: Int @@ -133,7 +133,7 @@ internal class AttachmentsStorage(base: AppStorages) : AbsStorage(base), IAttach } } - override fun getCount(accountId: Int, attachToType: Int, attachToDbid: Int): Single { + override fun getCount(accountId: Long, attachToType: Int, attachToDbid: Int): Single { return Single.fromCallable { val uri = uriForType(attachToType, accountId) val selection = attachToIdColumnFor(attachToType) + " = ?" @@ -146,7 +146,7 @@ internal class AttachmentsStorage(base: AppStorages) : AbsStorage(base), IAttach } companion object { - internal fun uriForType(@AttachToType type: Int, accountId: Int): Uri { + internal fun uriForType(@AttachToType type: Int, accountId: Long): Uri { return when (type) { AttachToType.COMMENT -> getCommentsAttachmentsContentUriFor( accountId @@ -161,7 +161,7 @@ internal class AttachmentsStorage(base: AppStorages) : AbsStorage(base), IAttach fun appendAttachOperationWithBackReference( - operations: MutableList, accountId: Int, + operations: MutableList, accountId: Long, @AttachToType attachToType: Int, attachToBackReferenceIndex: Int, dboEntity: DboEntity ) { val cv = ContentValues() @@ -180,7 +180,7 @@ internal class AttachmentsStorage(base: AppStorages) : AbsStorage(base), IAttach fun appendAttachOperationWithStableAttachToId( operations: MutableList, - accountId: Int, @AttachToType attachToType: Int, + accountId: Long, @AttachToType attachToType: Int, attachToDbid: Int, dboEntity: DboEntity ): Int { val cv = ContentValues() diff --git a/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/db/impl/CommentsStorage.kt b/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/db/impl/CommentsStorage.kt index 4fccc94e2..fcd32b935 100644 --- a/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/db/impl/CommentsStorage.kt +++ b/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/db/impl/CommentsStorage.kt @@ -32,9 +32,9 @@ internal class CommentsStorage(base: AppStorages) : AbsStorage(base), ICommentsS private val minorUpdatesPublisher: PublishSubject = PublishSubject.create() private val mStoreLock = Any() override fun insert( - accountId: Int, + accountId: Long, sourceId: Int, - sourceOwnerId: Int, + sourceOwnerId: Long, sourceType: Int, dbos: List, owners: OwnerEntities?, @@ -157,7 +157,7 @@ internal class CommentsStorage(base: AppStorages) : AbsStorage(base), ICommentsS } } - override fun findEditingComment(accountId: Int, commented: Commented): Maybe { + override fun findEditingComment(accountId: Long, commented: Commented): Maybe { return Maybe.create { e: MaybeEmitter -> val cursor = contentResolver.query( getCommentsContentUriFor(accountId), null, @@ -199,10 +199,10 @@ internal class CommentsStorage(base: AppStorages) : AbsStorage(base), ICommentsS } override fun saveDraftComment( - accountId: Int, + accountId: Long, commented: Commented, text: String?, - replyToUser: Int, + replyToUser: Long, replyToComment: Int ): Single { return Single.create { e: SingleEmitter -> @@ -268,7 +268,7 @@ internal class CommentsStorage(base: AppStorages) : AbsStorage(base), ICommentsS return minorUpdatesPublisher } - override fun deleteByDbid(accountId: Int, dbid: Int): Completable { + override fun deleteByDbid(accountId: Long, dbid: Int): Completable { return Completable.fromAction { val uri = getCommentsContentUriFor(accountId) val where = BaseColumns._ID + " = ?" @@ -277,7 +277,7 @@ internal class CommentsStorage(base: AppStorages) : AbsStorage(base), ICommentsS } } - private fun findEditingCommentId(aid: Int, commented: Commented): Int? { + private fun findEditingCommentId(aid: Long, commented: Commented): Int? { val projection = arrayOf(BaseColumns._ID) val cursor = contentResolver.query( getCommentsContentUriFor(aid), projection, @@ -302,7 +302,7 @@ internal class CommentsStorage(base: AppStorages) : AbsStorage(base), ICommentsS } private fun mapDbo( - accountId: Int, + accountId: Long, cursor: Cursor, includeAttachments: Boolean, forceAttachments: Boolean, @@ -313,17 +313,17 @@ internal class CommentsStorage(base: AppStorages) : AbsStorage(base), ICommentsS val dbid = cursor.getInt(BaseColumns._ID) val sourceId = cursor.getInt(CommentsColumns.SOURCE_ID) val sourceOwnerId = - cursor.getInt(CommentsColumns.SOURCE_OWNER_ID) + cursor.getLong(CommentsColumns.SOURCE_OWNER_ID) val sourceType = cursor.getInt(CommentsColumns.SOURCE_TYPE) val sourceAccessKey = cursor.getString(CommentsColumns.SOURCE_ACCESS_KEY) val id = cursor.getInt(CommentsColumns.COMMENT_ID) val threadsJson = cursor.getBlob(CommentsColumns.THREADS) val dbo = CommentEntity().set(sourceId, sourceOwnerId, sourceType, sourceAccessKey, id) - .setFromId(cursor.getInt(CommentsColumns.FROM_ID)) + .setFromId(cursor.getLong(CommentsColumns.FROM_ID)) .setDate(cursor.getLong(CommentsColumns.DATE)) .setText(cursor.getString(CommentsColumns.TEXT)) - .setReplyToUserId(cursor.getInt(CommentsColumns.REPLY_TO_USER)) + .setReplyToUserId(cursor.getLong(CommentsColumns.REPLY_TO_USER)) .setThreadsCount(cursor.getInt(CommentsColumns.THREADS_COUNT)) .setReplyToComment(cursor.getInt(CommentsColumns.REPLY_TO_COMMENT)) .setLikesCount(cursor.getInt(CommentsColumns.LIKES)) @@ -352,7 +352,7 @@ internal class CommentsStorage(base: AppStorages) : AbsStorage(base), ICommentsS companion object { fun getCV( sourceId: Int, - sourceOwnerId: Int, + sourceOwnerId: Long, sourceType: Int, dbo: CommentEntity ): ContentValues { diff --git a/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/db/impl/DatabaseStorage.kt b/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/db/impl/DatabaseStorage.kt index 7701aab58..ea244d227 100644 --- a/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/db/impl/DatabaseStorage.kt +++ b/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/db/impl/DatabaseStorage.kt @@ -17,7 +17,7 @@ import io.reactivex.rxjava3.core.Single import io.reactivex.rxjava3.core.SingleEmitter class DatabaseStorage internal constructor(base: AppStorages) : AbsStorage(base), IDatabaseStore { - override fun storeCountries(accountId: Int, dbos: List): Completable { + override fun storeCountries(accountId: Long, dbos: List): Completable { return Completable.create { emitter: CompletableEmitter -> val uri = getCountriesContentUriFor(accountId) val operations = ArrayList(dbos.size + 1) @@ -37,7 +37,7 @@ class DatabaseStorage internal constructor(base: AppStorages) : AbsStorage(base) } } - override fun getCountries(accountId: Int): Single> { + override fun getCountries(accountId: Long): Single> { return Single.create { emitter: SingleEmitter> -> val uri = getCountriesContentUriFor(accountId) val cursor = contentResolver.query(uri, null, null, null, null) diff --git a/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/db/impl/DialogsStorage.kt b/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/db/impl/DialogsStorage.kt index 71c529cff..a34ab4018 100644 --- a/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/db/impl/DialogsStorage.kt +++ b/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/db/impl/DialogsStorage.kt @@ -35,15 +35,15 @@ import io.reactivex.rxjava3.core.* import io.reactivex.rxjava3.subjects.PublishSubject internal class DialogsStorage(base: AppStorages) : AbsStorage(base), IDialogsStorage { - private val unreadDialogsCounter: PublishSubject> = PublishSubject.create() + private val unreadDialogsCounter: PublishSubject> = PublishSubject.create() private val preferences: SharedPreferences = base.getSharedPreferences("dialogs_prefs", Context.MODE_PRIVATE) - override fun getUnreadDialogsCount(accountId: Int): Int { + override fun getUnreadDialogsCount(accountId: Long): Int { synchronized(this) { return preferences.getInt(unreadKeyFor(accountId), 0) } } - override fun observeUnreadDialogsCount(): Observable> { + override fun observeUnreadDialogsCount(): Observable> { return unreadDialogsCounter } @@ -70,7 +70,7 @@ internal class DialogsStorage(base: AppStorages) : AbsStorage(base), IDialogsSto } } - override fun removePeerWithId(accountId: Int, peerId: Int): Completable { + override fun removePeerWithId(accountId: Long, peerId: Long): Completable { return Completable.create { emitter: CompletableEmitter -> val uri = getDialogsContentUriFor(accountId) contentResolver.delete(uri, BaseColumns._ID + " = ?", arrayOf(peerId.toString())) @@ -79,7 +79,7 @@ internal class DialogsStorage(base: AppStorages) : AbsStorage(base), IDialogsSto } override fun insertDialogs( - accountId: Int, + accountId: Long, dbos: List, clearBefore: Boolean ): Completable { @@ -172,7 +172,7 @@ internal class DialogsStorage(base: AppStorages) : AbsStorage(base), IDialogsSto return cv } - override fun saveSimple(accountId: Int, entity: SimpleDialogEntity): Completable { + override fun saveSimple(accountId: Long, entity: SimpleDialogEntity): Completable { return Completable.create { emitter: CompletableEmitter -> val uri = getPeersContentUriFor(accountId) val operations = ArrayList() @@ -185,8 +185,8 @@ internal class DialogsStorage(base: AppStorages) : AbsStorage(base), IDialogsSto } override fun updateDialogKeyboard( - accountId: Int, - peerId: Int, + accountId: Long, + peerId: Long, keyboardEntity: KeyboardEntity? ): Completable { return Completable.create { emitter: CompletableEmitter -> @@ -214,8 +214,8 @@ internal class DialogsStorage(base: AppStorages) : AbsStorage(base), IDialogsSto } override fun findPeerStates( - accountId: Int, - ids: Collection + accountId: Long, + ids: Collection ): Single> { return if (ids.isEmpty()) { Single.just(emptyList()) @@ -234,7 +234,7 @@ internal class DialogsStorage(base: AppStorages) : AbsStorage(base), IDialogsSto if (cursor != null) { while (cursor.moveToNext()) { val entity = - PeerStateEntity(cursor.getInt(BaseColumns._ID)) + PeerStateEntity(cursor.getLong(BaseColumns._ID)) .setInRead(cursor.getInt(PeersColumns.IN_READ)) .setOutRead(cursor.getInt(PeersColumns.OUT_READ)) .setLastMessageId( @@ -249,7 +249,7 @@ internal class DialogsStorage(base: AppStorages) : AbsStorage(base), IDialogsSto } } - override fun findSimple(accountId: Int, peerId: Int): Single> { + override fun findSimple(accountId: Long, peerId: Long): Single> { return Single.create { emitter: SingleEmitter> -> val projection = arrayOf( PeersColumns.UNREAD, @@ -309,7 +309,7 @@ internal class DialogsStorage(base: AppStorages) : AbsStorage(base), IDialogsSto } } - override fun setUnreadDialogsCount(accountId: Int, unreadCount: Int) { + override fun setUnreadDialogsCount(accountId: Long, unreadCount: Int) { synchronized(this) { preferences.edit() .putInt(unreadKeyFor(accountId), unreadCount) @@ -319,15 +319,15 @@ internal class DialogsStorage(base: AppStorages) : AbsStorage(base), IDialogsSto } override fun getMissingGroupChats( - accountId: Int, - ids: Collection - ): Single> { - return Single.create { e: SingleEmitter> -> + accountId: Long, + ids: Collection + ): Single> { + return Single.create { e: SingleEmitter> -> if (ids.isEmpty()) { e.onSuccess(emptyList()) return@create } - val peerIds: MutableSet = HashSet(ids) + val peerIds: MutableSet = HashSet(ids) val projection = arrayOf(BaseColumns._ID) val uri = getDialogsContentUriFor(accountId) val cursor = contentResolver.query( @@ -336,7 +336,7 @@ internal class DialogsStorage(base: AppStorages) : AbsStorage(base), IDialogsSto ) if (cursor != null) { while (cursor.moveToNext()) { - val peerId = cursor.getInt(BaseColumns._ID) + val peerId = cursor.getLong(BaseColumns._ID) peerIds.remove(peerId) } cursor.close() @@ -345,7 +345,7 @@ internal class DialogsStorage(base: AppStorages) : AbsStorage(base), IDialogsSto } } - override fun insertChats(accountId: Int, chats: List): Completable { + override fun insertChats(accountId: Long, chats: List): Completable { return Completable.fromAction { val operations = ArrayList(chats.size) for (chat in chats) { @@ -360,7 +360,7 @@ internal class DialogsStorage(base: AppStorages) : AbsStorage(base), IDialogsSto } } - override fun applyPatches(accountId: Int, patches: List): Completable { + override fun applyPatches(accountId: Long, patches: List): Completable { return Completable.create { emitter: CompletableEmitter -> val dialogsUri = getDialogsContentUriFor(accountId) val peersUri = getPeersContentUriFor(accountId) @@ -425,7 +425,7 @@ internal class DialogsStorage(base: AppStorages) : AbsStorage(base), IDialogsSto } } - override fun findChatById(accountId: Int, peerId: Int): Single> { + override fun findChatById(accountId: Long, peerId: Long): Single> { return Single.fromCallable { val projection = arrayOf( DialogsColumns.TITLE, @@ -459,9 +459,9 @@ internal class DialogsStorage(base: AppStorages) : AbsStorage(base), IDialogsSto val encrypted = cursor.getBoolean(DialogsColumns.FOREIGN_MESSAGE_ENCRYPTED) val messageId = cursor.getInt(DialogsColumns.LAST_MESSAGE_ID) - val peerId = cursor.getInt(BaseColumns._ID) + val peerId = cursor.getLong(BaseColumns._ID) val fromId = - cursor.getInt(DialogsColumns.FOREIGN_MESSAGE_FROM_ID) + cursor.getLong(DialogsColumns.FOREIGN_MESSAGE_FROM_ID) val message = MessageDboEntity().set(messageId, peerId, fromId) .setBody(cursor.getString(DialogsColumns.FOREIGN_MESSAGE_BODY)) .setDate(cursor.getLong(DialogsColumns.FOREIGN_MESSAGE_DATE)) @@ -487,7 +487,7 @@ internal class DialogsStorage(base: AppStorages) : AbsStorage(base), IDialogsSto } companion object { - internal fun unreadKeyFor(accountId: Int): String { + internal fun unreadKeyFor(accountId: Long): String { return "unread$accountId" } } diff --git a/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/db/impl/DocsStorage.kt b/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/db/impl/DocsStorage.kt index 48658e4d3..36c128276 100644 --- a/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/db/impl/DocsStorage.kt +++ b/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/db/impl/DocsStorage.kt @@ -54,8 +54,8 @@ internal class DocsStorage(base: AppStorages) : AbsStorage(base), IDocsStorage { } override fun store( - accountId: Int, - ownerId: Int, + accountId: Long, + ownerId: Long, entities: List, clearBeforeInsert: Boolean ): Completable { @@ -123,7 +123,7 @@ internal class DocsStorage(base: AppStorages) : AbsStorage(base), IDocsStorage { } } - override fun delete(accountId: Int, docId: Int, ownerId: Int): Completable { + override fun delete(accountId: Long, docId: Int, ownerId: Long): Completable { return Completable.fromAction { val uri = getDocsContentUriFor(accountId) val where = DocColumns.DOC_ID + " = ? AND " + DocColumns.OWNER_ID + " = ?" @@ -135,7 +135,7 @@ internal class DocsStorage(base: AppStorages) : AbsStorage(base), IDocsStorage { companion object { internal fun map(cursor: Cursor): DocumentDboEntity { val id = cursor.getInt(DocColumns.DOC_ID) - val ownerId = cursor.getInt(DocColumns.OWNER_ID) + val ownerId = cursor.getLong(DocColumns.OWNER_ID) val document = DocumentDboEntity().set(id, ownerId) .setTitle(cursor.getString(DocColumns.TITLE)) .setSize(cursor.getLong(DocColumns.SIZE)) diff --git a/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/db/impl/FaveStorage.kt b/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/db/impl/FaveStorage.kt index fab6a1600..5f7f48e7f 100644 --- a/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/db/impl/FaveStorage.kt +++ b/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/db/impl/FaveStorage.kt @@ -4,7 +4,6 @@ import android.content.ContentProviderOperation import android.content.ContentValues import android.database.Cursor import android.provider.BaseColumns -import dev.ragnarok.fenrir.* import dev.ragnarok.fenrir.Includes.stores import dev.ragnarok.fenrir.db.FenrirContentProvider import dev.ragnarok.fenrir.db.FenrirContentProvider.Companion.getFaveArticlesContentUriFor @@ -18,6 +17,10 @@ import dev.ragnarok.fenrir.db.FenrirContentProvider.Companion.getFaveVideosConte import dev.ragnarok.fenrir.db.column.* import dev.ragnarok.fenrir.db.interfaces.IFaveStorage import dev.ragnarok.fenrir.db.model.entity.* +import dev.ragnarok.fenrir.getBlob +import dev.ragnarok.fenrir.getLong +import dev.ragnarok.fenrir.getString +import dev.ragnarok.fenrir.ifNonNull import dev.ragnarok.fenrir.model.criteria.* import dev.ragnarok.fenrir.util.Utils.safeCountOf import dev.ragnarok.fenrir.util.serializeble.msgpack.MsgPack @@ -48,7 +51,7 @@ internal class FaveStorage(mRepositoryContext: AppStorages) : AbsStorage(mReposi } override fun storePosts( - accountId: Int, + accountId: Long, posts: List, owners: OwnerEntities?, clearBeforeStore: Boolean @@ -84,7 +87,7 @@ internal class FaveStorage(mRepositoryContext: AppStorages) : AbsStorage(mReposi } } - override fun getFaveLinks(accountId: Int): Single> { + override fun getFaveLinks(accountId: Long): Single> { return Single.create { e: SingleEmitter> -> val uri = getFaveLinksContentUriFor(accountId) val cursor = contentResolver.query(uri, null, null, null, null) @@ -102,7 +105,7 @@ internal class FaveStorage(mRepositoryContext: AppStorages) : AbsStorage(mReposi } } - override fun removeLink(accountId: Int, id: String?): Completable { + override fun removeLink(accountId: Long, id: String?): Completable { return Completable.fromAction { val uri = getFaveLinksContentUriFor(accountId) val where = FaveLinksColumns.LINK_ID + " LIKE ?" @@ -112,7 +115,7 @@ internal class FaveStorage(mRepositoryContext: AppStorages) : AbsStorage(mReposi } override fun storeLinks( - accountId: Int, + accountId: Long, entities: List, clearBefore: Boolean ): Completable { @@ -154,7 +157,7 @@ internal class FaveStorage(mRepositoryContext: AppStorages) : AbsStorage(mReposi } } - override fun removePage(accountId: Int, ownerId: Int, isUser: Boolean): Completable { + override fun removePage(accountId: Long, ownerId: Long, isUser: Boolean): Completable { return Completable.fromAction { val uri = if (isUser) getFaveUsersContentUriFor(accountId) else getFaveGroupsContentUriFor( @@ -166,7 +169,7 @@ internal class FaveStorage(mRepositoryContext: AppStorages) : AbsStorage(mReposi } } - override fun getFaveUsers(accountId: Int): Single> { + override fun getFaveUsers(accountId: Long): Single> { return Single.create { e: SingleEmitter> -> val uri = getFaveUsersContentUriFor(accountId) val cursor = contentResolver.query(uri, null, null, null, null) @@ -184,7 +187,7 @@ internal class FaveStorage(mRepositoryContext: AppStorages) : AbsStorage(mReposi } } - override fun getFaveGroups(accountId: Int): Single> { + override fun getFaveGroups(accountId: Long): Single> { return Single.create { e: SingleEmitter> -> val uri = getFaveGroupsContentUriFor(accountId) val cursor = contentResolver.query(uri, null, null, null, null) @@ -203,7 +206,7 @@ internal class FaveStorage(mRepositoryContext: AppStorages) : AbsStorage(mReposi } override fun storePhotos( - accountId: Int, + accountId: Long, photos: List, clearBeforeStore: Boolean ): Single { @@ -378,7 +381,7 @@ internal class FaveStorage(mRepositoryContext: AppStorages) : AbsStorage(mReposi } override fun storeVideos( - accountId: Int, + accountId: Long, videos: List, clearBeforeStore: Boolean ): Single { @@ -420,7 +423,7 @@ internal class FaveStorage(mRepositoryContext: AppStorages) : AbsStorage(mReposi } override fun storeArticles( - accountId: Int, + accountId: Long, articles: List, clearBeforeStore: Boolean ): Single { @@ -462,7 +465,7 @@ internal class FaveStorage(mRepositoryContext: AppStorages) : AbsStorage(mReposi } override fun storeProducts( - accountId: Int, + accountId: Long, products: List, clearBeforeStore: Boolean ): Single { @@ -504,7 +507,7 @@ internal class FaveStorage(mRepositoryContext: AppStorages) : AbsStorage(mReposi } override fun storePages( - accountId: Int, + accountId: Long, users: List, clearBeforeStore: Boolean ): Completable { @@ -536,7 +539,7 @@ internal class FaveStorage(mRepositoryContext: AppStorages) : AbsStorage(mReposi } override fun storeGroups( - accountId: Int, + accountId: Long, groups: List, clearBeforeStore: Boolean ): Completable { @@ -591,36 +594,36 @@ internal class FaveStorage(mRepositoryContext: AppStorages) : AbsStorage(mReposi return cv } - private fun mapUser(accountId: Int, id: Int): UserEntity? { + private fun mapUser(accountId: Long, id: Long): UserEntity? { return stores.owners().findUserDboById(accountId, id).blockingGet().get() } - private fun mapGroup(accountId: Int, id: Int): CommunityEntity? { + private fun mapGroup(accountId: Long, id: Long): CommunityEntity? { return stores.owners().findCommunityDboById(accountId, abs(id)).blockingGet().get() } - internal fun mapFaveUserDbo(cursor: Cursor, accountId: Int): FavePageEntity { - return FavePageEntity(cursor.getInt(BaseColumns._ID)) + internal fun mapFaveUserDbo(cursor: Cursor, accountId: Long): FavePageEntity { + return FavePageEntity(cursor.getLong(BaseColumns._ID)) .setDescription(cursor.getString(FavePageColumns.DESCRIPTION)) .setUpdateDate(cursor.getLong(FavePageColumns.UPDATED_TIME)) .setFaveType(cursor.getString(FavePageColumns.FAVE_TYPE)) .setUser( mapUser( accountId, - cursor.getInt(BaseColumns._ID) + cursor.getLong(BaseColumns._ID) ) ) } - internal fun mapFaveGroupDbo(cursor: Cursor, accountId: Int): FavePageEntity { - return FavePageEntity(cursor.getInt(BaseColumns._ID)) + internal fun mapFaveGroupDbo(cursor: Cursor, accountId: Long): FavePageEntity { + return FavePageEntity(cursor.getLong(BaseColumns._ID)) .setDescription(cursor.getString(FavePageColumns.DESCRIPTION)) .setUpdateDate(cursor.getLong(FavePageColumns.UPDATED_TIME)) .setFaveType(cursor.getString(FavePageColumns.FAVE_TYPE)) .setGroup( mapGroup( accountId, - cursor.getInt(BaseColumns._ID) + cursor.getLong(BaseColumns._ID) ) ) } diff --git a/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/db/impl/FeedStorage.kt b/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/db/impl/FeedStorage.kt index 4a9833133..a9e691783 100644 --- a/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/db/impl/FeedStorage.kt +++ b/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/db/impl/FeedStorage.kt @@ -60,7 +60,7 @@ internal class FeedStorage(base: AppStorages) : AbsStorage(base), IFeedStorage { } override fun store( - accountId: Int, + accountId: Long, data: List, owners: OwnerEntities?, clearBeforeStore: Boolean @@ -106,7 +106,7 @@ internal class FeedStorage(base: AppStorages) : AbsStorage(base), IFeedStorage { } } - override fun storeLists(accountId: Int, entities: List): Completable { + override fun storeLists(accountId: Long, entities: List): Completable { return Completable.create { e: CompletableEmitter -> val uri = getFeedListsContentUriFor(accountId) val operations = ArrayList() @@ -162,21 +162,21 @@ internal class FeedStorage(base: AppStorages) : AbsStorage(base), IFeedStorage { val dbo = NewsDboEntity() if (friendString.nonNullNoEmpty()) { val strArray = friendString.split(Regex(",")).toTypedArray() - val intArray = ArrayList(strArray.size) + val longArray = ArrayList(strArray.size) for (i in strArray.indices) { - intArray.add(strArray[i].toInt()) + longArray.add(strArray[i].toLong()) } - dbo.setFriendsTags(intArray) + dbo.setFriendsTags(longArray) } else { dbo.setFriendsTags(null) } dbo.setType(cursor.getString(NewsColumns.TYPE)) - .setSourceId(cursor.getInt(NewsColumns.SOURCE_ID)) + .setSourceId(cursor.getLong(NewsColumns.SOURCE_ID)) .setDate(cursor.getLong(NewsColumns.DATE)) .setPostId(cursor.getInt(NewsColumns.POST_ID)) .setPostType(cursor.getString(NewsColumns.POST_TYPE)) .setFinalPost(cursor.getBoolean(NewsColumns.FINAL_POST)) - .setCopyOwnerId(cursor.getInt(NewsColumns.COPY_OWNER_ID)) + .setCopyOwnerId(cursor.getLong(NewsColumns.COPY_OWNER_ID)) .setCopyPostId(cursor.getInt(NewsColumns.COPY_POST_ID)) .setCopyPostDate(cursor.getLong(NewsColumns.COPY_POST_DATE)) .setText(cursor.getString(NewsColumns.TEXT)) @@ -295,16 +295,16 @@ internal class FeedStorage(base: AppStorages) : AbsStorage(base), IFeedStorage { val entity = FeedListEntity(id).setTitle(title) val sources = cursor.getString(FeedListsColumns.SOURCE_IDS) - var sourceIds: IntArray? = null + var sourceIds: LongArray? = null if (sources.nonNullNoEmpty()) { val ids = sources.split(Regex(",")).toTypedArray() - sourceIds = IntArray(ids.size) + sourceIds = LongArray(ids.size) for (i in ids.indices) { - sourceIds[i] = ids[i].toInt() + sourceIds[i] = ids[i].toLong() } } return entity.setSourceIds(sourceIds) .setNoReposts(cursor.getBoolean(FeedListsColumns.NO_REPOSTS)) } } -} +} \ No newline at end of file diff --git a/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/db/impl/FeedbackStorage.kt b/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/db/impl/FeedbackStorage.kt index f83f7b59e..b5d55870a 100644 --- a/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/db/impl/FeedbackStorage.kt +++ b/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/db/impl/FeedbackStorage.kt @@ -20,7 +20,7 @@ import io.reactivex.rxjava3.core.SingleEmitter internal class FeedbackStorage(context: AppStorages) : AbsStorage(context), IFeedbackStorage { override fun insert( - accountId: Int, + accountId: Long, dbos: List, owners: OwnerEntities?, clearBefore: Boolean @@ -109,7 +109,7 @@ internal class FeedbackStorage(context: AppStorages) : AbsStorage(context), IFee override fun insertOfficial( - accountId: Int, + accountId: Long, dbos: List, clearBefore: Boolean ): Single { diff --git a/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/db/impl/KeysPersistStorage.kt b/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/db/impl/KeysPersistStorage.kt index 1ec255cd0..fef8c7ae5 100644 --- a/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/db/impl/KeysPersistStorage.kt +++ b/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/db/impl/KeysPersistStorage.kt @@ -20,7 +20,7 @@ internal class KeysPersistStorage(context: AppStorages) : AbsStorage(context), I private fun map(cursor: Cursor): AesKeyPair { return AesKeyPair() .setVersion(cursor.getInt(KeyColumns.VERSION)) - .setPeerId(cursor.getInt(KeyColumns.PEER_ID)) + .setPeerId(cursor.getLong(KeyColumns.PEER_ID)) .setSessionId(cursor.getLong(KeyColumns.SESSION_ID)) .setDate(cursor.getLong(KeyColumns.DATE)) .setStartMessageId(cursor.getInt(KeyColumns.START_SESSION_MESSAGE_ID)) @@ -52,7 +52,7 @@ internal class KeysPersistStorage(context: AppStorages) : AbsStorage(context), I } } - override fun getAll(accountId: Int): Single> { + override fun getAll(accountId: Long): Single> { return Single.create { e: SingleEmitter> -> val uri = getKeysContentUriFor(accountId) val cursor = context.contentResolver.query(uri, null, null, null, BaseColumns._ID) @@ -70,7 +70,7 @@ internal class KeysPersistStorage(context: AppStorages) : AbsStorage(context), I } } - override fun getKeys(accountId: Int, peerId: Int): Single> { + override fun getKeys(accountId: Long, peerId: Long): Single> { return Single.create { e: SingleEmitter> -> val uri = getKeysContentUriFor(accountId) val cursor = context.contentResolver @@ -95,7 +95,7 @@ internal class KeysPersistStorage(context: AppStorages) : AbsStorage(context), I } } - override fun findLastKeyPair(accountId: Int, peerId: Int): Single> { + override fun findLastKeyPair(accountId: Long, peerId: Long): Single> { return Single.create { e: SingleEmitter> -> val uri = getKeysContentUriFor(accountId) val cursor = context.contentResolver @@ -117,7 +117,7 @@ internal class KeysPersistStorage(context: AppStorages) : AbsStorage(context), I } } - override fun findKeyPairFor(accountId: Int, sessionId: Long): Maybe { + override fun findKeyPairFor(accountId: Long, sessionId: Long): Maybe { return Maybe.create { e: MaybeEmitter -> val uri = getKeysContentUriFor(accountId) val cursor = context.contentResolver @@ -142,11 +142,11 @@ internal class KeysPersistStorage(context: AppStorages) : AbsStorage(context), I } } - override fun deleteAll(accountId: Int): Completable { + override fun deleteAll(accountId: Long): Completable { return Completable.create { e: CompletableEmitter -> val uri = getKeysContentUriFor(accountId) context.contentResolver.delete(uri, null, null) e.onComplete() } } -} +} \ No newline at end of file diff --git a/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/db/impl/KeysRamStorage.kt b/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/db/impl/KeysRamStorage.kt index 689cfe463..e5c1dbae2 100644 --- a/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/db/impl/KeysRamStorage.kt +++ b/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/db/impl/KeysRamStorage.kt @@ -1,6 +1,5 @@ package dev.ragnarok.fenrir.db.impl -import android.util.SparseArray import dev.ragnarok.fenrir.crypt.AesKeyPair import dev.ragnarok.fenrir.db.interfaces.IKeysStorage import dev.ragnarok.fenrir.db.interfaces.IStorages @@ -10,12 +9,12 @@ import io.reactivex.rxjava3.core.* import java.util.concurrent.CopyOnWriteArrayList internal class KeysRamStorage : IKeysStorage { - private val mData = SparseArray>() - private fun prepareKeysFor(accountId: Int): MutableList { + private val mData = HashMap>() + private fun prepareKeysFor(accountId: Long): MutableList { var list = mData[accountId] if (list == null) { list = CopyOnWriteArrayList() - mData.put(accountId, list) + mData[accountId] = list } return list } @@ -27,7 +26,7 @@ internal class KeysRamStorage : IKeysStorage { } } - override fun getAll(accountId: Int): Single> { + override fun getAll(accountId: Long): Single> { return Single.create { e: SingleEmitter> -> val list: List? = mData[accountId] val result: MutableList = ArrayList(if (list == null) 0 else 1) @@ -38,7 +37,7 @@ internal class KeysRamStorage : IKeysStorage { } } - override fun getKeys(accountId: Int, peerId: Int): Single> { + override fun getKeys(accountId: Long, peerId: Long): Single> { return Single.create { e: SingleEmitter> -> val list: List? = mData[accountId] val result: MutableList = ArrayList(if (list == null) 0 else 1) @@ -53,7 +52,7 @@ internal class KeysRamStorage : IKeysStorage { } } - override fun findLastKeyPair(accountId: Int, peerId: Int): Single> { + override fun findLastKeyPair(accountId: Long, peerId: Long): Single> { return Single.create { e: SingleEmitter> -> val list: List? = mData[accountId] var result: AesKeyPair? = null @@ -68,7 +67,7 @@ internal class KeysRamStorage : IKeysStorage { } } - override fun findKeyPairFor(accountId: Int, sessionId: Long): Maybe { + override fun findKeyPairFor(accountId: Long, sessionId: Long): Maybe { return Maybe.create { e: MaybeEmitter -> val pairs: List? = mData[accountId] var result: AesKeyPair? = null @@ -87,7 +86,7 @@ internal class KeysRamStorage : IKeysStorage { } } - override fun deleteAll(accountId: Int): Completable { + override fun deleteAll(accountId: Long): Completable { return Completable.create { e: CompletableEmitter -> mData.remove(accountId) e.onComplete() diff --git a/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/db/impl/LocalMediaStorage.kt b/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/db/impl/LocalMediaStorage.kt index ad0166adf..9e52ebf14 100644 --- a/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/db/impl/LocalMediaStorage.kt +++ b/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/db/impl/LocalMediaStorage.kt @@ -48,7 +48,7 @@ internal class LocalMediaStorage(mRepositoryContext: AppStorages) : AbsStorage(m it.onSuccess(data) } - override fun getAudios(accountId: Int): Single> { + override fun getAudios(accountId: Long): Single> { return Single.create { e: SingleEmitter> -> val cursor = contentResolver.query( MediaStore.Audio.Media.EXTERNAL_CONTENT_URI, @@ -66,7 +66,7 @@ internal class LocalMediaStorage(mRepositoryContext: AppStorages) : AbsStorage(m } } - override fun getAudios(accountId: Int, albumId: Long): Single> { + override fun getAudios(accountId: Long, albumId: Long): Single> { return Single.create { e: SingleEmitter> -> val cursor = contentResolver.query( MediaStore.Audio.Media.EXTERNAL_CONTENT_URI, @@ -277,7 +277,7 @@ internal class LocalMediaStorage(mRepositoryContext: AppStorages) : AbsStorage(m .setTitle(cursor.getString(MediaStore.MediaColumns.DISPLAY_NAME)) } - internal fun mapAudio(accountId: Int, cursor: Cursor): Audio? { + internal fun mapAudio(accountId: Long, cursor: Cursor): Audio? { val id = cursor.getLong(BaseColumns._ID) val data = buildUriForPicassoNew(Content_Local.AUDIO, id).toString() if (cursor.getString(MediaStore.MediaColumns.DISPLAY_NAME) diff --git a/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/db/impl/MessagesStorage.kt b/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/db/impl/MessagesStorage.kt index 8190bc2ec..9d08cad26 100644 --- a/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/db/impl/MessagesStorage.kt +++ b/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/db/impl/MessagesStorage.kt @@ -37,8 +37,8 @@ import kotlinx.serialization.builtins.serializer internal class MessagesStorage(base: AppStorages) : AbsStorage(base), IMessagesStorage { override fun insertPeerDbos( - accountId: Int, - peerId: Int, + accountId: Long, + peerId: Long, dbos: List, clearHistory: Boolean ): Completable { @@ -65,7 +65,7 @@ internal class MessagesStorage(base: AppStorages) : AbsStorage(base), IMessagesS } } - override fun insert(accountId: Int, dbos: List): Single { + override fun insert(accountId: Long, dbos: List): Single { return Single.create { emitter: SingleEmitter -> val operations = ArrayList() val indexes = IntArray(dbos.size) @@ -86,7 +86,10 @@ internal class MessagesStorage(base: AppStorages) : AbsStorage(base), IMessagesS } } - override fun findLastSentMessageIdForPeer(accountId: Int, peerId: Int): Single> { + override fun findLastSentMessageIdForPeer( + accountId: Long, + peerId: Long + ): Single> { return Single.create { emitter: SingleEmitter> -> val uri = getMessageContentUriFor(accountId) val projection = arrayOf(MessageColumns._ID) @@ -177,7 +180,7 @@ internal class MessagesStorage(base: AppStorages) : AbsStorage(base), IMessagesS } } - override fun insert(accountId: Int, peerId: Int, patch: MessageEditEntity): Single { + override fun insert(accountId: Long, peerId: Long, patch: MessageEditEntity): Single { return Single.create { emitter: SingleEmitter -> val operations = ArrayList() val cv = ContentValues() @@ -247,7 +250,11 @@ internal class MessagesStorage(base: AppStorages) : AbsStorage(base), IMessagesS } } - override fun applyPatch(accountId: Int, messageId: Int, patch: MessageEditEntity): Single { + override fun applyPatch( + accountId: Long, + messageId: Int, + patch: MessageEditEntity + ): Single { return stores.attachments() .getCount(accountId, AttachToType.MESSAGE, messageId) .flatMap { count -> @@ -329,7 +336,7 @@ internal class MessagesStorage(base: AppStorages) : AbsStorage(base), IMessagesS } private fun fullMapDbo( - accountId: Int, + accountId: Long, cursor: Cursor, withAttachments: Boolean, withForwardMessages: Boolean, @@ -353,7 +360,7 @@ internal class MessagesStorage(base: AppStorages) : AbsStorage(base), IMessagesS return dbo } - override fun findDraftMessage(accountId: Int, peerId: Int): Maybe { + override fun findDraftMessage(accountId: Long, peerId: Long): Maybe { return Maybe.create { e: MaybeEmitter -> val columns = arrayOf(MessageColumns._ID, MessageColumns.BODY) val uri = getMessageContentUriFor(accountId) @@ -385,7 +392,7 @@ internal class MessagesStorage(base: AppStorages) : AbsStorage(base), IMessagesS } } - override fun saveDraftMessageBody(accountId: Int, peerId: Int, body: String?): Single { + override fun saveDraftMessageBody(accountId: Long, peerId: Long, body: String?): Single { return Single.create { e: SingleEmitter -> val start = System.currentTimeMillis() val uri = getMessageContentUriFor(accountId) @@ -412,7 +419,7 @@ internal class MessagesStorage(base: AppStorages) : AbsStorage(base), IMessagesS } } - override fun applyPatches(accountId: Int, patches: Collection): Completable { + override fun applyPatches(accountId: Long, patches: Collection): Completable { return Completable.create { emitter: CompletableEmitter -> val uri = getMessageContentUriFor(accountId) val operations = ArrayList(patches.size) @@ -441,7 +448,7 @@ internal class MessagesStorage(base: AppStorages) : AbsStorage(base), IMessagesS } } - override fun getMessageStatus(accountId: Int, dbid: Int): Single { + override fun getMessageStatus(accountId: Long, dbid: Int): Single { return Single.fromCallable { val cursor = contentResolver.query( getMessageContentUriFor(accountId), @@ -464,7 +471,7 @@ internal class MessagesStorage(base: AppStorages) : AbsStorage(base), IMessagesS } } - private fun findDraftMessageId(accountId: Int, peerId: Int): Int? { + private fun findDraftMessageId(accountId: Long, peerId: Long): Int? { val columns = arrayOf(MessageColumns._ID) val uri = getMessageContentUriFor(accountId) val cursor = context.contentResolver.query( @@ -485,7 +492,7 @@ internal class MessagesStorage(base: AppStorages) : AbsStorage(base), IMessagesS } override fun changeMessageStatus( - accountId: Int, + accountId: Long, messageId: Int, @MessageStatus status: Int, vkid: Int? @@ -509,7 +516,7 @@ internal class MessagesStorage(base: AppStorages) : AbsStorage(base), IMessagesS } } - override fun deleteMessage(accountId: Int, messageId: Int): Single { + override fun deleteMessage(accountId: Long, messageId: Int): Single { require(messageId != 0) { "Invalid message id: $messageId" } return Single.create { e: SingleEmitter -> val uri = getMessageContentUriFor(accountId) @@ -522,7 +529,7 @@ internal class MessagesStorage(base: AppStorages) : AbsStorage(base), IMessagesS } } - override fun deleteMessages(accountId: Int, ids: Collection): Single { + override fun deleteMessages(accountId: Long, ids: Collection): Single { return Single.create { e: SingleEmitter -> val copy: Set = HashSet(ids) val uri = getMessageContentUriFor(accountId) @@ -533,7 +540,7 @@ internal class MessagesStorage(base: AppStorages) : AbsStorage(base), IMessagesS } override fun changeMessagesStatus( - accountId: Int, + accountId: Long, ids: Collection, @MessageStatus status: Int ): Completable { @@ -555,7 +562,7 @@ internal class MessagesStorage(base: AppStorages) : AbsStorage(base), IMessagesS } } - override fun getMissingMessages(accountId: Int, ids: Collection): Single> { + override fun getMissingMessages(accountId: Long, ids: Collection): Single> { return Single.create { e: SingleEmitter> -> val copy: MutableSet = HashSet(ids) val uri = getMessageContentUriFor(accountId) @@ -574,7 +581,7 @@ internal class MessagesStorage(base: AppStorages) : AbsStorage(base), IMessagesS } private fun getForwardMessages( - accountId: Int, + accountId: Long, attachTo: Int, withAttachments: Boolean, cancelable: Cancelable @@ -602,7 +609,7 @@ internal class MessagesStorage(base: AppStorages) : AbsStorage(base), IMessagesS } override fun findMessagesByIds( - accountId: Int, + accountId: Long, ids: List, withAttachments: Boolean, withForwardMessages: Boolean @@ -646,11 +653,11 @@ internal class MessagesStorage(base: AppStorages) : AbsStorage(base), IMessagesS } override fun findFirstUnsentMessage( - accountIds: Collection, + accountIds: Collection, withAttachments: Boolean, withForwardMessages: Boolean - ): Single>> { - return Single.create { emitter: SingleEmitter>> -> + ): Single>> { + return Single.create { emitter: SingleEmitter>> -> val where = MessageColumns.STATUS + " = ?" val args = arrayOf(MessageStatus.QUEUE.toString()) val orderBy = MessageColumns._ID + " ASC LIMIT 1" @@ -684,7 +691,7 @@ internal class MessagesStorage(base: AppStorages) : AbsStorage(base), IMessagesS } } - override fun notifyMessageHasAttachments(accountId: Int, messageId: Int): Completable { + override fun notifyMessageHasAttachments(accountId: Long, messageId: Int): Completable { return Completable.fromAction { val cv = ContentValues() cv.put(MessageColumns.HAS_ATTACHMENTS, true) @@ -696,9 +703,9 @@ internal class MessagesStorage(base: AppStorages) : AbsStorage(base), IMessagesS } override fun getForwardMessageIds( - accountId: Int, + accountId: Long, attachTo: Int, - pair: Int + pair: Long ): Single>> { return Single.create { e: SingleEmitter>> -> val uri = getMessageContentUriFor(accountId) @@ -710,7 +717,7 @@ internal class MessagesStorage(base: AppStorages) : AbsStorage(base), IMessagesS MessageColumns.FULL_ID + " DESC" ) val ids = ArrayList(safeCountOf(cursor)) - var from_peer: Int? = null + var from_peer: Long? = null var isFirst = true if (cursor != null) { while (cursor.moveToNext()) { @@ -720,7 +727,7 @@ internal class MessagesStorage(base: AppStorages) : AbsStorage(base), IMessagesS if (isFirst) { isFirst = false from_peer = - cursor.getInt(MessageColumns.PEER_ID) + cursor.getLong(MessageColumns.PEER_ID) } ids.add(cursor.getInt(MessageColumns.ORIGINAL_ID)) } @@ -733,7 +740,7 @@ internal class MessagesStorage(base: AppStorages) : AbsStorage(base), IMessagesS companion object { private const val ORDER_BY = MessageColumns.FULL_STATUS + ", " + MessageColumns.FULL_ID fun appendDboOperation( - accountId: Int, + accountId: Long, dbo: MessageDboEntity, target: MutableList, attachToId: Int?, @@ -834,8 +841,8 @@ internal class MessagesStorage(base: AppStorages) : AbsStorage(base), IMessagesS @ChatAction val action = cursor.getInt(MessageColumns.ACTION) val id = cursor.getInt(MessageColumns._ID) - val peerId = cursor.getInt(MessageColumns.PEER_ID) - val fromId = cursor.getInt(MessageColumns.FROM_ID) + val peerId = cursor.getLong(MessageColumns.PEER_ID) + val fromId = cursor.getLong(MessageColumns.FROM_ID) var extras: Map? = null var keyboard: KeyboardEntity? = null val extrasText = cursor.getBlob(MessageColumns.EXTRAS) @@ -868,7 +875,7 @@ internal class MessagesStorage(base: AppStorages) : AbsStorage(base), IMessagesS .setOriginalId(cursor.getInt(MessageColumns.ORIGINAL_ID)) .setImportant(cursor.getBoolean(MessageColumns.IMPORTANT)) .setAction(action) - .setActionMemberId(cursor.getInt(MessageColumns.ACTION_MID)) + .setActionMemberId(cursor.getLong(MessageColumns.ACTION_MID)) .setActionEmail(cursor.getString(MessageColumns.ACTION_EMAIL)) .setActionText(cursor.getString(MessageColumns.ACTION_TEXT)) .setPhoto50(cursor.getString(MessageColumns.PHOTO_50)) @@ -880,4 +887,4 @@ internal class MessagesStorage(base: AppStorages) : AbsStorage(base), IMessagesS .setKeyboard(keyboard) } } -} +} \ No newline at end of file diff --git a/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/db/impl/OwnersStorage.kt b/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/db/impl/OwnersStorage.kt index 9902e4698..61a022e87 100644 --- a/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/db/impl/OwnersStorage.kt +++ b/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/db/impl/OwnersStorage.kt @@ -33,7 +33,7 @@ import io.reactivex.rxjava3.subjects.PublishSubject internal class OwnersStorage(context: AppStorages) : AbsStorage(context), IOwnersStorage { private val banActionsPublisher: PublishSubject = PublishSubject.create() - private val managementActionsPublisher: PublishSubject> = + private val managementActionsPublisher: PublishSubject> = PublishSubject.create() override fun fireBanAction(action: BanAction): Completable { @@ -44,15 +44,18 @@ internal class OwnersStorage(context: AppStorages) : AbsStorage(context), IOwner return banActionsPublisher } - override fun fireManagementChangeAction(manager: Pair): Completable { + override fun fireManagementChangeAction(manager: Pair): Completable { return Completable.fromAction { managementActionsPublisher.onNext(manager) } } - override fun observeManagementChanges(): Observable> { + override fun observeManagementChanges(): Observable> { return managementActionsPublisher } - override fun getUserDetails(accountId: Int, userId: Int): Single> { + override fun getUserDetails( + accountId: Long, + userId: Long + ): Single> { return Single.fromCallable { val uri = getUserDetContentUriFor(accountId) val where = BaseColumns._ID + " = ?" @@ -74,8 +77,8 @@ internal class OwnersStorage(context: AppStorages) : AbsStorage(context), IOwner } override fun getGroupsDetails( - accountId: Int, - groupId: Int + accountId: Long, + groupId: Long ): Single> { return Single.fromCallable { val uri = getGroupsDetContentUriFor(accountId) @@ -98,8 +101,8 @@ internal class OwnersStorage(context: AppStorages) : AbsStorage(context), IOwner } override fun storeGroupsDetails( - accountId: Int, - groupId: Int, + accountId: Long, + groupId: Long, dbo: CommunityDetailsEntity ): Completable { return Completable.fromAction { @@ -115,8 +118,8 @@ internal class OwnersStorage(context: AppStorages) : AbsStorage(context), IOwner } override fun storeUserDetails( - accountId: Int, - userId: Int, + accountId: Long, + userId: Long, dbo: UserDetailsEntity ): Completable { return Completable.fromAction { @@ -131,7 +134,7 @@ internal class OwnersStorage(context: AppStorages) : AbsStorage(context), IOwner } } - override fun applyPathes(accountId: Int, patches: List): Completable { + override fun applyPathes(accountId: Long, patches: List): Completable { return if (patches.isEmpty()) { Completable.complete() } else Completable.create { emitter: CompletableEmitter -> @@ -165,11 +168,11 @@ internal class OwnersStorage(context: AppStorages) : AbsStorage(context), IOwner } override fun findFriendsListsByIds( - accountId: Int, - userId: Int, - ids: Collection - ): Single> { - return Single.create { emitter: SingleEmitter> -> + accountId: Long, + userId: Long, + ids: Collection + ): Single> { + return Single.create { emitter: SingleEmitter> -> val uri = getFriendListsContentUriFor(accountId) val where = FriendListsColumns.USER_ID + " = ? " + " AND " + FriendListsColumns.LIST_ID + " IN(" + Utils.join( @@ -178,7 +181,7 @@ internal class OwnersStorage(context: AppStorages) : AbsStorage(context), IOwner ) + ")" val args = arrayOf(userId.toString()) val cursor = context.contentResolver.query(uri, null, where, args, null) - @SuppressLint("UseSparseArrays") val map: MutableMap = + @SuppressLint("UseSparseArrays") val map: MutableMap = HashMap(safeCountOf(cursor)) if (cursor != null) { while (cursor.moveToNext()) { @@ -194,7 +197,7 @@ internal class OwnersStorage(context: AppStorages) : AbsStorage(context), IOwner } } - override fun getLocalizedUserActivity(accountId: Int, userId: Int): Maybe { + override fun getLocalizedUserActivity(accountId: Long, userId: Long): Maybe { return Maybe.create { e: MaybeEmitter -> val uProjection = arrayOf(UserColumns.LAST_SEEN, UserColumns.ONLINE, UserColumns.SEX) val uri = getUserContentUriFor(accountId) @@ -218,7 +221,7 @@ internal class OwnersStorage(context: AppStorages) : AbsStorage(context), IOwner } } - override fun findUserDboById(accountId: Int, ownerId: Int): Single> { + override fun findUserDboById(accountId: Long, ownerId: Long): Single> { return Single.create { emitter: SingleEmitter> -> val where = BaseColumns._ID + " = ?" val args = arrayOf(ownerId.toString()) @@ -236,8 +239,8 @@ internal class OwnersStorage(context: AppStorages) : AbsStorage(context), IOwner } override fun findCommunityDboById( - accountId: Int, - ownerId: Int + accountId: Long, + ownerId: Long ): Single> { return Single.create { emitter: SingleEmitter> -> val where = BaseColumns._ID + " = ?" @@ -255,7 +258,7 @@ internal class OwnersStorage(context: AppStorages) : AbsStorage(context), IOwner } } - override fun findUserByDomain(accountId: Int, domain: String?): Single> { + override fun findUserByDomain(accountId: Long, domain: String?): Single> { return Single.create { emitter: SingleEmitter> -> val uri = getUserContentUriFor(accountId) val where = UserColumns.DOMAIN + " LIKE ?" @@ -272,7 +275,7 @@ internal class OwnersStorage(context: AppStorages) : AbsStorage(context), IOwner } } - override fun findFriendBirtday(accountId: Int): Single> { + override fun findFriendBirtday(accountId: Long): Single> { return Single.create { val uri = getUserContentUriFor(accountId) val where = UserColumns.BDATE + " IS NOT NULL AND " + UserColumns.IS_FRIEND + " = 1" @@ -287,7 +290,7 @@ internal class OwnersStorage(context: AppStorages) : AbsStorage(context), IOwner } override fun findCommunityByDomain( - accountId: Int, + accountId: Long, domain: String? ): Single> { return Single.create { emitter: SingleEmitter> -> @@ -306,7 +309,7 @@ internal class OwnersStorage(context: AppStorages) : AbsStorage(context), IOwner } } - override fun findUserDbosByIds(accountId: Int, ids: List): Single> { + override fun findUserDbosByIds(accountId: Long, ids: List): Single> { return if (ids.isEmpty()) { Single.just(emptyList()) } else Single.create { emitter: SingleEmitter> -> @@ -336,8 +339,8 @@ internal class OwnersStorage(context: AppStorages) : AbsStorage(context), IOwner } override fun findCommunityDbosByIds( - accountId: Int, - ids: List + accountId: Long, + ids: List ): Single> { return if (ids.isEmpty()) { Single.just(emptyList()) @@ -367,7 +370,7 @@ internal class OwnersStorage(context: AppStorages) : AbsStorage(context), IOwner } } - override fun storeUserDbos(accountId: Int, users: List): Completable { + override fun storeUserDbos(accountId: Long, users: List): Completable { return Completable.create { emitter: CompletableEmitter -> val operations = ArrayList(users.size) appendUsersInsertOperation(operations, accountId, users) @@ -376,7 +379,7 @@ internal class OwnersStorage(context: AppStorages) : AbsStorage(context), IOwner } } - override fun storeOwnerEntities(accountId: Int, entities: OwnerEntities?): Completable { + override fun storeOwnerEntities(accountId: Long, entities: OwnerEntities?): Completable { return Completable.create { emitter: CompletableEmitter -> entities ?: return@create emitter.onComplete() val operations = ArrayList( @@ -390,7 +393,7 @@ internal class OwnersStorage(context: AppStorages) : AbsStorage(context), IOwner } override fun storeCommunityDbos( - accountId: Int, + accountId: Long, communityEntities: List ): Completable { return Completable.create { emitter: CompletableEmitter -> @@ -401,13 +404,16 @@ internal class OwnersStorage(context: AppStorages) : AbsStorage(context), IOwner } } - override fun getMissingUserIds(accountId: Int, ids: Collection): Single> { - return Single.create { e: SingleEmitter> -> + override fun getMissingUserIds( + accountId: Long, + ids: Collection + ): Single> { + return Single.create { e: SingleEmitter> -> if (ids.isEmpty()) { e.onSuccess(emptyList()) return@create } - val copy: MutableSet = HashSet(ids) + val copy: MutableSet = HashSet(ids) val projection = arrayOf(BaseColumns._ID) val cursor = contentResolver.query( getUserContentUriFor(accountId), @@ -415,7 +421,7 @@ internal class OwnersStorage(context: AppStorages) : AbsStorage(context), IOwner ) if (cursor != null) { while (cursor.moveToNext()) { - val id = cursor.getInt(BaseColumns._ID) + val id = cursor.getLong(BaseColumns._ID) copy.remove(id) } cursor.close() @@ -425,15 +431,15 @@ internal class OwnersStorage(context: AppStorages) : AbsStorage(context), IOwner } override fun getMissingCommunityIds( - accountId: Int, - ids: Collection - ): Single> { - return Single.create { e: SingleEmitter> -> + accountId: Long, + ids: Collection + ): Single> { + return Single.create { e: SingleEmitter> -> if (ids.isEmpty()) { e.onSuccess(emptyList()) return@create } - val copy: MutableSet = HashSet(ids) + val copy: MutableSet = HashSet(ids) val projection = arrayOf(BaseColumns._ID) val cursor = contentResolver.query( getGroupsContentUriFor(accountId), @@ -441,7 +447,7 @@ internal class OwnersStorage(context: AppStorages) : AbsStorage(context), IOwner ) if (cursor != null) { while (cursor.moveToNext()) { - val id = cursor.getInt(BaseColumns._ID) + val id = cursor.getLong(BaseColumns._ID) copy.remove(id) } cursor.close() @@ -451,7 +457,7 @@ internal class OwnersStorage(context: AppStorages) : AbsStorage(context), IOwner } private fun mapFriendsList(cursor: Cursor): FriendListEntity { - val id = cursor.getInt(FriendListsColumns.LIST_ID) + val id = cursor.getLong(FriendListsColumns.LIST_ID) val name = cursor.getString(FriendListsColumns.NAME) return FriendListEntity(id, name) } @@ -484,7 +490,7 @@ internal class OwnersStorage(context: AppStorages) : AbsStorage(context), IOwner fun appendOwnersInsertOperations( operations: MutableList, - accountId: Int, + accountId: Long, ownerEntities: OwnerEntities? ) { ownerEntities ?: return @@ -495,7 +501,7 @@ internal class OwnersStorage(context: AppStorages) : AbsStorage(context), IOwner fun appendUsersInsertOperation( operations: MutableList, - accountId: Int, + accountId: Long, dbos: List? ) { dbos ?: return @@ -508,7 +514,7 @@ internal class OwnersStorage(context: AppStorages) : AbsStorage(context), IOwner fun appendCommunitiesInsertOperation( operations: MutableList, - accountId: Int, + accountId: Long, dbos: List? ) { dbos ?: return @@ -570,7 +576,7 @@ internal class OwnersStorage(context: AppStorages) : AbsStorage(context), IOwner } internal fun mapCommunityDbo(cursor: Cursor): CommunityEntity { - return CommunityEntity(cursor.getInt(BaseColumns._ID)) + return CommunityEntity(cursor.getLong(BaseColumns._ID)) .setName(cursor.getString(GroupColumns.NAME)) .setScreenName(cursor.getString(GroupColumns.SCREEN_NAME)) .setClosed(cursor.getInt(GroupColumns.IS_CLOSED)) @@ -589,7 +595,7 @@ internal class OwnersStorage(context: AppStorages) : AbsStorage(context), IOwner } internal fun mapUserDbo(cursor: Cursor): UserEntity { - return UserEntity(cursor.getInt(BaseColumns._ID)) + return UserEntity(cursor.getLong(BaseColumns._ID)) .setFirstName(cursor.getString(UserColumns.FIRST_NAME)) .setLastName(cursor.getString(UserColumns.LAST_NAME)) .setOnline(cursor.getBoolean(UserColumns.ONLINE)) @@ -617,4 +623,4 @@ internal class OwnersStorage(context: AppStorages) : AbsStorage(context), IOwner } } -} +} \ No newline at end of file diff --git a/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/db/impl/PhotoAlbumsStorage.kt b/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/db/impl/PhotoAlbumsStorage.kt index b5b5679bd..df2d72158 100644 --- a/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/db/impl/PhotoAlbumsStorage.kt +++ b/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/db/impl/PhotoAlbumsStorage.kt @@ -23,8 +23,8 @@ import io.reactivex.rxjava3.core.SingleEmitter internal class PhotoAlbumsStorage(base: AppStorages) : AbsStorage(base), IPhotoAlbumsStorage { override fun findAlbumById( - accountId: Int, - ownerId: Int, + accountId: Long, + ownerId: Long, albumId: Int ): Single> { return Single.create { e: SingleEmitter> -> @@ -69,8 +69,8 @@ internal class PhotoAlbumsStorage(base: AppStorages) : AbsStorage(base), IPhotoA } override fun store( - accountId: Int, - ownerId: Int, + accountId: Long, + ownerId: Long, albums: List, clearBefore: Boolean ): Completable { @@ -102,7 +102,7 @@ internal class PhotoAlbumsStorage(base: AppStorages) : AbsStorage(base), IPhotoA } } - override fun removeAlbumById(accountId: Int, ownerId: Int, albumId: Int): Completable { + override fun removeAlbumById(accountId: Long, ownerId: Long, albumId: Int): Completable { return Completable.create { e: CompletableEmitter -> val where = PhotoAlbumsColumns.OWNER_ID + " = ? AND " + PhotoAlbumsColumns.ALBUM_ID + " = ?" @@ -115,7 +115,7 @@ internal class PhotoAlbumsStorage(base: AppStorages) : AbsStorage(base), IPhotoA private fun mapAlbum(cursor: Cursor): PhotoAlbumDboEntity { val id = cursor.getInt(PhotoAlbumsColumns.ALBUM_ID) - val ownerId = cursor.getInt(PhotoAlbumsColumns.OWNER_ID) + val ownerId = cursor.getLong(PhotoAlbumsColumns.OWNER_ID) val album = PhotoAlbumDboEntity().set(id, ownerId) .setTitle(cursor.getString(PhotoAlbumsColumns.TITLE)) .setSize(cursor.getInt(PhotoAlbumsColumns.SIZE)) diff --git a/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/db/impl/PhotosStorage.kt b/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/db/impl/PhotosStorage.kt index 58a08dc51..11c1122ea 100644 --- a/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/db/impl/PhotosStorage.kt +++ b/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/db/impl/PhotosStorage.kt @@ -23,8 +23,8 @@ import io.reactivex.rxjava3.core.SingleEmitter internal class PhotosStorage(base: AppStorages) : AbsStorage(base), IPhotosStorage { override fun insertPhotosRx( - accountId: Int, - ownerId: Int, + accountId: Long, + ownerId: Long, albumId: Int, photos: List, clearBefore: Boolean @@ -57,8 +57,8 @@ internal class PhotosStorage(base: AppStorages) : AbsStorage(base), IPhotosStora } override fun insertPhotosExtendedRx( - accountId: Int, - ownerId: Int, + accountId: Long, + ownerId: Long, albumId: Int, photos: List, clearBefore: Boolean @@ -133,8 +133,8 @@ internal class PhotosStorage(base: AppStorages) : AbsStorage(base), IPhotosStora } override fun applyPatch( - accountId: Int, - ownerId: Int, + accountId: Long, + ownerId: Long, photoId: Int, patch: PhotoPatch ): Completable { @@ -163,7 +163,7 @@ internal class PhotosStorage(base: AppStorages) : AbsStorage(base), IPhotosStora sizes = MsgPack.decodeFromByteArrayEx(PhotoSizeEntity.serializer(), sizesJson) } val id = cursor.getInt(PhotosColumns.PHOTO_ID) - val ownerId = cursor.getInt(PhotosColumns.OWNER_ID) + val ownerId = cursor.getLong(PhotosColumns.OWNER_ID) return PhotoDboEntity().set(id, ownerId) .setSizes(sizes) .setAlbumId(cursor.getInt(PhotosColumns.ALBUM_ID)) @@ -211,7 +211,7 @@ internal class PhotosStorage(base: AppStorages) : AbsStorage(base), IPhotosStora internal fun getExtendedCV( dbo: PhotoDboEntity, - ownerId: Int, + ownerId: Long, albumInt: Int ): ContentValues { val cv = ContentValues() diff --git a/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/db/impl/RelativeshipStorage.kt b/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/db/impl/RelativeshipStorage.kt index ae68277ae..511e1d1e1 100644 --- a/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/db/impl/RelativeshipStorage.kt +++ b/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/db/impl/RelativeshipStorage.kt @@ -29,8 +29,8 @@ import kotlin.math.abs internal class RelativeshipStorage(base: AppStorages) : AbsStorage(base), IRelativeshipStorage { override fun storeFriendsList( - accountId: Int, - userId: Int, + accountId: Long, + userId: Long, data: Collection ): Completable { return Completable.create { e: CompletableEmitter -> @@ -60,9 +60,9 @@ internal class RelativeshipStorage(base: AppStorages) : AbsStorage(base), IRelat } override fun storeFriends( - accountId: Int, + accountId: Long, users: List, - objectId: Int, + objectId: Long, clearBeforeStore: Boolean ): Completable { return completableStoreForType( @@ -75,9 +75,9 @@ internal class RelativeshipStorage(base: AppStorages) : AbsStorage(base), IRelat } private fun completableStoreForType( - accountId: Int, + accountId: Long, userEntities: List, - objectId: Int, + objectId: Long, relationType: Int, clear: Boolean ): Completable { @@ -95,9 +95,9 @@ internal class RelativeshipStorage(base: AppStorages) : AbsStorage(base), IRelat } override fun storeFollowers( - accountId: Int, + accountId: Long, users: List, - objectId: Int, + objectId: Long, clearBeforeStore: Boolean ): Completable { return completableStoreForType( @@ -110,9 +110,9 @@ internal class RelativeshipStorage(base: AppStorages) : AbsStorage(base), IRelat } override fun storeRequests( - accountId: Int, + accountId: Long, users: List, - objectId: Int, + objectId: Long, clearBeforeStore: Boolean ): Completable { return completableStoreForType( @@ -125,9 +125,9 @@ internal class RelativeshipStorage(base: AppStorages) : AbsStorage(base), IRelat } override fun storeGroupMembers( - accountId: Int, + accountId: Long, users: List, - objectId: Int, + objectId: Long, clearBeforeStore: Boolean ): Completable { return completableStoreForType( @@ -139,23 +139,23 @@ internal class RelativeshipStorage(base: AppStorages) : AbsStorage(base), IRelat ) } - override fun getGroupMembers(accountId: Int, groupId: Int): Single> { + override fun getGroupMembers(accountId: Long, groupId: Long): Single> { return getUsersForType(accountId, groupId, RelationshipColumns.TYPE_GROUP_MEMBER) } - override fun getFriends(accountId: Int, objectId: Int): Single> { + override fun getFriends(accountId: Long, objectId: Long): Single> { return getUsersForType(accountId, objectId, RelationshipColumns.TYPE_FRIEND) } - override fun getFollowers(accountId: Int, objectId: Int): Single> { + override fun getFollowers(accountId: Long, objectId: Long): Single> { return getUsersForType(accountId, objectId, RelationshipColumns.TYPE_FOLLOWER) } - override fun getRequests(accountId: Int): Single> { + override fun getRequests(accountId: Long): Single> { return getUsersForType(accountId, accountId, RelationshipColumns.TYPE_REQUESTS) } - override fun getCommunities(accountId: Int, ownerId: Int): Single> { + override fun getCommunities(accountId: Long, ownerId: Long): Single> { return Single.create { emitter: SingleEmitter> -> val cursor = getCursorForType(accountId, ownerId, RelationshipColumns.TYPE_MEMBER) val dbos: MutableList = ArrayList(safeCountOf(cursor)) @@ -173,9 +173,9 @@ internal class RelativeshipStorage(base: AppStorages) : AbsStorage(base), IRelat } override fun storeComminities( - accountId: Int, + accountId: Long, communities: List, - userId: Int, + userId: Long, invalidateBefore: Boolean ): Completable { return Completable.create { emitter: CompletableEmitter -> @@ -203,7 +203,7 @@ internal class RelativeshipStorage(base: AppStorages) : AbsStorage(base), IRelat } } - private fun getCursorForType(accountId: Int, objectId: Int, relationType: Int): Cursor? { + private fun getCursorForType(accountId: Long, objectId: Long, relationType: Int): Cursor? { val uri = getRelativeshipContentUriFor(accountId) val where = RelationshipColumns.FULL_TYPE + " = ? AND " + RelationshipColumns.OBJECT_ID + " = ?" @@ -212,8 +212,8 @@ internal class RelativeshipStorage(base: AppStorages) : AbsStorage(base), IRelat } private fun getUsersForType( - accountId: Int, - objectId: Int, + accountId: Long, + objectId: Long, relationType: Int ): Single> { return Single.create { emitter: SingleEmitter> -> @@ -235,7 +235,7 @@ internal class RelativeshipStorage(base: AppStorages) : AbsStorage(base), IRelat private fun appendInsertHeaders( uri: Uri, operations: MutableList, - objectId: Int, + objectId: Long, dbos: List, type: Int ) { @@ -250,8 +250,8 @@ internal class RelativeshipStorage(base: AppStorages) : AbsStorage(base), IRelat } private fun clearOperationFor( - accountId: Int, - objectId: Int, + accountId: Long, + objectId: Long, type: Int ): ContentProviderOperation { val uri = getRelativeshipContentUriFor(accountId) @@ -266,7 +266,7 @@ internal class RelativeshipStorage(base: AppStorages) : AbsStorage(base), IRelat companion object { internal fun mapCommunity(cursor: Cursor): CommunityEntity { - return CommunityEntity(cursor.getInt(RelationshipColumns.SUBJECT_ID)) + return CommunityEntity(cursor.getLong(RelationshipColumns.SUBJECT_ID)) .setName(cursor.getString(RelationshipColumns.FOREIGN_SUBJECT_GROUP_NAME)) .setScreenName(cursor.getString(RelationshipColumns.FOREIGN_SUBJECT_GROUP_SCREEN_NAME)) .setClosed(cursor.getInt(RelationshipColumns.FOREIGN_SUBJECT_GROUP_IS_CLOSED)) @@ -286,7 +286,7 @@ internal class RelativeshipStorage(base: AppStorages) : AbsStorage(base), IRelat internal fun mapDbo(cursor: Cursor): UserEntity { val gid = - abs(cursor.getInt(RelationshipColumns.SUBJECT_ID)) + abs(cursor.getLong(RelationshipColumns.SUBJECT_ID)) return UserEntity(gid) .setFirstName(cursor.getString(RelationshipColumns.FOREIGN_SUBJECT_USER_FIRST_NAME)) .setLastName(cursor.getString(RelationshipColumns.FOREIGN_SUBJECT_USER_LAST_NAME)) diff --git a/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/db/impl/StickersStorage.kt b/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/db/impl/StickersStorage.kt index 68a8293ab..ab80c56d1 100644 --- a/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/db/impl/StickersStorage.kt +++ b/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/db/impl/StickersStorage.kt @@ -24,7 +24,7 @@ import kotlinx.serialization.builtins.serializer import java.util.* internal class StickersStorage(base: AppStorages) : AbsStorage(base), IStickersStorage { - override fun storeStickerSets(accountId: Int, sets: List): Completable { + override fun storeStickerSets(accountId: Long, sets: List): Completable { return Completable.create { e: CompletableEmitter -> val start = System.currentTimeMillis() val db = TempDataHelper.helper.writableDatabase @@ -46,7 +46,7 @@ internal class StickersStorage(base: AppStorages) : AbsStorage(base), IStickersS } } - override fun clearAccount(accountId: Int): Completable { + override fun clearAccount(accountId: Long): Completable { Settings.get().other().del_last_stickers_sync(accountId) return Completable.create { e: CompletableEmitter -> val db = TempDataHelper.helper.writableDatabase @@ -70,7 +70,7 @@ internal class StickersStorage(base: AppStorages) : AbsStorage(base), IStickersS } } - override fun storeKeyWords(accountId: Int, sets: List): Completable { + override fun storeKeyWords(accountId: Long, sets: List): Completable { return Completable.create { e: CompletableEmitter -> val start = System.currentTimeMillis() val db = TempDataHelper.helper.writableDatabase @@ -100,7 +100,7 @@ internal class StickersStorage(base: AppStorages) : AbsStorage(base), IStickersS } } - override fun getPurchasedAndActive(accountId: Int): Single> { + override fun getPurchasedAndActive(accountId: Long): Single> { return Single.create { e: SingleEmitter> -> val start = System.currentTimeMillis() val where = @@ -129,7 +129,7 @@ internal class StickersStorage(base: AppStorages) : AbsStorage(base), IStickersS } } - override fun getKeywordsStickers(accountId: Int, s: String?): Single> { + override fun getKeywordsStickers(accountId: Long, s: String?): Single> { return Single.create { e: SingleEmitter> -> val where = "${StickersKeywordsColumns.ACCOUNT_ID} = ?" val args = arrayOf(accountId.toString()) @@ -185,7 +185,7 @@ internal class StickersStorage(base: AppStorages) : AbsStorage(base), IStickersS lhs.position.compareTo(rhs.position) } - internal fun createCv(accountId: Int, entity: StickerSetEntity, pos: Int): ContentValues { + internal fun createCv(accountId: Long, entity: StickerSetEntity, pos: Int): ContentValues { val cv = ContentValues() cv.put(BaseColumns._ID, entity.id) cv.put(StickerSetColumns.ACCOUNT_ID, accountId) @@ -218,7 +218,7 @@ internal class StickersStorage(base: AppStorages) : AbsStorage(base), IStickersS } internal fun createCvStickersKeywords( - accountId: Int, + accountId: Long, entity: StickersKeywordsEntity, id: Int ): ContentValues { diff --git a/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/db/impl/TempDataStorage.kt b/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/db/impl/TempDataStorage.kt index 5c4a65258..17c91fd11 100644 --- a/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/db/impl/TempDataStorage.kt +++ b/app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/db/impl/TempDataStorage.kt @@ -28,7 +28,7 @@ class TempDataStorage internal constructor(context: Context) : ITempDataStorage } override fun getTemporaryData( - ownerId: Int, + ownerId: Long, sourceId: Int, serializer: ISerializeAdapter ): Single> { @@ -53,7 +53,7 @@ class TempDataStorage internal constructor(context: Context) : ITempDataStorage } override fun putTemporaryData( - ownerId: Int, + ownerId: Long, sourceId: Int, data: List, serializer: ISerializeAdapter @@ -90,7 +90,7 @@ class TempDataStorage internal constructor(context: Context) : ITempDataStorage } } - override fun deleteTemporaryData(ownerId: Int): Completable { + override fun deleteTemporaryData(ownerId: Long): Completable { return Completable.fromAction { val start = System.currentTimeMillis() val count = helper.writableDatabase.delete( @@ -274,7 +274,7 @@ class TempDataStorage internal constructor(context: Context) : ITempDataStorage } } - override fun deleteAudio(sourceOwner: Int, id: Int, ownerId: Int): Completable { + override fun deleteAudio(sourceOwner: Long, id: Int, ownerId: Long): Completable { return Completable.fromAction { helper.writableDatabase.delete( AudioColumns.TABLENAME, @@ -293,7 +293,7 @@ class TempDataStorage internal constructor(context: Context) : ITempDataStorage } } - override fun getAudiosAll(sourceOwner: Int): Single> { + override fun getAudiosAll(sourceOwner: Long): Single> { return Single.fromCallable { val cursor = helper.readableDatabase.query( AudioColumns.TABLENAME, @@ -313,7 +313,7 @@ class TempDataStorage internal constructor(context: Context) : ITempDataStorage } } - override fun addAudios(sourceOwner: Int, list: List