Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
Krishna Vemulavada
/
vera_2.1_app
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
9fc4c326
authored
Apr 17, 2018
by
Kunj Gupta
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
Added - User id and email for authrozation and each request.
parent
7e1fac5c
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
1 deletions
app/src/main/java/com/vsoft/servicenow/ui/ChatActivity.java
app/src/main/java/com/vsoft/servicenow/ui/ChatActivity.java
View file @
9fc4c326
...
@@ -62,6 +62,9 @@ public class ChatActivity extends HandleNotificationActivity implements OnDSList
...
@@ -62,6 +62,9 @@ public class ChatActivity extends HandleNotificationActivity implements OnDSList
private
static
String
NEW_MESSAGE_MESSAGE
=
"message"
;
private
static
String
NEW_MESSAGE_MESSAGE
=
"message"
;
private
static
String
IS_END_OF_INTENT
=
"is_end_of_intent"
;
private
static
String
IS_END_OF_INTENT
=
"is_end_of_intent"
;
private
static
String
CLIENT_MESSAGE_KEY
=
"message"
;
private
static
String
CLIENT_MAIL_KEY
=
"user_email"
;
private
static
final
int
CHECK_CODE
=
102
;
private
static
final
int
CHECK_CODE
=
102
;
private
RecyclerView
mMessagesView
;
private
RecyclerView
mMessagesView
;
...
@@ -251,7 +254,16 @@ public class ChatActivity extends HandleNotificationActivity implements OnDSList
...
@@ -251,7 +254,16 @@ public class ChatActivity extends HandleNotificationActivity implements OnDSList
addMessage
(
mLoggedInUsername
,
message
);
addMessage
(
mLoggedInUsername
,
message
);
// perform the sending message attempt.
// perform the sending message attempt.
mSocket
.
emit
(
NEW_MESSAGE
,
message
);
JSONObject
jsonObject
=
new
JSONObject
();
try
{
jsonObject
.
put
(
CLIENT_MESSAGE_KEY
,
message
);
jsonObject
.
put
(
CLIENT_MAIL_KEY
,
PrefManager
.
getSharedPref
(
this
,
PrefManager
.
PREFERENCE_USER_EMAIL_ID
));
}
catch
(
JSONException
e
)
{
e
.
printStackTrace
();
}
CatalogueLog
.
e
(
"jsonObject: "
+
jsonObject
);
mSocket
.
emit
(
NEW_MESSAGE
,
jsonObject
);
}
}
private
void
scrollToBottom
()
{
private
void
scrollToBottom
()
{
...
@@ -397,6 +409,8 @@ public class ChatActivity extends HandleNotificationActivity implements OnDSList
...
@@ -397,6 +409,8 @@ public class ChatActivity extends HandleNotificationActivity implements OnDSList
private
void
userAuthenticateTask
()
{
private
void
userAuthenticateTask
()
{
String
token
=
"token"
;
String
token
=
"token"
;
String
url
=
"url"
;
String
url
=
"url"
;
String
userEmail
=
"user_email"
;
String
userId
=
"user_id"
;
String
authentication
=
"authentication"
;
String
authentication
=
"authentication"
;
CatalogueLog
.
e
(
"USER IS TRYING TO MAKING AUTHORIZED CONNECTION"
);
CatalogueLog
.
e
(
"USER IS TRYING TO MAKING AUTHORIZED CONNECTION"
);
...
@@ -417,6 +431,8 @@ public class ChatActivity extends HandleNotificationActivity implements OnDSList
...
@@ -417,6 +431,8 @@ public class ChatActivity extends HandleNotificationActivity implements OnDSList
try
{
try
{
jsonObject
.
put
(
token
,
"Bearer "
+
accessToken
);
jsonObject
.
put
(
token
,
"Bearer "
+
accessToken
);
jsonObject
.
put
(
url
,
userDetailURL
);
jsonObject
.
put
(
url
,
userDetailURL
);
jsonObject
.
put
(
userId
,
PrefManager
.
getSharedPref
(
ChatActivity
.
this
,
PrefManager
.
PREFERENCE_USER_ID
));
jsonObject
.
put
(
userEmail
,
PrefManager
.
getSharedPref
(
ChatActivity
.
this
,
PrefManager
.
PREFERENCE_USER_EMAIL_ID
));
CatalogueLog
.
e
(
jsonObject
.
toString
());
CatalogueLog
.
e
(
jsonObject
.
toString
());
}
catch
(
JSONException
e
)
{
}
catch
(
JSONException
e
)
{
CatalogueLog
.
e
(
"userAuthenticateTask: JSONException: "
+
e
.
toString
());
CatalogueLog
.
e
(
"userAuthenticateTask: JSONException: "
+
e
.
toString
());
...
...
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