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
15ac6cdb
Commit
15ac6cdb
authored
Oct 20, 2014
by
DrKLO
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Crash fixes
parent
87cb843e
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
38 additions
and
27 deletions
+38
-27
SendMessagesHelper.java
...rc/main/java/org/telegram/android/SendMessagesHelper.java
+7
-5
ConnectionsManager.java
.../main/java/org/telegram/messenger/ConnectionsManager.java
+1
-0
ChatActivity.java
...sagesProj/src/main/java/org/telegram/ui/ChatActivity.java
+23
-17
LaunchActivity.java
...gesProj/src/main/java/org/telegram/ui/LaunchActivity.java
+6
-4
NumberPicker.java
...roj/src/main/java/org/telegram/ui/Views/NumberPicker.java
+1
-1
No files found.
TMessagesProj/src/main/java/org/telegram/android/SendMessagesHelper.java
View file @
15ac6cdb
...
...
@@ -373,7 +373,11 @@ public class SendMessagesHelper implements NotificationCenter.NotificationCenter
sendMessage
(
null
,
null
,
null
,
null
,
null
,
null
,
null
,
null
,
audio
,
null
,
peer
,
false
,
path
);
}
private
int
sendMessage
(
String
message
,
Double
lat
,
Double
lon
,
TLRPC
.
TL_photo
photo
,
TLRPC
.
TL_video
video
,
MessageObject
msgObj
,
TLRPC
.
User
user
,
TLRPC
.
TL_document
document
,
TLRPC
.
TL_audio
audio
,
String
originalPath
,
long
peer
,
boolean
retry
,
String
path
)
{
private
void
sendMessage
(
String
message
,
Double
lat
,
Double
lon
,
TLRPC
.
TL_photo
photo
,
TLRPC
.
TL_video
video
,
MessageObject
msgObj
,
TLRPC
.
User
user
,
TLRPC
.
TL_document
document
,
TLRPC
.
TL_audio
audio
,
String
originalPath
,
long
peer
,
boolean
retry
,
String
path
)
{
if
(
peer
==
0
)
{
return
;
}
TLRPC
.
Message
newMsg
=
null
;
int
type
=
-
1
;
int
lower_id
=
(
int
)
peer
;
...
...
@@ -548,7 +552,7 @@ public class SendMessagesHelper implements NotificationCenter.NotificationCenter
if
(
high_id
==
1
)
{
if
(
currentChatInfo
==
null
)
{
processSentMessage
(
newMsg
.
id
);
return
0
;
return
;
}
sendToPeers
=
new
ArrayList
<
TLRPC
.
InputUser
>();
for
(
TLRPC
.
TL_chatParticipant
participant
:
currentChatInfo
.
participants
)
{
...
...
@@ -573,7 +577,7 @@ public class SendMessagesHelper implements NotificationCenter.NotificationCenter
TLRPC
.
User
sendToUser
=
MessagesController
.
getInstance
().
getUser
(
lower_id
);
if
(
sendToUser
==
null
)
{
processSentMessage
(
newMsg
.
id
);
return
0
;
return
;
}
if
(
sendToUser
instanceof
TLRPC
.
TL_userForeign
||
sendToUser
instanceof
TLRPC
.
TL_userRequest
)
{
sendToPeer
=
new
TLRPC
.
TL_inputPeerForeign
();
...
...
@@ -929,9 +933,7 @@ public class SendMessagesHelper implements NotificationCenter.NotificationCenter
newMsgObj
.
messageOwner
.
send_state
=
MessageObject
.
MESSAGE_SEND_STATE_SEND_ERROR
;
NotificationCenter
.
getInstance
().
postNotificationName
(
NotificationCenter
.
messageSendError
,
newMsgObj
.
messageOwner
.
id
);
processSentMessage
(
newMsgObj
.
messageOwner
.
id
);
return
0
;
}
return
newMsg
!=
null
?
newMsg
.
id
:
0
;
}
private
void
performSendDelayedMessage
(
final
DelayedMessage
message
)
{
...
...
TMessagesProj/src/main/java/org/telegram/messenger/ConnectionsManager.java
View file @
15ac6cdb
...
...
@@ -2438,6 +2438,7 @@ public class ConnectionsManager implements Action.ActionDelegate, TcpConnection.
}
});
}
else
if
((
connection
.
transportRequestClass
&
RPCRequest
.
RPCRequestClassPush
)
!=
0
)
{
FileLog
.
e
(
"tmessages"
,
"call connection closed"
);
sendingPushPing
=
false
;
lastPushPingTime
=
System
.
currentTimeMillis
()
-
60000
*
3
+
4000
;
}
...
...
TMessagesProj/src/main/java/org/telegram/ui/ChatActivity.java
View file @
15ac6cdb
...
...
@@ -71,7 +71,6 @@ import org.telegram.ui.Cells.ChatContactCell;
import
org.telegram.ui.Cells.ChatMediaCell
;
import
org.telegram.ui.Cells.ChatMessageCell
;
import
org.telegram.ui.Views.ActionBar.ActionBarLayer
;
import
org.telegram.ui.Views.ActionBar.ActionBarLayout
;
import
org.telegram.ui.Views.ActionBar.ActionBarMenu
;
import
org.telegram.ui.Views.ActionBar.ActionBarMenuItem
;
import
org.telegram.ui.Views.BackupImageView
;
...
...
@@ -131,7 +130,7 @@ public class ChatActivity extends BaseFragment implements NotificationCenter.Not
private
View
pagedownButton
;
private
TextView
topPanelText
;
private
long
dialog_id
;
private
boolean
isBr
ao
dcast
=
false
;
private
boolean
isBr
oa
dcast
=
false
;
private
HashMap
<
Integer
,
MessageObject
>
selectedMessagesIds
=
new
HashMap
<
Integer
,
MessageObject
>();
private
HashMap
<
Integer
,
MessageObject
>
selectedMessagesCanCopyIds
=
new
HashMap
<
Integer
,
MessageObject
>();
...
...
@@ -241,15 +240,15 @@ public class ChatActivity extends BaseFragment implements NotificationCenter.Not
if
(
chatId
>
0
)
{
dialog_id
=
-
chatId
;
}
else
{
isBr
ao
dcast
=
true
;
isBr
oa
dcast
=
true
;
dialog_id
=
AndroidUtilities
.
makeBroadcastId
(
chatId
);
}
Semaphore
semaphore
=
null
;
if
(
isBr
ao
dcast
)
{
if
(
isBr
oa
dcast
)
{
semaphore
=
new
Semaphore
(
0
);
}
MessagesController
.
getInstance
().
loadChatInfo
(
currentChat
.
id
,
semaphore
);
if
(
isBr
ao
dcast
)
{
if
(
isBr
oa
dcast
)
{
try
{
semaphore
.
acquire
();
}
catch
(
Exception
e
)
{
...
...
@@ -1176,7 +1175,7 @@ public class ChatActivity extends BaseFragment implements NotificationCenter.Not
if
(
currentChat
.
photo
!=
null
)
{
photo
=
currentChat
.
photo
.
photo_small
;
}
if
(
isBr
ao
dcast
)
{
if
(
isBr
oa
dcast
)
{
placeHolderId
=
AndroidUtilities
.
getBroadcastAvatarForId
(
currentChat
.
id
);
}
else
{
placeHolderId
=
AndroidUtilities
.
getGroupAvatarForId
(
currentChat
.
id
);
...
...
@@ -1203,9 +1202,12 @@ public class ChatActivity extends BaseFragment implements NotificationCenter.Not
}
private
int
getMessageType
(
MessageObject
messageObject
)
{
if
(
messageObject
==
null
)
{
return
-
1
;
}
if
(
currentEncryptedChat
==
null
)
{
boolean
isBroadcastError
=
isBr
ao
dcast
&&
messageObject
.
messageOwner
.
id
<=
0
&&
messageObject
.
isSendError
();
if
(!
isBr
ao
dcast
&&
messageObject
.
messageOwner
.
id
<=
0
&&
messageObject
.
isOut
()
||
isBroadcastError
)
{
boolean
isBroadcastError
=
isBr
oa
dcast
&&
messageObject
.
messageOwner
.
id
<=
0
&&
messageObject
.
isSendError
();
if
(!
isBr
oa
dcast
&&
messageObject
.
messageOwner
.
id
<=
0
&&
messageObject
.
isOut
()
||
isBroadcastError
)
{
if
(
messageObject
.
isSendError
())
{
if
(!(
messageObject
.
messageOwner
.
media
instanceof
TLRPC
.
TL_messageMediaEmpty
))
{
return
0
;
...
...
@@ -1447,7 +1449,7 @@ public class ChatActivity extends BaseFragment implements NotificationCenter.Not
if
(
currentChat
.
photo
!=
null
)
{
newPhoto
=
currentChat
.
photo
.
photo_small
;
}
if
(
isBr
ao
dcast
)
{
if
(
isBr
oa
dcast
)
{
placeHolderId
=
AndroidUtilities
.
getBroadcastAvatarForId
(
currentChat
.
id
);
}
else
{
placeHolderId
=
AndroidUtilities
.
getGroupAvatarForId
(
currentChat
.
id
);
...
...
@@ -1458,7 +1460,7 @@ public class ChatActivity extends BaseFragment implements NotificationCenter.Not
}
}
public
boolean
openVideoEditor
(
String
videoPath
,
boolean
removeLast
,
ActionBarLayout
parentLayout
)
{
public
boolean
openVideoEditor
(
String
videoPath
,
boolean
removeLast
)
{
Bundle
args
=
new
Bundle
();
args
.
putString
(
"videoPath"
,
videoPath
);
VideoEditorActivity
fragment
=
new
VideoEditorActivity
(
args
);
...
...
@@ -1543,7 +1545,7 @@ public class ChatActivity extends BaseFragment implements NotificationCenter.Not
if
(
paused
)
{
startVideoEdit
=
videoPath
;
}
else
{
openVideoEditor
(
videoPath
,
false
,
parentLayout
);
openVideoEditor
(
videoPath
,
false
);
}
}
else
{
SendMessagesHelper
.
prepareSendingVideo
(
videoPath
,
0
,
0
,
0
,
0
,
null
,
dialog_id
);
...
...
@@ -1735,7 +1737,7 @@ public class ChatActivity extends BaseFragment implements NotificationCenter.Not
if
(
messArr
.
size
()
!=
count
)
{
if
(
isCache
)
{
cacheEndReaced
=
true
;
if
(
currentEncryptedChat
!=
null
||
isBr
ao
dcast
)
{
if
(
currentEncryptedChat
!=
null
||
isBr
oa
dcast
)
{
endReached
=
true
;
}
}
else
{
...
...
@@ -2102,7 +2104,7 @@ public class ChatActivity extends BaseFragment implements NotificationCenter.Not
if
(
currentChat
!=
null
&&
chatId
==
currentChat
.
id
)
{
info
=
(
TLRPC
.
ChatParticipants
)
args
[
1
];
updateOnlineCount
();
if
(
isBr
ao
dcast
)
{
if
(
isBr
oa
dcast
)
{
SendMessagesHelper
.
getInstance
().
setCurrentChatInfo
(
info
);
}
}
...
...
@@ -2386,7 +2388,7 @@ public class ChatActivity extends BaseFragment implements NotificationCenter.Not
AndroidUtilities
.
RunOnUIThread
(
new
Runnable
()
{
@Override
public
void
run
()
{
openVideoEditor
(
startVideoEdit
,
false
,
parentLayout
);
openVideoEditor
(
startVideoEdit
,
false
);
startVideoEdit
=
null
;
}
});
...
...
@@ -2501,6 +2503,9 @@ public class ChatActivity extends BaseFragment implements NotificationCenter.Not
}
else
if
(
v
instanceof
ChatActionCell
)
{
message
=
((
ChatActionCell
)
v
).
getMessageObject
();
}
if
(
message
==
null
)
{
return
;
}
final
int
type
=
getMessageType
(
message
);
selectedObject
=
null
;
...
...
@@ -2774,7 +2779,7 @@ public class ChatActivity extends BaseFragment implements NotificationCenter.Not
@Override
public
void
didSelectDialog
(
MessagesActivity
activity
,
long
did
,
boolean
param
)
{
if
(
dialog_id
!=
0
&&
(
forwaringMessage
!=
null
||
!
selectedMessagesIds
.
isEmpty
()))
{
if
(
isBr
ao
dcast
)
{
if
(
isBr
oa
dcast
)
{
param
=
true
;
}
if
(
did
!=
dialog_id
)
{
...
...
@@ -3178,9 +3183,10 @@ public class ChatActivity extends BaseFragment implements NotificationCenter.Not
processRowSelect
(
cell
);
return
;
}
MessageObject
messageObject
=
cell
.
getMessageObject
();
Bundle
args
=
new
Bundle
();
args
.
putInt
(
"user_id"
,
message
.
messageOwner
.
media
.
user_id
);
args
.
putString
(
"phone"
,
message
.
messageOwner
.
media
.
phone_number
);
args
.
putInt
(
"user_id"
,
message
Object
.
messageOwner
.
media
.
user_id
);
args
.
putString
(
"phone"
,
message
Object
.
messageOwner
.
media
.
phone_number
);
presentFragment
(
new
ContactAddActivity
(
args
));
}
...
...
TMessagesProj/src/main/java/org/telegram/ui/LaunchActivity.java
View file @
15ac6cdb
...
...
@@ -661,12 +661,14 @@ public class LaunchActivity extends Activity implements ActionBarLayout.ActionBa
actionBarLayout
.
presentFragment
(
fragment
,
false
,
true
,
true
);
}
if
(!
fragment
.
openVideoEditor
(
videoPath
,
true
,
actionBarLayout
))
{
if
(!
AndroidUtilities
.
isTablet
())
{
actionBarLayout
.
addFragmentToStack
(
fragment
,
actionBarLayout
.
fragmentsStack
.
size
()
-
1
);
}
if
(!
fragment
.
openVideoEditor
(
videoPath
,
true
))
{
if
(!
AndroidUtilities
.
isTablet
())
{
actionBarLayout
.
presentFragment
(
fragment
,
true
);
messageFragment
.
finishFragment
(
true
);
}
}
else
if
(!
AndroidUtilities
.
isTablet
())
{
actionBarLayout
.
addFragmentToStack
(
fragment
,
actionBarLayout
.
fragmentsStack
.
size
()
-
1
);
}
}
else
{
actionBarLayout
.
presentFragment
(
fragment
,
true
);
...
...
TMessagesProj/src/main/java/org/telegram/ui/Views/NumberPicker.java
View file @
15ac6cdb
...
...
@@ -166,7 +166,7 @@ public class NumberPicker extends LinearLayout {
mInputText
.
setLayoutParams
(
new
LinearLayout
.
LayoutParams
(
ViewGroup
.
LayoutParams
.
MATCH_PARENT
,
ViewGroup
.
LayoutParams
.
WRAP_CONTENT
));
mInputText
.
setGravity
(
Gravity
.
CENTER
);
mInputText
.
setSingleLine
(
true
);
mInputText
.
setBackground
(
null
);
mInputText
.
setBackground
Resource
(
0
);
mInputText
.
setTextSize
(
TypedValue
.
COMPLEX_UNIT_SP
,
18
);
ViewConfiguration
configuration
=
ViewConfiguration
.
get
(
context
);
...
...
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