Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
A
apk
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
apk
Commits
f92df091
Commit
f92df091
authored
Jul 23, 2014
by
DrKLO
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Bug fixes
parent
e2a6511f
Changes
10
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
87 additions
and
68 deletions
+87
-68
build.gradle
TMessagesProj/build.gradle
+2
-2
MessagesController.java
...rc/main/java/org/telegram/android/MessagesController.java
+12
-7
MessagesStorage.java
...j/src/main/java/org/telegram/android/MessagesStorage.java
+9
-1
NotificationsController.java
...in/java/org/telegram/android/NotificationsController.java
+33
-26
FileLoader.java
...Proj/src/main/java/org/telegram/messenger/FileLoader.java
+6
-1
LaunchActivity.java
...gesProj/src/main/java/org/telegram/ui/LaunchActivity.java
+8
-26
LoginActivityRegisterView.java
.../main/java/org/telegram/ui/LoginActivityRegisterView.java
+1
-1
LoginActivitySmsView.java
...j/src/main/java/org/telegram/ui/LoginActivitySmsView.java
+1
-1
PhotoViewer.java
TMessagesProj/src/main/java/org/telegram/ui/PhotoViewer.java
+14
-2
SettingsActivity.java
...sProj/src/main/java/org/telegram/ui/SettingsActivity.java
+1
-1
No files found.
TMessagesProj/build.gradle
View file @
f92df091
...
@@ -83,7 +83,7 @@ android {
...
@@ -83,7 +83,7 @@ android {
defaultConfig
{
defaultConfig
{
minSdkVersion
8
minSdkVersion
8
targetSdkVersion
19
targetSdkVersion
19
versionCode
28
8
versionCode
28
9
versionName
"1.6.
1
"
versionName
"1.6.
2
"
}
}
}
}
TMessagesProj/src/main/java/org/telegram/android/MessagesController.java
View file @
f92df091
...
@@ -927,7 +927,7 @@ public class MessagesController implements NotificationCenter.NotificationCenter
...
@@ -927,7 +927,7 @@ public class MessagesController implements NotificationCenter.NotificationCenter
if
(
updatesStartWaitTime
!=
0
&&
updatesStartWaitTime
+
1500
<
currentTime
)
{
if
(
updatesStartWaitTime
!=
0
&&
updatesStartWaitTime
+
1500
<
currentTime
)
{
FileLog
.
e
(
"tmessages"
,
"UPDATES WAIT TIMEOUT - CHECK QUEUE"
);
FileLog
.
e
(
"tmessages"
,
"UPDATES WAIT TIMEOUT - CHECK QUEUE"
);
processUpdatesQueue
(
false
);
processUpdatesQueue
(
0
);
}
}
}
}
if
(!
printingUsers
.
isEmpty
()
||
lastPrintingStringCount
!=
printingUsers
.
size
())
{
if
(!
printingUsers
.
isEmpty
()
||
lastPrintingStringCount
!=
printingUsers
.
size
())
{
...
@@ -3197,6 +3197,7 @@ public class MessagesController implements NotificationCenter.NotificationCenter
...
@@ -3197,6 +3197,7 @@ public class MessagesController implements NotificationCenter.NotificationCenter
MessagesStorage
.
lastPtsValue
=
res
.
pts
;
MessagesStorage
.
lastPtsValue
=
res
.
pts
;
MessagesStorage
.
lastSeqValue
=
res
.
seq
;
MessagesStorage
.
lastSeqValue
=
res
.
seq
;
MessagesStorage
.
lastQtsValue
=
res
.
qts
;
MessagesStorage
.
lastQtsValue
=
res
.
qts
;
processUpdatesQueue
(
2
);
MessagesStorage
.
getInstance
().
saveDiffParams
(
MessagesStorage
.
lastSeqValue
,
MessagesStorage
.
lastPtsValue
,
MessagesStorage
.
lastDateValue
,
MessagesStorage
.
lastQtsValue
);
MessagesStorage
.
getInstance
().
saveDiffParams
(
MessagesStorage
.
lastSeqValue
,
MessagesStorage
.
lastPtsValue
,
MessagesStorage
.
lastDateValue
,
MessagesStorage
.
lastQtsValue
);
}
else
{
}
else
{
if
(
error
.
code
!=
401
)
{
if
(
error
.
code
!=
401
)
{
...
@@ -3215,7 +3216,7 @@ public class MessagesController implements NotificationCenter.NotificationCenter
...
@@ -3215,7 +3216,7 @@ public class MessagesController implements NotificationCenter.NotificationCenter
}
}
}
}
private
void
processUpdatesQueue
(
boolean
getDifferenc
e
)
{
private
void
processUpdatesQueue
(
int
stat
e
)
{
if
(!
updatesQueue
.
isEmpty
())
{
if
(!
updatesQueue
.
isEmpty
())
{
Collections
.
sort
(
updatesQueue
,
new
Comparator
<
TLRPC
.
Updates
>()
{
Collections
.
sort
(
updatesQueue
,
new
Comparator
<
TLRPC
.
Updates
>()
{
@Override
@Override
...
@@ -3231,6 +3232,10 @@ public class MessagesController implements NotificationCenter.NotificationCenter
...
@@ -3231,6 +3232,10 @@ public class MessagesController implements NotificationCenter.NotificationCenter
}
}
});
});
boolean
anyProceed
=
false
;
boolean
anyProceed
=
false
;
if
(
state
==
2
)
{
TLRPC
.
Updates
updates
=
updatesQueue
.
get
(
0
);
MessagesStorage
.
lastSeqValue
=
getUpdateSeq
(
updates
);
}
for
(
int
a
=
0
;
a
<
updatesQueue
.
size
();
a
++)
{
for
(
int
a
=
0
;
a
<
updatesQueue
.
size
();
a
++)
{
TLRPC
.
Updates
updates
=
updatesQueue
.
get
(
a
);
TLRPC
.
Updates
updates
=
updatesQueue
.
get
(
a
);
int
seq
=
getUpdateSeq
(
updates
);
int
seq
=
getUpdateSeq
(
updates
);
...
@@ -3261,7 +3266,7 @@ public class MessagesController implements NotificationCenter.NotificationCenter
...
@@ -3261,7 +3266,7 @@ public class MessagesController implements NotificationCenter.NotificationCenter
updatesQueue
.
clear
();
updatesQueue
.
clear
();
FileLog
.
e
(
"tmessages"
,
"UPDATES QUEUE PROCEED - OK"
);
FileLog
.
e
(
"tmessages"
,
"UPDATES QUEUE PROCEED - OK"
);
updatesStartWaitTime
=
0
;
updatesStartWaitTime
=
0
;
if
(
getDifference
)
{
if
(
state
==
1
)
{
final
int
stateCopy
=
ConnectionsManager
.
getInstance
().
getConnectionState
();
final
int
stateCopy
=
ConnectionsManager
.
getInstance
().
getConnectionState
();
Utilities
.
RunOnUIThread
(
new
Runnable
()
{
Utilities
.
RunOnUIThread
(
new
Runnable
()
{
@Override
@Override
...
@@ -3271,7 +3276,7 @@ public class MessagesController implements NotificationCenter.NotificationCenter
...
@@ -3271,7 +3276,7 @@ public class MessagesController implements NotificationCenter.NotificationCenter
});
});
}
}
}
else
{
}
else
{
if
(
getDifference
)
{
if
(
state
==
1
)
{
final
int
stateCopy
=
ConnectionsManager
.
getInstance
().
getConnectionState
();
final
int
stateCopy
=
ConnectionsManager
.
getInstance
().
getConnectionState
();
Utilities
.
RunOnUIThread
(
new
Runnable
()
{
Utilities
.
RunOnUIThread
(
new
Runnable
()
{
@Override
@Override
...
@@ -3469,7 +3474,7 @@ public class MessagesController implements NotificationCenter.NotificationCenter
...
@@ -3469,7 +3474,7 @@ public class MessagesController implements NotificationCenter.NotificationCenter
MessagesStorage
.
lastPtsValue
=
res
.
state
.
pts
;
MessagesStorage
.
lastPtsValue
=
res
.
state
.
pts
;
MessagesStorage
.
lastQtsValue
=
res
.
state
.
qts
;
MessagesStorage
.
lastQtsValue
=
res
.
state
.
qts
;
ConnectionsManager
.
getInstance
().
setConnectionState
(
0
);
ConnectionsManager
.
getInstance
().
setConnectionState
(
0
);
processUpdatesQueue
(
true
);
processUpdatesQueue
(
1
);
}
else
if
(
res
instanceof
TLRPC
.
TL_updates_differenceSlice
)
{
}
else
if
(
res
instanceof
TLRPC
.
TL_updates_differenceSlice
)
{
MessagesStorage
.
lastDateValue
=
res
.
intermediate_state
.
date
;
MessagesStorage
.
lastDateValue
=
res
.
intermediate_state
.
date
;
MessagesStorage
.
lastPtsValue
=
res
.
intermediate_state
.
pts
;
MessagesStorage
.
lastPtsValue
=
res
.
intermediate_state
.
pts
;
...
@@ -3480,7 +3485,7 @@ public class MessagesController implements NotificationCenter.NotificationCenter
...
@@ -3480,7 +3485,7 @@ public class MessagesController implements NotificationCenter.NotificationCenter
MessagesStorage
.
lastSeqValue
=
res
.
seq
;
MessagesStorage
.
lastSeqValue
=
res
.
seq
;
MessagesStorage
.
lastDateValue
=
res
.
date
;
MessagesStorage
.
lastDateValue
=
res
.
date
;
ConnectionsManager
.
getInstance
().
setConnectionState
(
0
);
ConnectionsManager
.
getInstance
().
setConnectionState
(
0
);
processUpdatesQueue
(
true
);
processUpdatesQueue
(
1
);
}
}
MessagesStorage
.
getInstance
().
saveDiffParams
(
MessagesStorage
.
lastSeqValue
,
MessagesStorage
.
lastPtsValue
,
MessagesStorage
.
lastDateValue
,
MessagesStorage
.
lastQtsValue
);
MessagesStorage
.
getInstance
().
saveDiffParams
(
MessagesStorage
.
lastSeqValue
,
MessagesStorage
.
lastPtsValue
,
MessagesStorage
.
lastDateValue
,
MessagesStorage
.
lastQtsValue
);
FileLog
.
e
(
"tmessages"
,
"received difference with date = "
+
MessagesStorage
.
lastDateValue
+
" pts = "
+
MessagesStorage
.
lastPtsValue
+
" seq = "
+
MessagesStorage
.
lastSeqValue
);
FileLog
.
e
(
"tmessages"
,
"received difference with date = "
+
MessagesStorage
.
lastDateValue
+
" pts = "
+
MessagesStorage
.
lastPtsValue
+
" seq = "
+
MessagesStorage
.
lastSeqValue
);
...
@@ -3692,7 +3697,7 @@ public class MessagesController implements NotificationCenter.NotificationCenter
...
@@ -3692,7 +3697,7 @@ public class MessagesController implements NotificationCenter.NotificationCenter
if
(
needGetDiff
&&
!
fromQueue
)
{
if
(
needGetDiff
&&
!
fromQueue
)
{
getDifference
();
getDifference
();
}
else
if
(!
fromQueue
&&
!
updatesQueue
.
isEmpty
())
{
}
else
if
(!
fromQueue
&&
!
updatesQueue
.
isEmpty
())
{
processUpdatesQueue
(
false
);
processUpdatesQueue
(
0
);
}
}
if
(
needReceivedQueue
)
{
if
(
needReceivedQueue
)
{
TLRPC
.
TL_messages_receivedQueue
req
=
new
TLRPC
.
TL_messages_receivedQueue
();
TLRPC
.
TL_messages_receivedQueue
req
=
new
TLRPC
.
TL_messages_receivedQueue
();
...
...
TMessagesProj/src/main/java/org/telegram/android/MessagesStorage.java
View file @
f92df091
...
@@ -191,7 +191,7 @@ public class MessagesStorage {
...
@@ -191,7 +191,7 @@ public class MessagesStorage {
}
}
}
}
public
void
cleanUp
()
{
public
void
cleanUp
(
final
boolean
isLogin
)
{
storageQueue
.
cleanupQueue
();
storageQueue
.
cleanupQueue
();
storageQueue
.
postRunnable
(
new
Runnable
()
{
storageQueue
.
postRunnable
(
new
Runnable
()
{
@Override
@Override
...
@@ -219,6 +219,14 @@ public class MessagesStorage {
...
@@ -219,6 +219,14 @@ public class MessagesStorage {
}
}
storageQueue
.
cleanupQueue
();
storageQueue
.
cleanupQueue
();
openDatabase
();
openDatabase
();
if
(
isLogin
)
{
Utilities
.
stageQueue
.
postRunnable
(
new
Runnable
()
{
@Override
public
void
run
()
{
MessagesController
.
getInstance
().
getDifference
();
}
});
}
}
}
});
});
}
}
...
...
TMessagesProj/src/main/java/org/telegram/android/NotificationsController.java
View file @
f92df091
...
@@ -305,10 +305,12 @@ public class NotificationsController {
...
@@ -305,10 +305,12 @@ public class NotificationsController {
intent
.
setAction
(
"com.tmessages.openchat"
+
Math
.
random
()
+
Integer
.
MAX_VALUE
);
intent
.
setAction
(
"com.tmessages.openchat"
+
Math
.
random
()
+
Integer
.
MAX_VALUE
);
intent
.
setFlags
(
32768
);
intent
.
setFlags
(
32768
);
if
((
int
)
dialog_id
!=
0
)
{
if
((
int
)
dialog_id
!=
0
)
{
if
(
chat_id
!=
0
)
{
if
(
pushDialogs
.
size
()
==
1
)
{
intent
.
putExtra
(
"chatId"
,
chat_id
);
if
(
chat_id
!=
0
)
{
}
else
if
(
user_id
!=
0
)
{
intent
.
putExtra
(
"chatId"
,
chat_id
);
intent
.
putExtra
(
"userId"
,
user_id
);
}
else
if
(
user_id
!=
0
)
{
intent
.
putExtra
(
"userId"
,
user_id
);
}
}
}
if
(
pushDialogs
.
size
()
==
1
)
{
if
(
pushDialogs
.
size
()
==
1
)
{
if
(
chat
!=
null
)
{
if
(
chat
!=
null
)
{
...
@@ -322,7 +324,9 @@ public class NotificationsController {
...
@@ -322,7 +324,9 @@ public class NotificationsController {
}
}
}
}
}
else
{
}
else
{
intent
.
putExtra
(
"encId"
,
(
int
)(
dialog_id
>>
32
));
if
(
pushDialogs
.
size
()
==
1
)
{
intent
.
putExtra
(
"encId"
,
(
int
)
(
dialog_id
>>
32
));
}
}
}
PendingIntent
contentIntent
=
PendingIntent
.
getActivity
(
ApplicationLoader
.
applicationContext
,
0
,
intent
,
PendingIntent
.
FLAG_ONE_SHOT
);
PendingIntent
contentIntent
=
PendingIntent
.
getActivity
(
ApplicationLoader
.
applicationContext
,
0
,
intent
,
PendingIntent
.
FLAG_ONE_SHOT
);
...
@@ -350,7 +354,6 @@ public class NotificationsController {
...
@@ -350,7 +354,6 @@ public class NotificationsController {
.
setContentTitle
(
name
)
.
setContentTitle
(
name
)
.
setSmallIcon
(
R
.
drawable
.
notification
)
.
setSmallIcon
(
R
.
drawable
.
notification
)
.
setAutoCancel
(
true
)
.
setAutoCancel
(
true
)
.
setContentText
(
detailText
)
.
setContentIntent
(
contentIntent
);
.
setContentIntent
(
contentIntent
);
String
lastMessage
=
null
;
String
lastMessage
=
null
;
...
@@ -366,8 +369,10 @@ public class NotificationsController {
...
@@ -366,8 +369,10 @@ public class NotificationsController {
message
=
message
.
replace
(
name
+
": "
,
""
).
replace
(
name
+
" "
,
""
);
message
=
message
.
replace
(
name
+
": "
,
""
).
replace
(
name
+
" "
,
""
);
}
}
}
}
mBuilder
.
setContentText
(
message
);
mBuilder
.
setStyle
(
new
NotificationCompat
.
BigTextStyle
().
bigText
(
message
));
mBuilder
.
setStyle
(
new
NotificationCompat
.
BigTextStyle
().
bigText
(
message
));
}
else
{
}
else
{
mBuilder
.
setContentText
(
detailText
);
NotificationCompat
.
InboxStyle
inboxStyle
=
new
NotificationCompat
.
InboxStyle
();
NotificationCompat
.
InboxStyle
inboxStyle
=
new
NotificationCompat
.
InboxStyle
();
inboxStyle
.
setBigContentTitle
(
name
);
inboxStyle
.
setBigContentTitle
(
name
);
int
count
=
Math
.
min
(
10
,
pushMessages
.
size
());
int
count
=
Math
.
min
(
10
,
pushMessages
.
size
());
...
@@ -417,6 +422,8 @@ public class NotificationsController {
...
@@ -417,6 +422,8 @@ public class NotificationsController {
}
}
if
(
needVibrate
)
{
if
(
needVibrate
)
{
mBuilder
.
setVibrate
(
new
long
[]{
0
,
100
,
0
,
100
});
mBuilder
.
setVibrate
(
new
long
[]{
0
,
100
,
0
,
100
});
}
else
{
mBuilder
.
setVibrate
(
new
long
[]{
0
,
0
});
}
}
}
else
{
}
else
{
mBuilder
.
setVibrate
(
new
long
[]{
0
,
0
});
mBuilder
.
setVibrate
(
new
long
[]{
0
,
0
});
...
@@ -485,7 +492,7 @@ public class NotificationsController {
...
@@ -485,7 +492,7 @@ public class NotificationsController {
remove
=
true
;
remove
=
true
;
}
}
}
else
{
}
else
{
if
(
messageObject
.
messageOwner
.
id
<=
max_id
)
{
if
(
messageObject
.
messageOwner
.
id
<=
max_id
||
max_id
<
0
)
{
remove
=
true
;
remove
=
true
;
}
}
}
}
...
@@ -569,32 +576,32 @@ public class NotificationsController {
...
@@ -569,32 +576,32 @@ public class NotificationsController {
int
notify_override
=
preferences
.
getInt
(
"notify2_"
+
dialog_id
,
0
);
int
notify_override
=
preferences
.
getInt
(
"notify2_"
+
dialog_id
,
0
);
boolean
isChat
=
(
int
)
dialog_id
<
0
;
boolean
isChat
=
(
int
)
dialog_id
<
0
;
Integer
currentCount
=
pushDialogs
.
get
(
dialog_id
);
Integer
currentCount
=
pushDialogs
.
get
(
dialog_id
);
if
(!(
notify_override
==
2
||
(!
preferences
.
getBoolean
(
"EnableAll"
,
true
)
||
isChat
&&
!
preferences
.
getBoolean
(
"EnableGroup"
,
true
))
&&
notify_override
==
0
))
{
boolean
canAddValue
=
!(
notify_override
==
2
||
(!
preferences
.
getBoolean
(
"EnableAll"
,
true
)
||
isChat
&&
!
preferences
.
getBoolean
(
"EnableGroup"
,
true
))
&&
notify_override
==
0
);
Integer
newCount
=
entry
.
getValue
();
if
(
replace
)
{
Integer
newCount
=
entry
.
getValue
();
if
(
currentCount
!=
null
)
{
if
(
replace
)
{
total_unread_count
-=
currentCount
;
if
(
currentCount
!=
null
)
{
}
total_unread_count
-=
currentCount
;
if
(
newCount
==
0
)
{
}
pushDialogs
.
remove
(
dialog_id
);
if
(
newCount
==
0
)
{
}
else
{
pushDialogs
.
remove
(
dialog_id
);
total_unread_count
+=
newCount
;
}
else
if
(
canAddValue
)
{
pushDialogs
.
put
(
dialog_id
,
newCount
);
}
}
else
{
if
(
currentCount
==
null
)
{
currentCount
=
0
;
}
currentCount
+=
newCount
;
total_unread_count
+=
newCount
;
total_unread_count
+=
newCount
;
pushDialogs
.
put
(
dialog_id
,
current
Count
);
pushDialogs
.
put
(
dialog_id
,
new
Count
);
}
}
}
else
if
(
canAddValue
)
{
if
(
currentCount
==
null
)
{
currentCount
=
0
;
}
currentCount
+=
newCount
;
total_unread_count
+=
newCount
;
pushDialogs
.
put
(
dialog_id
,
currentCount
);
}
}
}
}
if
(
old_unread_count
!=
total_unread_count
)
{
if
(
old_unread_count
!=
total_unread_count
)
{
showOrUpdateNotification
(
notifyCheck
);
showOrUpdateNotification
(
notifyCheck
);
notifyCheck
=
false
;
}
}
notifyCheck
=
false
;
if
(
preferences
.
getBoolean
(
"badgeNumber"
,
true
))
{
if
(
preferences
.
getBoolean
(
"badgeNumber"
,
true
))
{
setBadge
(
ApplicationLoader
.
applicationContext
,
total_unread_count
);
setBadge
(
ApplicationLoader
.
applicationContext
,
total_unread_count
);
}
}
...
...
TMessagesProj/src/main/java/org/telegram/messenger/FileLoader.java
View file @
f92df091
...
@@ -1105,8 +1105,13 @@ public class FileLoader {
...
@@ -1105,8 +1105,13 @@ public class FileLoader {
return
null
;
return
null
;
}
}
float
scaleFactor
=
Math
.
max
(
photoW
/
maxWidth
,
photoH
/
maxHeight
);
float
scaleFactor
=
Math
.
max
(
photoW
/
maxWidth
,
photoH
/
maxHeight
);
int
w
=
(
int
)(
photoW
/
scaleFactor
);
int
h
=
(
int
)(
photoH
/
scaleFactor
);
if
(
h
==
0
||
w
==
0
)
{
return
null
;
}
Bitmap
scaledBitmap
=
Bitmap
.
createScaledBitmap
(
bitmap
,
(
int
)(
photoW
/
scaleFactor
),
(
int
)(
photoH
/
scaleFactor
)
,
true
);
Bitmap
scaledBitmap
=
Bitmap
.
createScaledBitmap
(
bitmap
,
h
,
w
,
true
);
TLRPC
.
TL_fileLocation
location
=
new
TLRPC
.
TL_fileLocation
();
TLRPC
.
TL_fileLocation
location
=
new
TLRPC
.
TL_fileLocation
();
location
.
volume_id
=
Integer
.
MIN_VALUE
;
location
.
volume_id
=
Integer
.
MIN_VALUE
;
...
...
TMessagesProj/src/main/java/org/telegram/ui/LaunchActivity.java
View file @
f92df091
...
@@ -85,7 +85,6 @@ public class LaunchActivity extends ActionBarActivity implements NotificationCen
...
@@ -85,7 +85,6 @@ public class LaunchActivity extends ActionBarActivity implements NotificationCen
currentConnectionState
=
ConnectionsManager
.
getInstance
().
getConnectionState
();
currentConnectionState
=
ConnectionsManager
.
getInstance
().
getConnectionState
();
NotificationCenter
.
getInstance
().
addObserver
(
this
,
1234
);
NotificationCenter
.
getInstance
().
addObserver
(
this
,
1234
);
NotificationCenter
.
getInstance
().
addObserver
(
this
,
658
);
NotificationCenter
.
getInstance
().
addObserver
(
this
,
701
);
NotificationCenter
.
getInstance
().
addObserver
(
this
,
701
);
NotificationCenter
.
getInstance
().
addObserver
(
this
,
702
);
NotificationCenter
.
getInstance
().
addObserver
(
this
,
702
);
NotificationCenter
.
getInstance
().
addObserver
(
this
,
703
);
NotificationCenter
.
getInstance
().
addObserver
(
this
,
703
);
...
@@ -149,6 +148,7 @@ public class LaunchActivity extends ActionBarActivity implements NotificationCen
...
@@ -149,6 +148,7 @@ public class LaunchActivity extends ActionBarActivity implements NotificationCen
Integer
push_chat_id
=
0
;
Integer
push_chat_id
=
0
;
Integer
push_enc_id
=
0
;
Integer
push_enc_id
=
0
;
Integer
open_settings
=
0
;
Integer
open_settings
=
0
;
boolean
showDialogsList
=
false
;
photoPathsArray
=
null
;
photoPathsArray
=
null
;
videoPath
=
null
;
videoPath
=
null
;
...
@@ -379,6 +379,8 @@ public class LaunchActivity extends ActionBarActivity implements NotificationCen
...
@@ -379,6 +379,8 @@ public class LaunchActivity extends ActionBarActivity implements NotificationCen
NotificationCenter
.
getInstance
().
postNotificationName
(
MessagesController
.
closeChats
);
NotificationCenter
.
getInstance
().
postNotificationName
(
MessagesController
.
closeChats
);
push_enc_id
=
encId
;
push_enc_id
=
encId
;
}
}
}
else
{
showDialogsList
=
true
;
}
}
}
}
}
}
...
@@ -408,6 +410,11 @@ public class LaunchActivity extends ActionBarActivity implements NotificationCen
...
@@ -408,6 +410,11 @@ public class LaunchActivity extends ActionBarActivity implements NotificationCen
if
(
presentFragment
(
fragment
,
false
,
true
))
{
if
(
presentFragment
(
fragment
,
false
,
true
))
{
pushOpened
=
true
;
pushOpened
=
true
;
}
}
}
else
if
(
showDialogsList
)
{
for
(
int
a
=
1
;
a
<
fragmentsStack
.
size
();
a
++)
{
removeFragmentFromStack
(
fragmentsStack
.
get
(
a
));
a
--;
}
}
}
if
(
videoPath
!=
null
||
photoPathsArray
!=
null
||
sendingText
!=
null
||
documentsPathsArray
!=
null
||
contactsToSend
!=
null
)
{
if
(
videoPath
!=
null
||
photoPathsArray
!=
null
||
sendingText
!=
null
||
documentsPathsArray
!=
null
||
contactsToSend
!=
null
)
{
NotificationCenter
.
getInstance
().
postNotificationName
(
MessagesController
.
closeChats
);
NotificationCenter
.
getInstance
().
postNotificationName
(
MessagesController
.
closeChats
);
...
@@ -522,7 +529,6 @@ public class LaunchActivity extends ActionBarActivity implements NotificationCen
...
@@ -522,7 +529,6 @@ public class LaunchActivity extends ActionBarActivity implements NotificationCen
}
}
finished
=
true
;
finished
=
true
;
NotificationCenter
.
getInstance
().
removeObserver
(
this
,
1234
);
NotificationCenter
.
getInstance
().
removeObserver
(
this
,
1234
);
NotificationCenter
.
getInstance
().
removeObserver
(
this
,
658
);
NotificationCenter
.
getInstance
().
removeObserver
(
this
,
701
);
NotificationCenter
.
getInstance
().
removeObserver
(
this
,
701
);
NotificationCenter
.
getInstance
().
removeObserver
(
this
,
702
);
NotificationCenter
.
getInstance
().
removeObserver
(
this
,
702
);
NotificationCenter
.
getInstance
().
removeObserver
(
this
,
703
);
NotificationCenter
.
getInstance
().
removeObserver
(
this
,
703
);
...
@@ -546,30 +552,6 @@ public class LaunchActivity extends ActionBarActivity implements NotificationCen
...
@@ -546,30 +552,6 @@ public class LaunchActivity extends ActionBarActivity implements NotificationCen
startActivity
(
intent2
);
startActivity
(
intent2
);
onFinish
();
onFinish
();
finish
();
finish
();
}
else
if
(
id
==
658
)
{
if
(
PhotoViewer
.
getInstance
().
isVisible
())
{
PhotoViewer
.
getInstance
().
closePhoto
(
false
);
}
Integer
push_chat_id
=
(
Integer
)
args
[
0
];
Integer
push_user_id
=
(
Integer
)
args
[
1
];
Integer
push_enc_id
=
(
Integer
)
args
[
2
];
if
(
push_user_id
!=
0
)
{
NotificationCenter
.
getInstance
().
postNotificationName
(
MessagesController
.
closeChats
);
Bundle
args2
=
new
Bundle
();
args2
.
putInt
(
"user_id"
,
push_user_id
);
presentFragment
(
new
ChatActivity
(
args2
),
false
,
true
);
}
else
if
(
push_chat_id
!=
0
)
{
NotificationCenter
.
getInstance
().
postNotificationName
(
MessagesController
.
closeChats
);
Bundle
args2
=
new
Bundle
();
args2
.
putInt
(
"chat_id"
,
push_chat_id
);
presentFragment
(
new
ChatActivity
(
args2
),
false
,
true
);
}
else
if
(
push_enc_id
!=
0
)
{
NotificationCenter
.
getInstance
().
postNotificationName
(
MessagesController
.
closeChats
);
Bundle
args2
=
new
Bundle
();
args2
.
putInt
(
"enc_id"
,
push_enc_id
);
presentFragment
(
new
ChatActivity
(
args2
),
false
,
true
);
}
}
else
if
(
id
==
702
)
{
}
else
if
(
id
==
702
)
{
if
(
args
[
0
]
!=
this
)
{
if
(
args
[
0
]
!=
this
)
{
onFinish
();
onFinish
();
...
...
TMessagesProj/src/main/java/org/telegram/ui/LoginActivityRegisterView.java
View file @
f92df091
...
@@ -150,10 +150,10 @@ public class LoginActivityRegisterView extends SlideView {
...
@@ -150,10 +150,10 @@ public class LoginActivityRegisterView extends SlideView {
final
TLRPC
.
TL_auth_authorization
res
=
(
TLRPC
.
TL_auth_authorization
)
response
;
final
TLRPC
.
TL_auth_authorization
res
=
(
TLRPC
.
TL_auth_authorization
)
response
;
TLRPC
.
TL_userSelf
user
=
(
TLRPC
.
TL_userSelf
)
res
.
user
;
TLRPC
.
TL_userSelf
user
=
(
TLRPC
.
TL_userSelf
)
res
.
user
;
UserConfig
.
clearConfig
();
UserConfig
.
clearConfig
();
MessagesStorage
.
getInstance
().
cleanUp
();
MessagesController
.
getInstance
().
cleanUp
();
MessagesController
.
getInstance
().
cleanUp
();
UserConfig
.
setCurrentUser
(
user
);
UserConfig
.
setCurrentUser
(
user
);
UserConfig
.
saveConfig
(
true
);
UserConfig
.
saveConfig
(
true
);
MessagesStorage
.
getInstance
().
cleanUp
(
true
);
ArrayList
<
TLRPC
.
User
>
users
=
new
ArrayList
<
TLRPC
.
User
>();
ArrayList
<
TLRPC
.
User
>
users
=
new
ArrayList
<
TLRPC
.
User
>();
users
.
add
(
user
);
users
.
add
(
user
);
MessagesStorage
.
getInstance
().
putUsersAndChats
(
users
,
null
,
true
,
true
);
MessagesStorage
.
getInstance
().
putUsersAndChats
(
users
,
null
,
true
,
true
);
...
...
TMessagesProj/src/main/java/org/telegram/ui/LoginActivitySmsView.java
View file @
f92df091
...
@@ -260,10 +260,10 @@ public class LoginActivitySmsView extends SlideView implements NotificationCente
...
@@ -260,10 +260,10 @@ public class LoginActivitySmsView extends SlideView implements NotificationCente
TLRPC
.
TL_auth_authorization
res
=
(
TLRPC
.
TL_auth_authorization
)
response
;
TLRPC
.
TL_auth_authorization
res
=
(
TLRPC
.
TL_auth_authorization
)
response
;
destroyTimer
();
destroyTimer
();
UserConfig
.
clearConfig
();
UserConfig
.
clearConfig
();
MessagesStorage
.
getInstance
().
cleanUp
();
MessagesController
.
getInstance
().
cleanUp
();
MessagesController
.
getInstance
().
cleanUp
();
UserConfig
.
setCurrentUser
(
res
.
user
);
UserConfig
.
setCurrentUser
(
res
.
user
);
UserConfig
.
saveConfig
(
true
);
UserConfig
.
saveConfig
(
true
);
MessagesStorage
.
getInstance
().
cleanUp
(
true
);
ArrayList
<
TLRPC
.
User
>
users
=
new
ArrayList
<
TLRPC
.
User
>();
ArrayList
<
TLRPC
.
User
>
users
=
new
ArrayList
<
TLRPC
.
User
>();
users
.
add
(
res
.
user
);
users
.
add
(
res
.
user
);
MessagesStorage
.
getInstance
().
putUsersAndChats
(
users
,
null
,
true
,
true
);
MessagesStorage
.
getInstance
().
putUsersAndChats
(
users
,
null
,
true
,
true
);
...
...
TMessagesProj/src/main/java/org/telegram/ui/PhotoViewer.java
View file @
f92df091
...
@@ -413,6 +413,9 @@ public class PhotoViewer implements NotificationCenter.NotificationCenterDelegat
...
@@ -413,6 +413,9 @@ public class PhotoViewer implements NotificationCenter.NotificationCenterDelegat
imagesByIdsTemp
.
clear
();
imagesByIdsTemp
.
clear
();
needSearchImageInArr
=
false
;
needSearchImageInArr
=
false
;
currentIndex
=
-
1
;
currentIndex
=
-
1
;
if
(
foundIndex
>=
imagesArr
.
size
())
{
foundIndex
=
imagesArr
.
size
()
-
1
;
}
setImageIndex
(
foundIndex
,
true
);
setImageIndex
(
foundIndex
,
true
);
}
else
{
}
else
{
if
(!
cacheEndReached
||
!
arr
.
isEmpty
()
&&
added
!=
0
)
{
if
(!
cacheEndReached
||
!
arr
.
isEmpty
()
&&
added
!=
0
)
{
...
@@ -1384,6 +1387,15 @@ public class PhotoViewer implements NotificationCenter.NotificationCenterDelegat
...
@@ -1384,6 +1387,15 @@ public class PhotoViewer implements NotificationCenter.NotificationCenterDelegat
NotificationCenter
.
getInstance
().
addObserver
(
this
,
MessagesController
.
mediaDidLoaded
);
NotificationCenter
.
getInstance
().
addObserver
(
this
,
MessagesController
.
mediaDidLoaded
);
NotificationCenter
.
getInstance
().
addObserver
(
this
,
MessagesController
.
userPhotosLoaded
);
NotificationCenter
.
getInstance
().
addObserver
(
this
,
MessagesController
.
userPhotosLoaded
);
try
{
if
(
windowView
.
getParent
()
!=
null
)
{
WindowManager
wm
=
(
WindowManager
)
parentActivity
.
getSystemService
(
Context
.
WINDOW_SERVICE
);
wm
.
removeView
(
windowView
);
}
}
catch
(
Exception
e
)
{
FileLog
.
e
(
"tmessages"
,
e
);
}
placeProvider
=
provider
;
placeProvider
=
provider
;
WindowManager
wm
=
(
WindowManager
)
parentActivity
.
getSystemService
(
Context
.
WINDOW_SERVICE
);
WindowManager
wm
=
(
WindowManager
)
parentActivity
.
getSystemService
(
Context
.
WINDOW_SERVICE
);
wm
.
addView
(
windowView
,
windowLayoutParams
);
wm
.
addView
(
windowView
,
windowLayoutParams
);
...
@@ -1702,8 +1714,8 @@ public class PhotoViewer implements NotificationCenter.NotificationCenterDelegat
...
@@ -1702,8 +1714,8 @@ public class PhotoViewer implements NotificationCenter.NotificationCenterDelegat
return
;
return
;
}
}
try
{
try
{
WindowManager
wm
=
(
WindowManager
)
parentActivity
.
getSystemService
(
Context
.
WINDOW_SERVICE
);
if
(
windowView
.
getParent
()
!=
null
)
{
if
(
windowView
.
getParent
()
!=
null
)
{
WindowManager
wm
=
(
WindowManager
)
parentActivity
.
getSystemService
(
Context
.
WINDOW_SERVICE
);
wm
.
removeViewImmediate
(
windowView
);
wm
.
removeViewImmediate
(
windowView
);
}
}
windowView
=
null
;
windowView
=
null
;
...
@@ -1730,8 +1742,8 @@ public class PhotoViewer implements NotificationCenter.NotificationCenterDelegat
...
@@ -1730,8 +1742,8 @@ public class PhotoViewer implements NotificationCenter.NotificationCenterDelegat
public
void
run
()
{
public
void
run
()
{
animatingImageView
.
setImageBitmap
(
null
);
animatingImageView
.
setImageBitmap
(
null
);
try
{
try
{
WindowManager
wm
=
(
WindowManager
)
parentActivity
.
getSystemService
(
Context
.
WINDOW_SERVICE
);
if
(
windowView
.
getParent
()
!=
null
)
{
if
(
windowView
.
getParent
()
!=
null
)
{
WindowManager
wm
=
(
WindowManager
)
parentActivity
.
getSystemService
(
Context
.
WINDOW_SERVICE
);
wm
.
removeView
(
windowView
);
wm
.
removeView
(
windowView
);
}
}
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
...
...
TMessagesProj/src/main/java/org/telegram/ui/SettingsActivity.java
View file @
f92df091
...
@@ -962,7 +962,7 @@ public class SettingsActivity extends BaseFragment implements NotificationCenter
...
@@ -962,7 +962,7 @@ public class SettingsActivity extends BaseFragment implements NotificationCenter
MessagesController
.
getInstance
().
unregistedPush
();
MessagesController
.
getInstance
().
unregistedPush
();
MessagesController
.
getInstance
().
logOut
();
MessagesController
.
getInstance
().
logOut
();
UserConfig
.
clearConfig
();
UserConfig
.
clearConfig
();
MessagesStorage
.
getInstance
().
cleanUp
();
MessagesStorage
.
getInstance
().
cleanUp
(
false
);
MessagesController
.
getInstance
().
cleanUp
();
MessagesController
.
getInstance
().
cleanUp
();
ContactsController
.
getInstance
().
deleteAllAppAccounts
();
ContactsController
.
getInstance
().
deleteAllAppAccounts
();
}
}
...
...
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