Skip to content
This repository has been archived by the owner on Mar 19, 2022. It is now read-only.

Commit

Permalink
Cleaning
Browse files Browse the repository at this point in the history
  • Loading branch information
badoualy committed Sep 22, 2016
1 parent 666a81e commit cbc5a1a
Show file tree
Hide file tree
Showing 7 changed files with 14 additions and 8 deletions.
2 changes: 2 additions & 0 deletions api/build.gradle
Expand Up @@ -2,6 +2,8 @@ apply plugin: 'java'
apply plugin: 'kotlin'
apply plugin: 'maven'

sourceCompatibility = 1.8

dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
compile project(':mtproto')
Expand Down
Expand Up @@ -6,13 +6,13 @@ import org.slf4j.LoggerFactory

object Kotlogram {

val logger = LoggerFactory.getLogger(Kotlogram::class.java)!!
private val logger = LoggerFactory.getLogger(Kotlogram::class.java)!!

@JvmField
val API_LAYER = 53

init {
logger.warn("""
logger.info("""
__ ___ ______ .___________. __ ______ _______ .______ ___ .___ ___.
| |/ / / __ \ | || | / __ \ / _____|| _ \ / \ | \/ |
| ' / | | | | `---| |----`| | | | | | | | __ | |_) | / ^ \ | \ / |
Expand Down
4 changes: 2 additions & 2 deletions gradle/wrapper/gradle-wrapper.properties
@@ -1,6 +1,6 @@
#Tue Sep 06 08:19:23 CEST 2016
#Thu Sep 22 09:16:27 CEST 2016
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-2.14.1-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-2.14.1-all.zip
2 changes: 2 additions & 0 deletions mtproto/build.gradle
Expand Up @@ -2,6 +2,8 @@ apply plugin: 'java'
apply plugin: 'kotlin'
apply plugin: 'maven'

sourceCompatibility = 1.8

dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
compile project(':tl')
Expand Down
Expand Up @@ -121,15 +121,15 @@ class MTProtoHandler {
}

@Throws(IOException::class)
fun <T : TLObject> executeMethodSync(method: TLMethod<T>, timeout: Long) = executeMethod(method, timeout).toBlocking().first()
fun <T : TLObject> executeMethodSync(method: TLMethod<T>, timeout: Long): T = executeMethod(method, timeout).toBlocking().first()

/**
* Execute the given methods synchronously and return the list of results (guaranties the order is conserved)
* @param methods methods to execute
* @param timeout timeout before returning an error
*/
@Throws(IOException::class)
fun <T : TLObject> executeMethodsSync(methods: List<TLMethod<T>>, timeout: Long): List<T> = executeMethods(methods, timeout).toBlocking().toIterable().sortedBy { methods.indexOf(it) }.map { it.response }.toList()
fun <T : TLObject> executeMethodsSync(methods: List<TLMethod<out T>>, timeout: Long): List<T> = executeMethods(methods, timeout).toBlocking().toIterable().sortedBy { methods.indexOf(it) }.map { it.response }.toList()

/**
* Queue a method to be executed with the next message.
Expand Down Expand Up @@ -166,7 +166,7 @@ class MTProtoHandler {
* @throws IOException
*/
@Throws(IOException::class)
fun <T : TLObject> executeMethods(methods: List<TLMethod<T>>, timeout: Long): Observable<TLMethod<T>> {
fun <T : TLObject> executeMethods(methods: List<TLMethod<out T>>, timeout: Long): Observable<TLMethod<T>> {
if (methods.isEmpty())
throw IllegalArgumentException("No methods to execute")

Expand Down
Expand Up @@ -57,7 +57,7 @@ object AuthKeyCreation {
* @see [Creating an Authorization Key](https://core.telegram.org/mtproto/auth_key)
* and [Perfect Forward Secrecy](https://core.telegram.org/api/pfs)
*/
@JvmStatic @JvmOverloads
//@JvmStatic @JvmOverloads
private fun createTmpAuthKey(dataCenter: DataCenter, expireDelay: Int = TEMPORARY_KEY_DEFAULT_EXPIRE_DELAY) {
tmpKeyExpireDelay = expireDelay
createAuthKeyInternal(dataCenter, true)
Expand Down
2 changes: 2 additions & 0 deletions tl/build.gradle
@@ -1,6 +1,8 @@
apply plugin: 'java'
apply plugin: 'maven'

sourceCompatibility = 1.8

dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')

Expand Down

0 comments on commit cbc5a1a

Please sign in to comment.