Fix code formatting

Signed-off-by: Andy Scherzinger <info@andy-scherzinger.de>
This commit is contained in:
Andy Scherzinger 2023-02-15 10:50:59 +01:00 committed by Marcel Hibbe
parent e84963842a
commit 41d671ff47
No known key found for this signature in database
GPG key ID: C793F8B59F43CE7B
39 changed files with 134 additions and 98 deletions

View file

@ -109,7 +109,8 @@ class ClosedInterfaceImpl : ClosedInterface, ProviderInstaller.ProviderInstallLi
WorkManager.getInstance()
.enqueueUniquePeriodicWork(
"periodicTokenRegistration", ExistingPeriodicWorkPolicy.REPLACE,
"periodicTokenRegistration",
ExistingPeriodicWorkPolicy.REPLACE,
periodicTokenRegistration
)
}
@ -120,13 +121,14 @@ class ClosedInterfaceImpl : ClosedInterface, ProviderInstaller.ProviderInstallLi
MONTHLY,
TimeUnit.DAYS,
FLEX_INTERVAL,
TimeUnit.DAYS,
TimeUnit.DAYS
)
.build()
WorkManager.getInstance()
.enqueueUniquePeriodicWork(
"periodicTokenRefreshFromFCM", ExistingPeriodicWorkPolicy.REPLACE,
"periodicTokenRefreshFromFCM",
ExistingPeriodicWorkPolicy.REPLACE,
periodicTokenRefreshFromFCM
)
}

View file

