Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
A
AloqaIM-Android
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Administrator
AloqaIM-Android
Commits
33c1802f
Commit
33c1802f
authored
Nov 16, 2017
by
Leonardo Aramaki
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Pack of fixes for crashes on last versions released on Beta
parent
07e15c9e
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
61 additions
and
28 deletions
+61
-28
RocketChatApplication.java
.../main/java/chat/rocket/android/RocketChatApplication.java
+44
-25
RoomFileListAdapter.kt
...android/layouthelper/chatroom/list/RoomFileListAdapter.kt
+13
-2
PushManager.kt
app/src/main/java/chat/rocket/android/push/PushManager.kt
+4
-1
No files found.
app/src/main/java/chat/rocket/android/RocketChatApplication.java
View file @
33c1802f
...
...
@@ -4,17 +4,23 @@ import android.os.Build;
import
android.support.multidex.MultiDexApplication
;
import
android.support.v7.app.AppCompatDelegate
;
import
chat.rocket.android.helper.OkHttpHelper
;
import
com.crashlytics.android.Crashlytics
;
import
chat.rocket.android_ddp.DDPClient
;
import
io.fabric.sdk.android.Fabric
;
import
java.util.List
;
import
chat.rocket.persistence.realm.RealmStore
;
import
java.util.concurrent.TimeoutException
;
import
chat.rocket.android.helper.Logger
;
import
chat.rocket.android.helper.OkHttpHelper
;
import
chat.rocket.android.log.RCLog
;
import
chat.rocket.android.service.ConnectivityManager
;
import
chat.rocket.core.models.ServerInfo
;
import
chat.rocket.android.widget.RocketChatWidgets
;
import
chat.rocket.android_ddp.DDPClient
;
import
chat.rocket.core.models.ServerInfo
;
import
chat.rocket.persistence.realm.RealmStore
;
import
chat.rocket.persistence.realm.RocketChatPersistenceRealm
;
import
io.fabric.sdk.android.Fabric
;
import
io.reactivex.exceptions.UndeliverableException
;
import
io.reactivex.plugins.RxJavaPlugins
;
/**
* Customized Application-class for Rocket.Chat
...
...
@@ -46,6 +52,19 @@ public class RocketChatApplication extends MultiDexApplication {
AppCompatDelegate
.
setCompatVectorFromResourcesEnabled
(
true
);
}
RxJavaPlugins
.
setErrorHandler
(
e
->
{
if
(
e
instanceof
UndeliverableException
)
{
e
=
e
.
getCause
();
}
if
(
e
instanceof
TimeoutException
)
{
// Some work timed-out after a server change is most probable.
return
;
}
Thread
.
currentThread
().
getUncaughtExceptionHandler
()
.
uncaughtException
(
Thread
.
currentThread
(),
e
);
});
instance
=
this
;
}
}
\ No newline at end of file
app/src/main/java/chat/rocket/android/layouthelper/chatroom/list/RoomFileListAdapter.kt
View file @
33c1802f
...
...
@@ -7,10 +7,13 @@ import android.view.ViewGroup
import
android.widget.TextView
import
chat.rocket.android.R
import
chat.rocket.android.helper.DateTime
import
chat.rocket.android.helper.Logger
import
chat.rocket.android.log.RCLog
import
chat.rocket.android.widget.message.RocketChatMessageAttachmentsLayout
import
chat.rocket.core.models.Attachment
import
kotlinx.android.synthetic.main.day.view.*
import
kotlinx.android.synthetic.main.item_room_file.view.*
import
java.lang.IllegalArgumentException
import
java.sql.Timestamp
/**
...
...
@@ -26,8 +29,16 @@ class RoomFileListAdapter(private var dataSet: List<Attachment>) : RecyclerView.
override
fun
onBindViewHolder
(
holder
:
ViewHolder
,
position
:
Int
)
{
val
attachment
=
dataSet
[
position
]
holder
.
newDay
.
text
=
DateTime
.
fromEpocMs
(
Timestamp
.
valueOf
(
attachment
.
timestamp
).
time
,
DateTime
.
Format
.
DATE
)
val
timestamp
:
Timestamp
?
try
{
timestamp
=
Timestamp
.
valueOf
(
attachment
.
timestamp
)
// If we don't have a timestamp we can parse let's be safe and stop here.
holder
.
newDay
.
text
=
DateTime
.
fromEpocMs
(
timestamp
.
time
,
DateTime
.
Format
.
DATE
)
holder
.
attachment
.
appendAttachmentView
(
attachment
,
true
,
false
)
}
catch
(
e
:
IllegalArgumentException
)
{
RCLog
.
e
(
e
)
Logger
.
report
(
e
)
}
}
override
fun
getItemCount
():
Int
=
dataSet
.
size
...
...
app/src/main/java/chat/rocket/android/push/PushManager.kt
View file @
33c1802f
...
...
@@ -105,7 +105,10 @@ object PushManager {
}
}
fun
clearNotificationsByHostAndNotificationId
(
host
:
String
,
notificationId
:
Int
)
{
fun
clearNotificationsByHostAndNotificationId
(
host
:
String
?,
notificationId
:
Int
?)
{
if
(
host
==
null
||
notificationId
==
null
)
{
return
}
if
(
hostToPushMessageList
.
isNotEmpty
())
{
val
notifications
=
hostToPushMessageList
[
host
]
notifications
?.
let
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment