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
87612e00
Commit
87612e00
authored
Aug 06, 2014
by
DrKLO
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Bug fixes
parent
dbef14df
Changes
20
Show whitespace changes
Inline
Side-by-side
Showing
20 changed files
with
183 additions
and
114 deletions
+183
-114
build.gradle
TMessagesProj/build.gradle
+1
-1
MessagesController.java
...rc/main/java/org/telegram/android/MessagesController.java
+57
-34
ConnectionsManager.java
.../main/java/org/telegram/messenger/ConnectionsManager.java
+1
-0
FileLoadOperation.java
...c/main/java/org/telegram/messenger/FileLoadOperation.java
+5
-2
MessageObject.java
...roj/src/main/java/org/telegram/objects/MessageObject.java
+74
-24
ApplicationLoader.java
...Proj/src/main/java/org/telegram/ui/ApplicationLoader.java
+0
-29
ChatBaseCell.java
...roj/src/main/java/org/telegram/ui/Cells/ChatBaseCell.java
+36
-19
ChatActivity.java
...sagesProj/src/main/java/org/telegram/ui/ChatActivity.java
+1
-0
ChatProfileActivity.java
...oj/src/main/java/org/telegram/ui/ChatProfileActivity.java
+2
-1
GroupCreateActivity.java
...oj/src/main/java/org/telegram/ui/GroupCreateActivity.java
+6
-4
broadcast3.png
TMessagesProj/src/main/res/drawable-hdpi/broadcast3.png
+0
-0
broadcast4.png
TMessagesProj/src/main/res/drawable-hdpi/broadcast4.png
+0
-0
broadcast3.png
TMessagesProj/src/main/res/drawable-ldpi/broadcast3.png
+0
-0
broadcast4.png
TMessagesProj/src/main/res/drawable-ldpi/broadcast4.png
+0
-0
broadcast3.png
TMessagesProj/src/main/res/drawable-mdpi/broadcast3.png
+0
-0
broadcast4.png
TMessagesProj/src/main/res/drawable-mdpi/broadcast4.png
+0
-0
broadcast3.png
TMessagesProj/src/main/res/drawable-xhdpi/broadcast3.png
+0
-0
broadcast4.png
TMessagesProj/src/main/res/drawable-xhdpi/broadcast4.png
+0
-0
broadcast3.png
TMessagesProj/src/main/res/drawable-xxhdpi/broadcast3.png
+0
-0
broadcast4.png
TMessagesProj/src/main/res/drawable-xxhdpi/broadcast4.png
+0
-0
No files found.
TMessagesProj/build.gradle
View file @
87612e00
...
@@ -83,7 +83,7 @@ android {
...
@@ -83,7 +83,7 @@ android {
defaultConfig
{
defaultConfig
{
minSdkVersion
8
minSdkVersion
8
targetSdkVersion
19
targetSdkVersion
19
versionCode
299
versionCode
302
versionName
"1.7.0"
versionName
"1.7.0"
}
}
}
}
TMessagesProj/src/main/java/org/telegram/android/MessagesController.java
View file @
87612e00
...
@@ -92,6 +92,8 @@ public class MessagesController implements NotificationCenter.NotificationCenter
...
@@ -92,6 +92,8 @@ public class MessagesController implements NotificationCenter.NotificationCenter
public
boolean
enableJoined
=
true
;
public
boolean
enableJoined
=
true
;
public
int
fontSize
=
AndroidUtilities
.
dp
(
16
);
public
int
fontSize
=
AndroidUtilities
.
dp
(
16
);
public
int
maxGroupCount
=
200
;
public
int
maxBroadcastCount
=
100
;
private
TLRPC
.
ChatParticipants
currentChatInfo
=
null
;
private
TLRPC
.
ChatParticipants
currentChatInfo
=
null
;
private
int
chatParticipantsId
=
0
;
private
int
chatParticipantsId
=
0
;
...
@@ -191,9 +193,26 @@ public class MessagesController implements NotificationCenter.NotificationCenter
...
@@ -191,9 +193,26 @@ public class MessagesController implements NotificationCenter.NotificationCenter
SharedPreferences
preferences
=
ApplicationLoader
.
applicationContext
.
getSharedPreferences
(
"Notifications"
,
Activity
.
MODE_PRIVATE
);
SharedPreferences
preferences
=
ApplicationLoader
.
applicationContext
.
getSharedPreferences
(
"Notifications"
,
Activity
.
MODE_PRIVATE
);
enableJoined
=
preferences
.
getBoolean
(
"EnableContactJoined"
,
true
);
enableJoined
=
preferences
.
getBoolean
(
"EnableContactJoined"
,
true
);
preferences
=
ApplicationLoader
.
applicationContext
.
getSharedPreferences
(
"mainconfig"
,
Activity
.
MODE_PRIVATE
);
preferences
=
ApplicationLoader
.
applicationContext
.
getSharedPreferences
(
"mainconfig"
,
Activity
.
MODE_PRIVATE
);
maxGroupCount
=
preferences
.
getInt
(
"maxGroupCount"
,
200
);
maxBroadcastCount
=
preferences
.
getInt
(
"maxBroadcastCount"
,
100
);
fontSize
=
preferences
.
getInt
(
"fons_size"
,
16
);
fontSize
=
preferences
.
getInt
(
"fons_size"
,
16
);
}
}
public
void
updateConfig
(
final
TLRPC
.
TL_config
config
)
{
Utilities
.
RunOnUIThread
(
new
Runnable
()
{
@Override
public
void
run
()
{
maxBroadcastCount
=
config
.
broadcast_size_max
;
maxGroupCount
=
config
.
chat_size_max
;
SharedPreferences
preferences
=
ApplicationLoader
.
applicationContext
.
getSharedPreferences
(
"mainconfig"
,
Activity
.
MODE_PRIVATE
);
SharedPreferences
.
Editor
editor
=
preferences
.
edit
();
editor
.
putInt
(
"maxGroupCount"
,
maxGroupCount
);
editor
.
putInt
(
"maxBroadcastCount"
,
maxBroadcastCount
);
editor
.
commit
();
}
});
}
public
void
addSupportUser
()
{
public
void
addSupportUser
()
{
TLRPC
.
TL_userForeign
user
=
new
TLRPC
.
TL_userForeign
();
TLRPC
.
TL_userForeign
user
=
new
TLRPC
.
TL_userForeign
();
user
.
phone
=
"333"
;
user
.
phone
=
"333"
;
...
@@ -4485,7 +4504,36 @@ public class MessagesController implements NotificationCenter.NotificationCenter
...
@@ -4485,7 +4504,36 @@ public class MessagesController implements NotificationCenter.NotificationCenter
}
}
NotificationCenter
.
getInstance
().
postNotificationName
(
dialogsNeedReload
);
NotificationCenter
.
getInstance
().
postNotificationName
(
dialogsNeedReload
);
}
}
if
(
printChangedArg
)
{
updateMask
|=
UPDATE_MASK_USER_PRINT
;
}
if
(!
contactsIds
.
isEmpty
())
{
updateMask
|=
UPDATE_MASK_NAME
;
updateMask
|=
UPDATE_MASK_USER_PHONE
;
}
if
(!
chatInfoToUpdate
.
isEmpty
())
{
for
(
TLRPC
.
ChatParticipants
info
:
chatInfoToUpdate
)
{
MessagesStorage
.
getInstance
().
updateChatInfo
(
info
.
chat_id
,
info
,
true
);
NotificationCenter
.
getInstance
().
postNotificationName
(
chatInfoDidLoaded
,
info
.
chat_id
,
info
);
}
}
if
(
updateMask
!=
0
)
{
NotificationCenter
.
getInstance
().
postNotificationName
(
updateInterfaces
,
updateMask
);
}
}
});
MessagesStorage
.
getInstance
().
storageQueue
.
postRunnable
(
new
Runnable
()
{
@Override
public
void
run
()
{
Utilities
.
RunOnUIThread
(
new
Runnable
()
{
@Override
public
void
run
()
{
int
updateMask
=
0
;
if
(!
markAsReadMessages
.
isEmpty
())
{
if
(!
markAsReadMessages
.
isEmpty
())
{
NotificationCenter
.
getInstance
().
postNotificationName
(
messagesReaded
,
markAsReadMessages
);
NotificationsController
.
getInstance
().
processReadMessages
(
markAsReadMessages
,
0
,
0
,
0
);
for
(
Integer
id
:
markAsReadMessages
)
{
for
(
Integer
id
:
markAsReadMessages
)
{
MessageObject
obj
=
dialogMessage
.
get
(
id
);
MessageObject
obj
=
dialogMessage
.
get
(
id
);
if
(
obj
!=
null
)
{
if
(
obj
!=
null
)
{
...
@@ -4517,37 +4565,11 @@ public class MessagesController implements NotificationCenter.NotificationCenter
...
@@ -4517,37 +4565,11 @@ public class MessagesController implements NotificationCenter.NotificationCenter
}
}
}
}
}
}
if
(
printChangedArg
)
{
updateMask
|=
UPDATE_MASK_USER_PRINT
;
}
if
(!
contactsIds
.
isEmpty
())
{
updateMask
|=
UPDATE_MASK_NAME
;
updateMask
|=
UPDATE_MASK_USER_PHONE
;
}
if
(!
chatInfoToUpdate
.
isEmpty
())
{
for
(
TLRPC
.
ChatParticipants
info
:
chatInfoToUpdate
)
{
MessagesStorage
.
getInstance
().
updateChatInfo
(
info
.
chat_id
,
info
,
true
);
NotificationCenter
.
getInstance
().
postNotificationName
(
chatInfoDidLoaded
,
info
.
chat_id
,
info
);
}
}
if
(
updateMask
!=
0
)
{
if
(
updateMask
!=
0
)
{
NotificationCenter
.
getInstance
().
postNotificationName
(
updateInterfaces
,
updateMask
);
NotificationCenter
.
getInstance
().
postNotificationName
(
updateInterfaces
,
updateMask
);
}
}
}
}
});
});
MessagesStorage
.
getInstance
().
storageQueue
.
postRunnable
(
new
Runnable
()
{
@Override
public
void
run
()
{
Utilities
.
RunOnUIThread
(
new
Runnable
()
{
@Override
public
void
run
()
{
if
(!
markAsReadMessages
.
isEmpty
())
{
NotificationCenter
.
getInstance
().
postNotificationName
(
messagesReaded
,
markAsReadMessages
);
NotificationsController
.
getInstance
().
processReadMessages
(
markAsReadMessages
,
0
,
0
,
0
);
}
}
});
}
}
});
});
...
@@ -4734,7 +4756,6 @@ public class MessagesController implements NotificationCenter.NotificationCenter
...
@@ -4734,7 +4756,6 @@ public class MessagesController implements NotificationCenter.NotificationCenter
TLObject
object
=
TLClassStore
.
Instance
().
TLdeserialize
(
is
,
is
.
readInt32
());
TLObject
object
=
TLClassStore
.
Instance
().
TLdeserialize
(
is
,
is
.
readInt32
());
BuffersStorage
.
getInstance
().
reuseFreeBuffer
(
is
);
BuffersStorage
.
getInstance
().
reuseFreeBuffer
(
is
);
if
(
object
!=
null
)
{
if
(
object
!=
null
)
{
int
from_id
=
chat
.
admin_id
;
int
from_id
=
chat
.
admin_id
;
if
(
from_id
==
UserConfig
.
getClientUserId
())
{
if
(
from_id
==
UserConfig
.
getClientUserId
())
{
from_id
=
chat
.
participant_id
;
from_id
=
chat
.
participant_id
;
...
@@ -4943,6 +4964,8 @@ public class MessagesController implements NotificationCenter.NotificationCenter
...
@@ -4943,6 +4964,8 @@ public class MessagesController implements NotificationCenter.NotificationCenter
pendingEncMessagesToDelete
.
addAll
(
serviceMessage
.
action
.
random_ids
);
pendingEncMessagesToDelete
.
addAll
(
serviceMessage
.
action
.
random_ids
);
}
}
return
null
;
return
null
;
}
else
{
return
null
;
}
}
}
else
{
}
else
{
FileLog
.
e
(
"tmessages"
,
"unkown message "
+
object
);
FileLog
.
e
(
"tmessages"
,
"unkown message "
+
object
);
...
@@ -4951,9 +4974,9 @@ public class MessagesController implements NotificationCenter.NotificationCenter
...
@@ -4951,9 +4974,9 @@ public class MessagesController implements NotificationCenter.NotificationCenter
FileLog
.
e
(
"tmessages"
,
"unkown TLObject"
);
FileLog
.
e
(
"tmessages"
,
"unkown TLObject"
);
}
}
}
else
{
}
else
{
BuffersStorage
.
getInstance
().
reuseFreeBuffer
(
is
);
FileLog
.
e
(
"tmessages"
,
"fingerprint mismatch"
);
FileLog
.
e
(
"tmessages"
,
"fingerprint mismatch"
);
}
}
BuffersStorage
.
getInstance
().
reuseFreeBuffer
(
is
);
return
null
;
return
null
;
}
}
...
...
TMessagesProj/src/main/java/org/telegram/messenger/ConnectionsManager.java
View file @
87612e00
...
@@ -781,6 +781,7 @@ public class ConnectionsManager implements Action.ActionDelegate, TcpConnection.
...
@@ -781,6 +781,7 @@ public class ConnectionsManager implements Action.ActionDelegate, TcpConnection.
processRequestQueue
(
RPCRequest
.
RPCRequestClassTransportMask
,
0
);
processRequestQueue
(
RPCRequest
.
RPCRequestClassTransportMask
,
0
);
}
}
MessagesController
.
getInstance
().
updateConfig
(
config
);
}
}
updatingDcSettings
=
false
;
updatingDcSettings
=
false
;
}
}
...
...
TMessagesProj/src/main/java/org/telegram/messenger/FileLoadOperation.java
View file @
87612e00
...
@@ -509,7 +509,6 @@ public class FileLoadOperation {
...
@@ -509,7 +509,6 @@ public class FileLoadOperation {
}
}
}
}
});
});
}
}
}
}
}
}
...
@@ -675,7 +674,11 @@ public class FileLoadOperation {
...
@@ -675,7 +674,11 @@ public class FileLoadOperation {
return
;
return
;
}
}
httpTask
=
new
DownloadImageTask
();
httpTask
=
new
DownloadImageTask
();
httpTask
.
doInBackground
(
httpUrl
);
if
(
android
.
os
.
Build
.
VERSION
.
SDK_INT
>=
11
)
{
httpTask
.
executeOnExecutor
(
AsyncTask
.
THREAD_POOL_EXECUTOR
,
null
,
null
,
null
);
}
else
{
httpTask
.
execute
(
null
,
null
,
null
);
}
}
}
private
void
processRequestResult
(
RequestInfo
requestInfo
,
TLRPC
.
TL_error
error
)
{
private
void
processRequestResult
(
RequestInfo
requestInfo
,
TLRPC
.
TL_error
error
)
{
...
...
TMessagesProj/src/main/java/org/telegram/objects/MessageObject.java
View file @
87612e00
...
@@ -39,7 +39,6 @@ public class MessageObject {
...
@@ -39,7 +39,6 @@ public class MessageObject {
public
int
contentType
;
public
int
contentType
;
public
ArrayList
<
PhotoObject
>
photoThumbs
;
public
ArrayList
<
PhotoObject
>
photoThumbs
;
public
Bitmap
imagePreview
;
public
Bitmap
imagePreview
;
public
PhotoObject
previewPhoto
;
public
String
dateKey
;
public
String
dateKey
;
public
boolean
deleted
=
false
;
public
boolean
deleted
=
false
;
public
float
audioProgress
;
public
float
audioProgress
;
...
@@ -138,10 +137,6 @@ public class MessageObject {
...
@@ -138,10 +137,6 @@ public class MessageObject {
messageText
=
LocaleController
.
getString
(
"ActionAddUser"
,
R
.
string
.
ActionAddUser
).
replace
(
"un2"
,
""
).
replace
(
"un1"
,
""
);
messageText
=
LocaleController
.
getString
(
"ActionAddUser"
,
R
.
string
.
ActionAddUser
).
replace
(
"un2"
,
""
).
replace
(
"un1"
,
""
);
}
}
}
else
if
(
message
.
action
instanceof
TLRPC
.
TL_messageActionChatEditPhoto
)
{
}
else
if
(
message
.
action
instanceof
TLRPC
.
TL_messageActionChatEditPhoto
)
{
photoThumbs
=
new
ArrayList
<
PhotoObject
>();
for
(
TLRPC
.
PhotoSize
size
:
message
.
action
.
photo
.
sizes
)
{
photoThumbs
.
add
(
new
PhotoObject
(
size
,
preview
));
}
if
(
isFromMe
())
{
if
(
isFromMe
())
{
messageText
=
LocaleController
.
getString
(
"ActionYouChangedPhoto"
,
R
.
string
.
ActionYouChangedPhoto
);
messageText
=
LocaleController
.
getString
(
"ActionYouChangedPhoto"
,
R
.
string
.
ActionYouChangedPhoto
);
}
else
{
}
else
{
...
@@ -242,22 +237,8 @@ public class MessageObject {
...
@@ -242,22 +237,8 @@ public class MessageObject {
}
}
}
else
if
(
message
.
media
!=
null
&&
!(
message
.
media
instanceof
TLRPC
.
TL_messageMediaEmpty
))
{
}
else
if
(
message
.
media
!=
null
&&
!(
message
.
media
instanceof
TLRPC
.
TL_messageMediaEmpty
))
{
if
(
message
.
media
instanceof
TLRPC
.
TL_messageMediaPhoto
)
{
if
(
message
.
media
instanceof
TLRPC
.
TL_messageMediaPhoto
)
{
photoThumbs
=
new
ArrayList
<
PhotoObject
>();
for
(
TLRPC
.
PhotoSize
size
:
message
.
media
.
photo
.
sizes
)
{
PhotoObject
obj
=
new
PhotoObject
(
size
,
preview
);
photoThumbs
.
add
(
obj
);
if
(
imagePreview
==
null
&&
obj
.
image
!=
null
)
{
imagePreview
=
obj
.
image
;
}
}
messageText
=
LocaleController
.
getString
(
"AttachPhoto"
,
R
.
string
.
AttachPhoto
);
messageText
=
LocaleController
.
getString
(
"AttachPhoto"
,
R
.
string
.
AttachPhoto
);
}
else
if
(
message
.
media
instanceof
TLRPC
.
TL_messageMediaVideo
)
{
}
else
if
(
message
.
media
instanceof
TLRPC
.
TL_messageMediaVideo
)
{
photoThumbs
=
new
ArrayList
<
PhotoObject
>();
PhotoObject
obj
=
new
PhotoObject
(
message
.
media
.
video
.
thumb
,
preview
);
photoThumbs
.
add
(
obj
);
if
(
imagePreview
==
null
&&
obj
.
image
!=
null
)
{
imagePreview
=
obj
.
image
;
}
messageText
=
LocaleController
.
getString
(
"AttachVideo"
,
R
.
string
.
AttachVideo
);
messageText
=
LocaleController
.
getString
(
"AttachVideo"
,
R
.
string
.
AttachVideo
);
}
else
if
(
message
.
media
instanceof
TLRPC
.
TL_messageMediaGeo
)
{
}
else
if
(
message
.
media
instanceof
TLRPC
.
TL_messageMediaGeo
)
{
messageText
=
LocaleController
.
getString
(
"AttachLocation"
,
R
.
string
.
AttachLocation
);
messageText
=
LocaleController
.
getString
(
"AttachLocation"
,
R
.
string
.
AttachLocation
);
...
@@ -266,11 +247,6 @@ public class MessageObject {
...
@@ -266,11 +247,6 @@ public class MessageObject {
}
else
if
(
message
.
media
instanceof
TLRPC
.
TL_messageMediaUnsupported
)
{
}
else
if
(
message
.
media
instanceof
TLRPC
.
TL_messageMediaUnsupported
)
{
messageText
=
LocaleController
.
getString
(
"UnsuppotedMedia"
,
R
.
string
.
UnsuppotedMedia
);
messageText
=
LocaleController
.
getString
(
"UnsuppotedMedia"
,
R
.
string
.
UnsuppotedMedia
);
}
else
if
(
message
.
media
instanceof
TLRPC
.
TL_messageMediaDocument
)
{
}
else
if
(
message
.
media
instanceof
TLRPC
.
TL_messageMediaDocument
)
{
if
(!(
message
.
media
.
document
.
thumb
instanceof
TLRPC
.
TL_photoSizeEmpty
))
{
photoThumbs
=
new
ArrayList
<
PhotoObject
>();
PhotoObject
obj
=
new
PhotoObject
(
message
.
media
.
document
.
thumb
,
preview
);
photoThumbs
.
add
(
obj
);
}
messageText
=
LocaleController
.
getString
(
"AttachDocument"
,
R
.
string
.
AttachDocument
);
messageText
=
LocaleController
.
getString
(
"AttachDocument"
,
R
.
string
.
AttachDocument
);
}
else
if
(
message
.
media
instanceof
TLRPC
.
TL_messageMediaAudio
)
{
}
else
if
(
message
.
media
instanceof
TLRPC
.
TL_messageMediaAudio
)
{
messageText
=
LocaleController
.
getString
(
"AttachAudio"
,
R
.
string
.
AttachAudio
);
messageText
=
LocaleController
.
getString
(
"AttachAudio"
,
R
.
string
.
AttachAudio
);
...
@@ -335,6 +311,80 @@ public class MessageObject {
...
@@ -335,6 +311,80 @@ public class MessageObject {
dateKey
=
String
.
format
(
"%d_%02d_%02d"
,
dateYear
,
dateMonth
,
dateDay
);
dateKey
=
String
.
format
(
"%d_%02d_%02d"
,
dateYear
,
dateMonth
,
dateDay
);
generateLayout
();
generateLayout
();
generateThumbs
(
false
,
preview
);
}
public
void
generateThumbs
(
boolean
update
,
int
preview
)
{
if
(
messageOwner
instanceof
TLRPC
.
TL_messageService
)
{
if
(
messageOwner
.
action
instanceof
TLRPC
.
TL_messageActionChatEditPhoto
)
{
if
(!
update
)
{
photoThumbs
=
new
ArrayList
<
PhotoObject
>();
for
(
TLRPC
.
PhotoSize
size
:
messageOwner
.
action
.
photo
.
sizes
)
{
photoThumbs
.
add
(
new
PhotoObject
(
size
,
preview
));
}
}
else
if
(
photoThumbs
!=
null
&&
!
photoThumbs
.
isEmpty
())
{
for
(
PhotoObject
photoObject
:
photoThumbs
)
{
for
(
TLRPC
.
PhotoSize
size
:
messageOwner
.
action
.
photo
.
sizes
)
{
if
(
size
instanceof
TLRPC
.
TL_photoSizeEmpty
)
{
continue
;
}
if
(
size
.
type
.
equals
(
photoObject
.
photoOwner
.
type
))
{
photoObject
.
photoOwner
.
location
=
size
.
location
;
break
;
}
}
}
}
}
}
else
if
(
messageOwner
.
media
!=
null
&&
!(
messageOwner
.
media
instanceof
TLRPC
.
TL_messageMediaEmpty
))
{
if
(
messageOwner
.
media
instanceof
TLRPC
.
TL_messageMediaPhoto
)
{
if
(!
update
)
{
photoThumbs
=
new
ArrayList
<
PhotoObject
>();
for
(
TLRPC
.
PhotoSize
size
:
messageOwner
.
media
.
photo
.
sizes
)
{
PhotoObject
obj
=
new
PhotoObject
(
size
,
preview
);
photoThumbs
.
add
(
obj
);
if
(
imagePreview
==
null
&&
obj
.
image
!=
null
)
{
imagePreview
=
obj
.
image
;
}
}
}
else
if
(
photoThumbs
!=
null
&&
!
photoThumbs
.
isEmpty
())
{
for
(
PhotoObject
photoObject
:
photoThumbs
)
{
for
(
TLRPC
.
PhotoSize
size
:
messageOwner
.
media
.
photo
.
sizes
)
{
if
(
size
instanceof
TLRPC
.
TL_photoSizeEmpty
)
{
continue
;
}
if
(
size
.
type
.
equals
(
photoObject
.
photoOwner
.
type
))
{
photoObject
.
photoOwner
.
location
=
size
.
location
;
break
;
}
}
}
}
}
else
if
(
messageOwner
.
media
instanceof
TLRPC
.
TL_messageMediaVideo
)
{
if
(!
update
)
{
photoThumbs
=
new
ArrayList
<
PhotoObject
>();
PhotoObject
obj
=
new
PhotoObject
(
messageOwner
.
media
.
video
.
thumb
,
preview
);
photoThumbs
.
add
(
obj
);
if
(
imagePreview
==
null
&&
obj
.
image
!=
null
)
{
imagePreview
=
obj
.
image
;
}
}
else
if
(
photoThumbs
!=
null
&&
!
photoThumbs
.
isEmpty
()
&&
messageOwner
.
media
.
video
.
thumb
!=
null
)
{
PhotoObject
photoObject
=
photoThumbs
.
get
(
0
);
photoObject
.
photoOwner
.
location
=
messageOwner
.
media
.
video
.
thumb
.
location
;
}
}
if
(
messageOwner
.
media
instanceof
TLRPC
.
TL_messageMediaDocument
)
{
if
(!(
messageOwner
.
media
.
document
.
thumb
instanceof
TLRPC
.
TL_photoSizeEmpty
))
{
if
(!
update
)
{
photoThumbs
=
new
ArrayList
<
PhotoObject
>();
PhotoObject
obj
=
new
PhotoObject
(
messageOwner
.
media
.
document
.
thumb
,
preview
);
photoThumbs
.
add
(
obj
);
}
else
if
(
photoThumbs
!=
null
&&
!
photoThumbs
.
isEmpty
()
&&
messageOwner
.
media
.
document
.
thumb
!=
null
)
{
PhotoObject
photoObject
=
photoThumbs
.
get
(
0
);
photoObject
.
photoOwner
.
location
=
messageOwner
.
media
.
video
.
thumb
.
location
;
}
}
}
}
}
}
public
String
getFileName
()
{
public
String
getFileName
()
{
...
...
TMessagesProj/src/main/java/org/telegram/ui/ApplicationLoader.java
View file @
87612e00
...
@@ -8,7 +8,6 @@
...
@@ -8,7 +8,6 @@
package
org
.
telegram
.
ui
;
package
org
.
telegram
.
ui
;
import
android.app.Activity
;
import
android.app.AlarmManager
;
import
android.app.AlarmManager
;
import
android.app.Application
;
import
android.app.Application
;
import
android.app.PendingIntent
;
import
android.app.PendingIntent
;
...
@@ -93,34 +92,6 @@ public class ApplicationLoader extends Application {
...
@@ -93,34 +92,6 @@ public class ApplicationLoader extends Application {
UserConfig
.
loadConfig
();
UserConfig
.
loadConfig
();
if
(
UserConfig
.
getCurrentUser
()
!=
null
)
{
if
(
UserConfig
.
getCurrentUser
()
!=
null
)
{
boolean
changed
=
false
;
SharedPreferences
preferences
=
applicationContext
.
getSharedPreferences
(
"Notifications"
,
MODE_PRIVATE
);
int
v
=
preferences
.
getInt
(
"v"
,
0
);
if
(
v
!=
1
)
{
SharedPreferences
preferences2
=
ApplicationLoader
.
applicationContext
.
getSharedPreferences
(
"mainconfig"
,
Activity
.
MODE_PRIVATE
);
SharedPreferences
.
Editor
editor
=
preferences2
.
edit
();
if
(
preferences
.
contains
(
"view_animations"
))
{
editor
.
putBoolean
(
"view_animations"
,
preferences
.
getBoolean
(
"view_animations"
,
false
));
}
if
(
preferences
.
contains
(
"selectedBackground"
))
{
editor
.
putInt
(
"selectedBackground"
,
preferences
.
getInt
(
"selectedBackground"
,
1000001
));
}
if
(
preferences
.
contains
(
"selectedColor"
))
{
editor
.
putInt
(
"selectedColor"
,
preferences
.
getInt
(
"selectedColor"
,
0
));
}
if
(
preferences
.
contains
(
"fons_size"
))
{
editor
.
putInt
(
"fons_size"
,
preferences
.
getInt
(
"fons_size"
,
16
));
}
editor
.
commit
();
editor
=
preferences
.
edit
();
editor
.
putInt
(
"v"
,
1
);
editor
.
remove
(
"view_animations"
);
editor
.
remove
(
"selectedBackground"
);
editor
.
remove
(
"selectedColor"
);
editor
.
remove
(
"fons_size"
);
editor
.
commit
();
}
MessagesController
.
getInstance
().
users
.
put
(
UserConfig
.
getClientUserId
(),
UserConfig
.
getCurrentUser
());
MessagesController
.
getInstance
().
users
.
put
(
UserConfig
.
getClientUserId
(),
UserConfig
.
getCurrentUser
());
ConnectionsManager
.
getInstance
().
applyCountryPortNumber
(
UserConfig
.
getCurrentUser
().
phone
);
ConnectionsManager
.
getInstance
().
applyCountryPortNumber
(
UserConfig
.
getCurrentUser
().
phone
);
ConnectionsManager
.
getInstance
().
initPushConnection
();
ConnectionsManager
.
getInstance
().
initPushConnection
();
...
...
TMessagesProj/src/main/java/org/telegram/ui/Cells/ChatBaseCell.java
View file @
87612e00
...
@@ -60,9 +60,11 @@ public class ChatBaseCell extends BaseCell {
...
@@ -60,9 +60,11 @@ public class ChatBaseCell extends BaseCell {
private
static
Drawable
checkDrawable
;
private
static
Drawable
checkDrawable
;
private
static
Drawable
halfCheckDrawable
;
private
static
Drawable
halfCheckDrawable
;
private
static
Drawable
clockDrawable
;
private
static
Drawable
clockDrawable
;
private
static
Drawable
broadcastDrawable
;
private
static
Drawable
checkMediaDrawable
;
private
static
Drawable
checkMediaDrawable
;
private
static
Drawable
halfCheckMediaDrawable
;
private
static
Drawable
halfCheckMediaDrawable
;
private
static
Drawable
clockMediaDrawable
;
private
static
Drawable
clockMediaDrawable
;
private
static
Drawable
broadcastMediaDrawable
;
private
static
Drawable
errorDrawable
;
private
static
Drawable
errorDrawable
;
protected
static
Drawable
mediaBackgroundDrawable
;
protected
static
Drawable
mediaBackgroundDrawable
;
private
static
TextPaint
timePaintIn
;
private
static
TextPaint
timePaintIn
;
...
@@ -177,6 +179,8 @@ public class ChatBaseCell extends BaseCell {
...
@@ -177,6 +179,8 @@ public class ChatBaseCell extends BaseCell {
clockMediaDrawable
=
getResources
().
getDrawable
(
R
.
drawable
.
msg_clock_photo
);
clockMediaDrawable
=
getResources
().
getDrawable
(
R
.
drawable
.
msg_clock_photo
);
errorDrawable
=
getResources
().
getDrawable
(
R
.
drawable
.
msg_warning
);
errorDrawable
=
getResources
().
getDrawable
(
R
.
drawable
.
msg_warning
);
mediaBackgroundDrawable
=
getResources
().
getDrawable
(
R
.
drawable
.
phototime
);
mediaBackgroundDrawable
=
getResources
().
getDrawable
(
R
.
drawable
.
phototime
);
broadcastDrawable
=
getResources
().
getDrawable
(
R
.
drawable
.
broadcast3
);
broadcastMediaDrawable
=
getResources
().
getDrawable
(
R
.
drawable
.
broadcast4
);
timePaintIn
=
new
TextPaint
(
TextPaint
.
ANTI_ALIAS_FLAG
);
timePaintIn
=
new
TextPaint
(
TextPaint
.
ANTI_ALIAS_FLAG
);
timePaintIn
.
setTextSize
(
AndroidUtilities
.
dp
(
12
));
timePaintIn
.
setTextSize
(
AndroidUtilities
.
dp
(
12
));
...
@@ -569,6 +573,7 @@ public class ChatBaseCell extends BaseCell {
...
@@ -569,6 +573,7 @@ public class ChatBaseCell extends BaseCell {
boolean
drawCheck2
=
false
;
boolean
drawCheck2
=
false
;
boolean
drawClock
=
false
;
boolean
drawClock
=
false
;
boolean
drawError
=
false
;
boolean
drawError
=
false
;
boolean
isBroadcast
=
(
int
)(
currentMessageObject
.
getDialogId
()
>>
32
)
==
1
;
if
(
currentMessageObject
.
messageOwner
.
send_state
==
MessagesController
.
MESSAGE_SEND_STATE_SENDING
)
{
if
(
currentMessageObject
.
messageOwner
.
send_state
==
MessagesController
.
MESSAGE_SEND_STATE_SENDING
)
{
drawCheck1
=
false
;
drawCheck1
=
false
;
...
@@ -601,6 +606,17 @@ public class ChatBaseCell extends BaseCell {
...
@@ -601,6 +606,17 @@ public class ChatBaseCell extends BaseCell {
clockMediaDrawable
.
draw
(
canvas
);
clockMediaDrawable
.
draw
(
canvas
);
}
}
}
}
if
(
isBroadcast
)
{
if
(
drawCheck1
||
drawCheck2
)
{
if
(!
media
)
{
setDrawableBounds
(
broadcastDrawable
,
layoutWidth
-
AndroidUtilities
.
dpf
(
20.5f
)
-
broadcastDrawable
.
getIntrinsicWidth
(),
layoutHeight
-
AndroidUtilities
.
dpf
(
8.0f
)
-
broadcastDrawable
.
getIntrinsicHeight
());
broadcastDrawable
.
draw
(
canvas
);
}
else
{
setDrawableBounds
(
broadcastMediaDrawable
,
layoutWidth
-
AndroidUtilities
.
dpf
(
24.0f
)
-
broadcastMediaDrawable
.
getIntrinsicWidth
(),
layoutHeight
-
AndroidUtilities
.
dpf
(
13.0f
)
-
broadcastMediaDrawable
.
getIntrinsicHeight
());
broadcastMediaDrawable
.
draw
(
canvas
);
}
}
}
else
{
if
(
drawCheck2
)
{
if
(
drawCheck2
)
{
if
(!
media
)
{
if
(!
media
)
{
if
(
drawCheck1
)
{
if
(
drawCheck1
)
{
...
@@ -627,6 +643,7 @@ public class ChatBaseCell extends BaseCell {
...
@@ -627,6 +643,7 @@ public class ChatBaseCell extends BaseCell {
halfCheckMediaDrawable
.
draw
(
canvas
);
halfCheckMediaDrawable
.
draw
(
canvas
);
}
}
}
}
}
if
(
drawError
)
{
if
(
drawError
)
{
if
(!
media
)
{
if
(!
media
)
{
setDrawableBounds
(
errorDrawable
,
layoutWidth
-
AndroidUtilities
.
dp
(
18
)
-
errorDrawable
.
getIntrinsicWidth
(),
layoutHeight
-
AndroidUtilities
.
dpf
(
6.5f
)
-
errorDrawable
.
getIntrinsicHeight
());
setDrawableBounds
(
errorDrawable
,
layoutWidth
-
AndroidUtilities
.
dp
(
18
)
-
errorDrawable
.
getIntrinsicWidth
(),
layoutHeight
-
AndroidUtilities
.
dpf
(
6.5f
)
-
errorDrawable
.
getIntrinsicHeight
());
...
...
TMessagesProj/src/main/java/org/telegram/ui/ChatActivity.java
View file @
87612e00
...
@@ -2161,6 +2161,7 @@ public class ChatActivity extends BaseFragment implements NotificationCenter.Not
...
@@ -2161,6 +2161,7 @@ public class ChatActivity extends BaseFragment implements NotificationCenter.Not
MessageObject
newMsgObj
=
(
MessageObject
)
args
[
2
];
MessageObject
newMsgObj
=
(
MessageObject
)
args
[
2
];
if
(
newMsgObj
!=
null
)
{
if
(
newMsgObj
!=
null
)
{
obj
.
messageOwner
.
media
=
newMsgObj
.
messageOwner
.
media
;
obj
.
messageOwner
.
media
=
newMsgObj
.
messageOwner
.
media
;
obj
.
generateThumbs
(
true
,
1
);
}
}
messagesDict
.
remove
(
msgId
);
messagesDict
.
remove
(
msgId
);
messagesDict
.
put
(
newMsgId
,
obj
);
messagesDict
.
put
(
newMsgId
,
obj
);
...
...
TMessagesProj/src/main/java/org/telegram/ui/ChatProfileActivity.java
View file @
87612e00
...
@@ -143,7 +143,8 @@ public class ChatProfileActivity extends BaseFragment implements NotificationCen
...
@@ -143,7 +143,8 @@ public class ChatProfileActivity extends BaseFragment implements NotificationCen
membersSectionRow
=
rowCount
++;
membersSectionRow
=
rowCount
++;
rowCount
+=
info
.
participants
.
size
();
rowCount
+=
info
.
participants
.
size
();
membersEndRow
=
rowCount
;
membersEndRow
=
rowCount
;
if
(
info
.
participants
.
size
()
<
200
)
{
int
maxCount
=
chat_id
>
0
?
MessagesController
.
getInstance
().
maxGroupCount
:
MessagesController
.
getInstance
().
maxBroadcastCount
;
if
(
info
.
participants
.
size
()
<
maxCount
)
{
addMemberRow
=
rowCount
++;
addMemberRow
=
rowCount
++;
}
else
{
}
else
{
addMemberRow
=
-
1
;
addMemberRow
=
-
1
;
...
...
TMessagesProj/src/main/java/org/telegram/ui/GroupCreateActivity.java
View file @
87612e00
...
@@ -91,6 +91,7 @@ public class GroupCreateActivity extends BaseFragment implements NotificationCen
...
@@ -91,6 +91,7 @@ public class GroupCreateActivity extends BaseFragment implements NotificationCen
private
EditText
userSelectEditText
;
private
EditText
userSelectEditText
;
private
boolean
ignoreChange
=
false
;
private
boolean
ignoreChange
=
false
;
private
boolean
isBroadcast
=
false
;
private
boolean
isBroadcast
=
false
;
private
int
maxCount
=
200
;
private
HashMap
<
Integer
,
XImageSpan
>
selectedContacts
=
new
HashMap
<
Integer
,
XImageSpan
>();
private
HashMap
<
Integer
,
XImageSpan
>
selectedContacts
=
new
HashMap
<
Integer
,
XImageSpan
>();
private
ArrayList
<
XImageSpan
>
allSpans
=
new
ArrayList
<
XImageSpan
>();
private
ArrayList
<
XImageSpan
>
allSpans
=
new
ArrayList
<
XImageSpan
>();
...
@@ -113,6 +114,7 @@ public class GroupCreateActivity extends BaseFragment implements NotificationCen
...
@@ -113,6 +114,7 @@ public class GroupCreateActivity extends BaseFragment implements NotificationCen
public
GroupCreateActivity
(
Bundle
args
)
{
public
GroupCreateActivity
(
Bundle
args
)
{
super
(
args
);
super
(
args
);
isBroadcast
=
args
.
getBoolean
(
"broadcast"
,
false
);
isBroadcast
=
args
.
getBoolean
(
"broadcast"
,
false
);
maxCount
=
!
isBroadcast
?
MessagesController
.
getInstance
().
maxGroupCount
:
MessagesController
.
getInstance
().
maxBroadcastCount
;
}
}
@Override
@Override
...
@@ -141,7 +143,7 @@ public class GroupCreateActivity extends BaseFragment implements NotificationCen
...
@@ -141,7 +143,7 @@ public class GroupCreateActivity extends BaseFragment implements NotificationCen
}
else
{
}
else
{
actionBarLayer
.
setTitle
(
LocaleController
.
getString
(
"NewGroup"
,
R
.
string
.
NewGroup
));
actionBarLayer
.
setTitle
(
LocaleController
.
getString
(
"NewGroup"
,
R
.
string
.
NewGroup
));
}
}
actionBarLayer
.
setSubtitle
(
LocaleController
.
formatString
(
"MembersCount"
,
R
.
string
.
MembersCount
,
selectedContacts
.
size
(),
200
));
actionBarLayer
.
setSubtitle
(
LocaleController
.
formatString
(
"MembersCount"
,
R
.
string
.
MembersCount
,
selectedContacts
.
size
(),
maxCount
));
actionBarLayer
.
setActionBarMenuOnItemClick
(
new
ActionBarLayer
.
ActionBarMenuOnItemClick
()
{
actionBarLayer
.
setActionBarMenuOnItemClick
(
new
ActionBarLayer
.
ActionBarMenuOnItemClick
()
{
@Override
@Override
...
@@ -216,7 +218,7 @@ public class GroupCreateActivity extends BaseFragment implements NotificationCen
...
@@ -216,7 +218,7 @@ public class GroupCreateActivity extends BaseFragment implements NotificationCen
selectedContacts
.
remove
(
sp
.
uid
);
selectedContacts
.
remove
(
sp
.
uid
);
}
}
}
}
actionBarLayer
.
setSubtitle
(
LocaleController
.
formatString
(
"MembersCount"
,
R
.
string
.
MembersCount
,
selectedContacts
.
size
(),
200
));
actionBarLayer
.
setSubtitle
(
LocaleController
.
formatString
(
"MembersCount"
,
R
.
string
.
MembersCount
,
selectedContacts
.
size
(),
maxCount
));
listView
.
invalidateViews
();
listView
.
invalidateViews
();
}
else
{
}
else
{
search
=
true
;
search
=
true
;
...
@@ -274,7 +276,7 @@ public class GroupCreateActivity extends BaseFragment implements NotificationCen
...
@@ -274,7 +276,7 @@ public class GroupCreateActivity extends BaseFragment implements NotificationCen
userSelectEditText
.
setSelection
(
text
.
length
());
userSelectEditText
.
setSelection
(
text
.
length
());
ignoreChange
=
false
;
ignoreChange
=
false
;
}
else
{
}
else
{
if
(
selectedContacts
.
size
()
==
200
)
{
if
(
selectedContacts
.
size
()
==
maxCount
)
{
return
;
return
;
}
}
ignoreChange
=
true
;
ignoreChange
=
true
;
...
@@ -282,7 +284,7 @@ public class GroupCreateActivity extends BaseFragment implements NotificationCen
...
@@ -282,7 +284,7 @@ public class GroupCreateActivity extends BaseFragment implements NotificationCen
span
.
uid
=
user
.
id
;
span
.
uid
=
user
.
id
;
ignoreChange
=
false
;
ignoreChange
=
false
;
}
}
actionBarLayer
.
setSubtitle
(
LocaleController
.
formatString
(
"MembersCount"
,
R
.
string
.
MembersCount
,
selectedContacts
.
size
(),
200
));
actionBarLayer
.
setSubtitle
(
LocaleController
.
formatString
(
"MembersCount"
,
R
.
string
.
MembersCount
,
selectedContacts
.
size
(),
maxCount
));
if
(
searching
||
searchWas
)
{
if
(
searching
||
searchWas
)
{
searching
=
false
;
searching
=
false
;
searchWas
=
false
;
searchWas
=
false
;
...
...
TMessagesProj/src/main/res/drawable-hdpi/broadcast3.png
0 → 100644
View file @
87612e00
1.16 KB
TMessagesProj/src/main/res/drawable-hdpi/broadcast4.png
0 → 100644
View file @
87612e00
1.15 KB
TMessagesProj/src/main/res/drawable-ldpi/broadcast3.png
0 → 100644
View file @
87612e00
1.07 KB
TMessagesProj/src/main/res/drawable-ldpi/broadcast4.png
0 → 100644
View file @
87612e00
1.06 KB
TMessagesProj/src/main/res/drawable-mdpi/broadcast3.png
0 → 100644
View file @
87612e00
1.1 KB
TMessagesProj/src/main/res/drawable-mdpi/broadcast4.png
0 → 100644
View file @
87612e00
1.07 KB
TMessagesProj/src/main/res/drawable-xhdpi/broadcast3.png
0 → 100644
View file @
87612e00
1.22 KB
TMessagesProj/src/main/res/drawable-xhdpi/broadcast4.png
0 → 100644
View file @
87612e00
1.2 KB
TMessagesProj/src/main/res/drawable-xxhdpi/broadcast3.png
0 → 100644
View file @
87612e00
1.35 KB
TMessagesProj/src/main/res/drawable-xxhdpi/broadcast4.png
0 → 100644
View file @
87612e00
1.31 KB
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