@ -40,7 +40,7 @@ data class User(
var clientCertificate: String? = null,
var externalSignalingServer: ExternalSignalingServer? = null,
var current: Boolean = FALSE,
var scheduledForDeletion: Boolean = FALSE,
var scheduledForDeletion: Boolean = FALSE
) : Parcelable {
fun getMaxMessageLength(): Int {

View file

@ -35,16 +35,40 @@ import java.lang.Boolean.FALSE
@Parcelize
@Entity(tableName = "User")
data class UserEntity(
@PrimaryKey(autoGenerate = true) @ColumnInfo(name = "id") var id: Long = 0,
@ColumnInfo(name = "userId") var userId: String? = null,
@ColumnInfo(name = "username") var username: String? = null,
@ColumnInfo(name = "baseUrl") var baseUrl: String? = null,
@ColumnInfo(name = "token") var token: String? = null,
@ColumnInfo(name = "displayName") var displayName: String? = null,
@ColumnInfo(name = "pushConfigurationState") var pushConfigurationState: PushConfigurationState? = null,
@ColumnInfo(name = "capabilities") var capabilities: Capabilities? = null,
@ColumnInfo(name = "clientCertificate") var clientCertificate: String? = null,
@ColumnInfo(name = "externalSignalingServer") var externalSignalingServer: ExternalSignalingServer? = null,
@ColumnInfo(name = "current") var current: Boolean = FALSE,
@ColumnInfo(name = "scheduledForDeletion") var scheduledForDeletion: Boolean = FALSE,
@PrimaryKey(autoGenerate = true)
@ColumnInfo(name = "id")
var id: Long = 0,
@ColumnInfo(name = "userId")
var userId: String? = null,
@ColumnInfo(name = "username")
var username: String? = null,
@ColumnInfo(name = "baseUrl")
var baseUrl: String? = null,
@ColumnInfo(name = "token")
var token: String? = null,
@ColumnInfo(name = "displayName")
var displayName: String? = null,
@ColumnInfo(name = "pushConfigurationState")
var pushConfigurationState: PushConfigurationState? = null,
@ColumnInfo(name = "capabilities")
var capabilities: Capabilities? = null,
@ColumnInfo(name = "clientCertificate")
var clientCertificate: String? = null,
@ColumnInfo(name = "externalSignalingServer")
var externalSignalingServer: ExternalSignalingServer? = null,
@ColumnInfo(name = "current")
var current: Boolean = FALSE,
@ColumnInfo(name = "scheduledForDeletion")
var scheduledForDeletion: Boolean = FALSE
) : Parcelable

View file

@ -53,7 +53,6 @@ fun ImageView.loadAvatar(
requestBigSize: Boolean = true
): io.reactivex.disposables
.Disposable {
val imageRequestUri = ApiUtils.getUrlForAvatar(
user.baseUrl,
avatar,
@ -69,7 +68,6 @@ fun ImageView.replaceAvatar(
requestBigSize: Boolean = true
): io.reactivex.disposables
.Disposable {
val imageRequestUri = ApiUtils.getUrlForAvatar(
user.baseUrl,
avatar,
@ -86,7 +84,6 @@ private fun ImageView.loadAvatarInternal(
replace: Boolean
): io.reactivex.disposables
.Disposable {
if (replace && this.result is SuccessResult) {
val result = this.result as SuccessResult
val memoryCacheKey = result.memoryCacheKey
@ -227,7 +224,6 @@ fun ImageView.loadBotsAvatar(): io.reactivex.disposables.Disposable {
}
fun ImageView.loadGroupCallAvatar(viewThemeUtils: ViewThemeUtils): io.reactivex.disposables.Disposable {
val data: Any = if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
viewThemeUtils.talk.themePlaceholderAvatar(this, R.drawable.ic_avatar_group) as Any
} else {

View file

@ -520,11 +520,15 @@ class NotificationWorker(context: Context, workerParams: WorkerParameters) : Wor
if ("user" == userType || "guest" == userType) {
val baseUrl = signatureVerification.user!!.baseUrl
val avatarUrl = if ("user" == userType) ApiUtils.getUrlForAvatar(
baseUrl,
notificationUser.id,
false
) else ApiUtils.getUrlForGuestAvatar(baseUrl, notificationUser.name, false)
val avatarUrl = if ("user" == userType) {
ApiUtils.getUrlForAvatar(
baseUrl,
notificationUser.id,
false
)
} else {
ApiUtils.getUrlForGuestAvatar(baseUrl, notificationUser.name, false)
}
person.setIcon(loadAvatarSync(avatarUrl, context!!))
}
notificationBuilder.setStyle(getStyle(person.build(), style))

View file

@ -70,7 +70,8 @@ class ShareOperationWorker(context: Context, workerParams: WorkerParameters) : W
)
.subscribeOn(Schedulers.io())
.blockingSubscribe(
{}, { e -> Log.w(TAG, "error while creating RemoteShare", e) }
{},
{ e -> Log.w(TAG, "error while creating RemoteShare", e) }
)
}
return Result.success()

View file

@ -129,7 +129,7 @@ data class ChatMessage(
var voiceMessagePlayedSeconds: Int = 0,
var voiceMessageDownloadProgress: Int = 0,
var voiceMessageDownloadProgress: Int = 0
) : Parcelable, MessageContentType, MessageContentType.Image {
@ -235,7 +235,9 @@ data class ChatMessage(
}
return if (!messageTypesToIgnore.contains(getCalculateMessageType())) {
message!!.trim { it <= ' ' }
} else null
} else {
null
}
}
fun getCalculateMessageType(): MessageType {
@ -418,7 +420,8 @@ data class ChatMessage(
}
actorType == "bridged" -> {
ApiUtils.getUrlForAvatar(
activeUser!!.baseUrl, "bridge-bot",
activeUser!!.baseUrl,
"bridge-bot",
true
)
}
@ -524,7 +527,7 @@ data class ChatMessage(
RECORDING_STARTED,
RECORDING_STOPPED,
AUDIO_RECORDING_STARTED,
AUDIO_RECORDING_STOPPED,
AUDIO_RECORDING_STOPPED
}
companion object {

View file

@ -194,8 +194,10 @@ data class Conversation(
return if (canDeleteConversation != null) {
// Available since APIv2
canDeleteConversation!!
} else canModerate(conversationUser)
// Fallback for APIv1
} else {
canModerate(conversationUser)
// Fallback for APIv1
}
}
enum class NotificationLevel {

View file

@ -44,7 +44,6 @@ class EnumActorTypeConverter : StringBasedTypeConverter<Participant.ActorType>()
}
override fun convertToString(`object`: Participant.ActorType?): String {
if (`object` == null) {
return ""
}

View file

@ -36,7 +36,6 @@ class EnumReactionActorTypeConverter : StringBasedTypeConverter<ReactionVoter.Re
}
override fun convertToString(`object`: ReactionVoter.ReactionActorType?): String {
if (`object` == null) {
return ""
}

View file

@ -36,8 +36,7 @@ data class OpenGraphObject(
@JsonField(name = ["thumb"])
var thumb: String? = null,
@JsonField(name = ["link"])
var link: String? = null,
var link: String? = null
) : Parcelable {
// This constructor is added to work with the 'com.bluelinelabs.logansquare.annotation.JsonObject'
constructor() : this("", "", null, null)

View file

@ -34,8 +34,7 @@ data class Reference(
@JsonField(name = ["openGraphObject"])
var openGraphObject: OpenGraphObject? = null,
@JsonField(name = ["accessible"])
var accessible: Boolean,
var accessible: Boolean
) : Parcelable {
// This constructor is added to work with the 'com.bluelinelabs.logansquare.annotation.JsonObject'
constructor() : this(null, null, null, false)

View file

@ -36,8 +36,7 @@ data class RichObject(
@JsonField(name = ["thumb"])
var thumb: String? = null,
@JsonField(name = ["link"])
var link: String? = null,
var link: String? = null
) : Parcelable {
// This constructor is added to work with the 'com.bluelinelabs.logansquare.annotation.JsonObject'
constructor() : this("", "", null, null)

View file

@ -107,7 +107,9 @@ data class Participant(
} else {
ActorType.GUESTS
}
} else actorType!!
} else {
actorType!!
}
/**
* actorId is only guaranteed in APIv3+ so use calculatedActorId.
@ -115,7 +117,9 @@ data class Participant(
val calculatedActorId: String?
get() = if (actorId == null) {
userId
} else actorId
} else {
actorId
}
enum class ActorType {
DUMMY, EMAILS, GROUPS, GUESTS, USERS, CIRCLES

View file

@ -42,7 +42,7 @@ data class UnifiedSearchEntry(
@JsonField(name = ["rounded"])
var rounded: Boolean?,
@JsonField(name = ["attributes"])
var attributes: Map<String, String>?,
var attributes: Map<String, String>?
) : Parcelable {
constructor() : this(null, null, null, null, null, null, null)
}

View file

@ -44,7 +44,6 @@ class PollCreateOptionViewHolder(
position: Int,
focus: Boolean
) {
textListener?.let {
binding.pollOptionTextEdit.removeTextChangedListener(it)
}

View file

@ -42,21 +42,24 @@ class PollResultsAdapter(
when (viewType) {
PollResultHeaderItem.VIEW_TYPE -> {
val itemBinding = PollResultHeaderItemBinding.inflate(
LayoutInflater.from(parent.context), parent,
LayoutInflater.from(parent.context),
parent,
false
)
viewHolder = PollResultHeaderViewHolder(itemBinding, viewThemeUtils)
}
PollResultVoterItem.VIEW_TYPE -> {
val itemBinding = PollResultVoterItemBinding.inflate(
LayoutInflater.from(parent.context), parent,
LayoutInflater.from(parent.context),
parent,
false
)
viewHolder = PollResultVoterViewHolder(user, itemBinding, viewThemeUtils)
}
PollResultVotersOverviewItem.VIEW_TYPE -> {
val itemBinding = PollResultVotersOverviewItemBinding.inflate(
LayoutInflater.from(parent.context), parent,
LayoutInflater.from(parent.context),
parent,
false
)
viewHolder = PollResultVotersOverviewViewHolder(user, itemBinding)

View file

@ -44,8 +44,7 @@ class PollRepositoryImpl(private val ncApi: NcApi, private val currentUserProvid
question: String,
options: List<String>,
resultMode: Int,
maxVotes:
Int
maxVotes: Int
): Observable<Poll> {
return ncApi.createPoll(
credentials,
@ -61,19 +60,17 @@ class PollRepositoryImpl(private val ncApi: NcApi, private val currentUserProvid
}
override fun getPoll(roomToken: String, pollId: String): Observable<Poll> {
return ncApi.getPoll(
credentials,
ApiUtils.getUrlForPoll(
currentUser.baseUrl,
roomToken,
pollId
),
)
).map { mapToPoll(it.ocs?.data!!) }
}
override fun vote(roomToken: String, pollId: String, options: List<Int>): Observable<Poll> {
return ncApi.votePoll(
credentials,
ApiUtils.getUrlForPoll(
@ -86,14 +83,13 @@ class PollRepositoryImpl(private val ncApi: NcApi, private val currentUserProvid
}
override fun closePoll(roomToken: String, pollId: String): Observable<Poll> {
return ncApi.closePoll(
credentials,
ApiUtils.getUrlForPoll(
currentUser.baseUrl,
roomToken,
pollId
),
)
).map { mapToPoll(it.ocs?.data!!) }
}

View file

@ -37,7 +37,7 @@ data class PollDetailsResponse(
var actorDisplayName: String,
@JsonField(name = ["optionId"])
var optionId: Int,
var optionId: Int
) : Parcelable {
// This constructor is added to work with the 'com.bluelinelabs.logansquare.annotation.JsonObject'
constructor() : this(null, "", "", 0)

View file

@ -64,7 +64,7 @@ data class PollResponse(
var numVoters: Int = 0,
@JsonField(name = ["details"])
var details: ArrayList<PollDetailsResponse>? = null,
var details: ArrayList<PollDetailsResponse>? = null
) : Parcelable {
// This constructor is added to work with the 'com.bluelinelabs.logansquare.annotation.JsonObject'
constructor() : this("id", null, null, null, null, null, null, 0, 0, 0, null, 0, null)

View file

@ -67,9 +67,8 @@ class PollLoadingFragment : Fragment() {
fun newInstance(
fragmentHeight: Int
): PollLoadingFragment {
val args = bundleOf(
KEY_FRAGMENT_HEIGHT to fragmentHeight,
KEY_FRAGMENT_HEIGHT to fragmentHeight
)
val fragment = PollLoadingFragment()

View file

@ -182,7 +182,6 @@ class PollMainDialogFragment : DialogFragment() {
pollId: String,
name: String
): PollMainDialogFragment {
val args = bundleOf(
KEY_USER_ENTITY to user,
KEY_ROOM_TOKEN to roomTokenParam,

View file

@ -117,7 +117,10 @@ class PollCreateViewModel @Inject constructor(private val repository: PollReposi
_viewState.value = PollCreationState(enableAddOptionButton = false, enableCreatePollButton = false)
repository.createPoll(
roomToken, _question, _options.value!!.map { it.pollOption }, resultMode,
roomToken,
_question,
_options.value!!.map { it.pollOption },
resultMode,
maxVotes
)
.doOnSubscribe { disposable = it }

View file

@ -28,7 +28,6 @@ import com.nextcloud.talk.utils.NotificationUtils
class PackageReplacedReceiver : BroadcastReceiver() {
override fun onReceive(context: Context, intent: Intent?) {
if (intent != null && intent.action != null &&
intent.action == "android.intent.action.MY_PACKAGE_REPLACED"
) {

View file

@ -32,7 +32,7 @@ abstract class RemoteFileBrowserItemsViewHolder(
open val binding: ViewBinding,
val mimeTypeSelectionFilter: String? = null,
val currentUser: User,
val selectionInterface: SelectionInterface,
val selectionInterface: SelectionInterface
) : RecyclerView.ViewHolder(binding.root) {
abstract val fileIcon: ImageView

View file

@ -41,7 +41,6 @@ class ConversationsRepositoryImpl(private val api: NcApi, private val userProvid
get() = ApiUtils.getCredentials(user.username, user.token)
override fun allowGuests(token: String, allow: Boolean): Observable<AllowGuestsResult> {
val url = ApiUtils.getUrlForRoomPublic(
apiVersion(),
user.baseUrl,
@ -74,7 +73,6 @@ class ConversationsRepositoryImpl(private val api: NcApi, private val userProvid
password
)
return apiObservable.map {
val passwordPolicyMessage = if (it.code() == STATUS_CODE_BAD_REQUEST) {
LoganSquare.parse(it.errorBody()!!.string(), PasswordOverall::class.java).ocs!!.data!!
.message!!
@ -87,7 +85,6 @@ class ConversationsRepositoryImpl(private val api: NcApi, private val userProvid
}
override fun resendInvitations(token: String): Observable<ResendInvitationsResult> {
val apiObservable = api.resendParticipantInvitations(
credentials,
ApiUtils.getUrlForParticipantsResendInvitations(

View file

@ -56,7 +56,6 @@ class ProfileBottomSheet(val ncApi: NcApi, val userModel: User, val router: Rout
private val allowedAppIds = listOf(SPREED.stringValue, PROFILE.stringValue, EMAIL.stringValue)
fun showFor(user: String, context: Context) {
ncApi.hoverCard(
ApiUtils.getCredentials(userModel.username, userModel.token),
ApiUtils.getUrlForHoverCard(userModel.baseUrl, user)
@ -87,7 +86,6 @@ class ProfileBottomSheet(val ncApi: NcApi, val userModel: User, val router: Rout
@SuppressLint("CheckResult")
private fun bottomSheet(actions: List<HoverCardAction>, displayName: String, userId: String, context: Context) {
val filteredActions = actions.filter { allowedAppIds.contains(it.appId) }
val items = filteredActions.map { configureActionListItem(it) }
@ -109,7 +107,6 @@ class ProfileBottomSheet(val ncApi: NcApi, val userModel: User, val router: Rout
}
private fun configureActionListItem(action: HoverCardAction): BasicListItemWithImage {
val drawable = when (AllowedAppIds.createFor(action)) {
PROFILE -> R.drawable.ic_user
EMAIL -> R.drawable.ic_email
@ -123,7 +120,6 @@ class ProfileBottomSheet(val ncApi: NcApi, val userModel: User, val router: Rout
}
private fun talkTo(userId: String) {
val apiVersion =
ApiUtils.getConversationApiVersion(userModel, intArrayOf(ApiUtils.APIv4, 1))
val retrofitBucket = ApiUtils.getRetrofitBucketForCreateRoom(
@ -137,7 +133,8 @@ class ProfileBottomSheet(val ncApi: NcApi, val userModel: User, val router: Rout
val credentials = ApiUtils.getCredentials(userModel.username, userModel.token)
ncApi.createRoom(
credentials,
retrofitBucket.url, retrofitBucket.queryMap
retrofitBucket.url,
retrofitBucket.queryMap
)
.subscribeOn(Schedulers.io())
.observeOn(AndroidSchedulers.mainThread())
@ -156,7 +153,8 @@ class ProfileBottomSheet(val ncApi: NcApi, val userModel: User, val router: Rout
ncApi.getRoom(
credentials,
ApiUtils.getUrlForRoom(
apiVersion, userModel.baseUrl,
apiVersion,
userModel.baseUrl,
roomOverall.ocs!!.data!!.token
)
)
@ -173,8 +171,11 @@ class ProfileBottomSheet(val ncApi: NcApi, val userModel: User, val router: Rout
Parcels.wrap(roomOverall.ocs!!.data)
)
ConductorRemapping.remapChatController(
router, userModel.id!!,
roomOverall.ocs!!.data!!.token!!, bundle, true
router,
userModel.id!!,
roomOverall.ocs!!.data!!.token!!,
bundle,
true
)
}

View file

@ -66,6 +66,7 @@ class ChooseAccountShareToDialogFragment : DialogFragment() {
private var dialogView: View? = null
private var adapter: FlexibleAdapter<AdvancedUserItem>? = null
private val userItems: MutableList<AdvancedUserItem> = ArrayList()
@SuppressLint("InflateParams")
override fun onCreateDialog(savedInstanceState: Bundle?): Dialog {
binding = DialogChooseAccountShareToBinding.inflate(LayoutInflater.from(requireContext()))

View file

@ -343,7 +343,9 @@ class ShowReactionsDialog(
}
return if (obj2 == null) {
1
} else obj1.lowercase().compareTo(obj2.lowercase())
} else {
obj1.lowercase().compareTo(obj2.lowercase())
}
}
}
@ -358,7 +360,9 @@ class ShowReactionsDialog(
}
return if (obj2 == null) {
1
} else obj1.compareTo(obj2)
} else {
obj1.compareTo(obj2)
}
}
}
}

View file

@ -119,7 +119,7 @@ class ChunkedFileUploader(
private fun createFolder(davResource: DavResource) {
try {
davResource.mkCol(
xmlBody = null,
xmlBody = null
) { response: Response ->
if (!response.isSuccessful) {
throw IOException("failed to create folder. response code: " + response.code)
@ -270,10 +270,12 @@ class ChunkedFileUploader(
}
}
} finally {
if (channel != null) try {
channel.close()
} catch (e: IOException) {
Log.e(TAG, "Error closing file channel!", e)
if (channel != null) {
try {
channel.close()
} catch (e: IOException) {
Log.e(TAG, "Error closing file channel!", e)
}
}
if (raf != null) {
try {
@ -305,7 +307,6 @@ class ChunkedFileUploader(
}
private fun assembleChunks(uploadFolderUri: String, targetPath: String) {
val destinationUri: String = ApiUtils.getUrlForFileUpload(
currentUser.baseUrl,
currentUser.userId,

View file

@ -45,7 +45,7 @@ class DateUtils(val context: Context) {
} else {
@Suppress("DEPRECATION")
context.resources.configuration.locale
},
}
)
/* date formatter in local timezone and locale */
@ -56,7 +56,7 @@ class DateUtils(val context: Context) {
} else {
@Suppress("DEPRECATION")
context.resources.configuration.locale
},
}
)
init {

View file

@ -40,7 +40,6 @@ object DoNotDisturbUtils {
@SuppressLint("NewApi")
@JvmOverloads
fun shouldPlaySound(context: Context? = NextcloudTalkApplication.sharedApplication?.applicationContext): Boolean {
val notificationManager = context?.getSystemService(Context.NOTIFICATION_SERVICE) as NotificationManager
val audioManager = context.getSystemService(Context.AUDIO_SERVICE) as AudioManager

View file

@ -47,7 +47,7 @@ open class FileSortOrder(var name: String, var isAscending: Boolean) {
sort_old_to_new.name to sort_old_to_new,
sort_new_to_old.name to sort_new_to_old,
sort_small_to_big.name to sort_small_to_big,
sort_big_to_small.name to sort_big_to_small,
sort_big_to_small.name to sort_big_to_small
)
fun getFileSortOrder(key: String?): FileSortOrder {

View file

@ -48,7 +48,6 @@ class ImageEmojiEditText : EmojiEditText {
@Suppress("Detekt.TooGenericExceptionCaught")
override fun onCreateInputConnection(editorInfo: EditorInfo): InputConnection? {
val ic: InputConnection? = super.onCreateInputConnection(editorInfo)
EditorInfoCompat.setContentMimeTypes(editorInfo, arrayOf(IMAGE_GIF, IMAGE_JPEG, IMAGE_PNG))

View file

@ -74,7 +74,6 @@ object NotificationUtils {
sound: Uri?,
audioAttributes: AudioAttributes?
) {
val notificationManager = context.getSystemService(Context.NOTIFICATION_SERVICE) as NotificationManager
if (
@ -278,7 +277,6 @@ object NotificationUtils {
context: Context?,
notificationId: Int
): Boolean {
var isVisible = false
val notificationManager = context!!.getSystemService(Context.NOTIFICATION_SERVICE) as NotificationManager
@ -326,7 +324,8 @@ object NotificationUtils {
return getRingtoneUri(
context,
appPreferences.callRingtoneUri,
DEFAULT_CALL_RINGTONE_URI, NotificationChannels.NOTIFICATION_CHANNEL_CALLS_V4.name
DEFAULT_CALL_RINGTONE_URI,
NotificationChannels.NOTIFICATION_CHANNEL_CALLS_V4.name
)
}
@ -337,7 +336,8 @@ object NotificationUtils {
return getRingtoneUri(
context,
appPreferences.messageRingtoneUri,
DEFAULT_MESSAGE_RINGTONE_URI, NotificationChannels.NOTIFICATION_CHANNEL_MESSAGES_V4.name
DEFAULT_MESSAGE_RINGTONE_URI,
NotificationChannels.NOTIFICATION_CHANNEL_MESSAGES_V4.name
)
}

View file

@ -40,7 +40,7 @@ object RemoteFileUtils {
val fileExists = doesFileExist(
ncApi,
currentUser,
remotePath,
remotePath
).blockingFirst()
if (fileExists) {

View file

@ -63,36 +63,41 @@ class SSLSocketFactoryCompat(
override fun createSocket(s: Socket, host: String, port: Int, autoClose: Boolean): Socket {
val ssl = delegate.createSocket(s, host, port, autoClose)
if (ssl is SSLSocket)
if (ssl is SSLSocket) {
upgradeTLS(ssl)
}
return ssl
}
override fun createSocket(host: String, port: Int): Socket {
val ssl = delegate.createSocket(host, port)
if (ssl is SSLSocket)
if (ssl is SSLSocket) {
upgradeTLS(ssl)
}
return ssl
}
override fun createSocket(host: String, port: Int, localHost: InetAddress, localPort: Int): Socket {
val ssl = delegate.createSocket(host, port, localHost, localPort)
if (ssl is SSLSocket)
if (ssl is SSLSocket) {
upgradeTLS(ssl)
}
return ssl
}
override fun createSocket(host: InetAddress, port: Int): Socket {
val ssl = delegate.createSocket(host, port)
if (ssl is SSLSocket)
if (ssl is SSLSocket) {
upgradeTLS(ssl)
}
return ssl
}
override fun createSocket(address: InetAddress, port: Int, localAddress: InetAddress, localPort: Int): Socket {
val ssl = delegate.createSocket(address, port, localAddress, localPort)
if (ssl is SSLSocket)
if (ssl is SSLSocket) {
upgradeTLS(ssl)
}
return ssl
}

View file

@ -31,7 +31,6 @@ class ParticipantPermissionsTest : TestCase() {
@Test
fun test_areFlagsSet() {
val user = User()
val conversation = Conversation()
conversation.permissions = ParticipantPermissions.PUBLISH_SCREEN or

View file

@ -68,7 +68,8 @@ class ShareUtilsTest {
fun stringForIntent_noPasswordGiven_correctStringWithoutPasswordReturned() {
val expectedResult = String.format(
"Join the conversation at %s/index.php/call/%s",
baseUrl, token
baseUrl,
token
)
Assert.assertEquals(
"Intent string was not as expected",