Skip to content

Commit c44ea3c

Browse files
committed
Merge branch 'master' into update-initiate-func
2 parents 4e2f691 + 2accf3a commit c44ea3c

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

85 files changed

+505
-183
lines changed

package.json

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"name": "@commt/rn-sdk",
33
"version": "0.0.2",
44
"description": "Ultimate chat plugin for react native applications",
5-
"main": "index.tsx",
5+
"main": "src/index.tsx",
66
"scripts": {
77
"test": "echo \"Error: no test specified\" && exit 1"
88
},
@@ -42,8 +42,12 @@
4242
"react-native-chat-plugin"
4343
],
4444
"contributors": [
45-
{"name": "Mesut KILINCASLAN"},
46-
{"name": "Sedanur AKÇİL"}
45+
{
46+
"name": "Mesut KILINCASLAN"
47+
},
48+
{
49+
"name": "Sedanur AKÇİL"
50+
}
4751
],
4852
"bugs": {
4953
"url": "https://github.com/commt/rn-sdk.git/issues"
File renamed without changes.
Lines changed: 43 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ const Chat = ({
4747
rooms,
4848
messages,
4949
app: {
50-
configs: { indicators, tenantId },
50+
configs: { indicators, tenantId, apiKey, subscriptionKey, projectName },
5151
},
5252
},
5353
dispatch,
@@ -86,21 +86,39 @@ const Chat = ({
8686
activeRoom?.lastMessage?.user?._id !== selfUser?._id
8787
) {
8888
// Update the room's lastMessageReadToken field
89-
sendReadToken({
90-
token: dayjs().valueOf(),
91-
chatRoomAuthId: activeRoom.chatRoomAuthId,
92-
});
89+
sendReadToken(
90+
{
91+
token: dayjs().valueOf(),
92+
chatRoomAuthId: activeRoom.chatRoomAuthId,
93+
},
94+
//handle Log params
95+
{
96+
apiKey,
97+
subscriptionKey,
98+
projectName,
99+
chatAuthId: selfUser!.chatAuthId,
100+
},
101+
);
93102
}
94103
}, [indicators, activeRoom?.lastMessage]);
95104

96105
const typingStatus = (isTyping: boolean) => {
97106
selfUser &&
98107
activeRoom &&
99-
sendTypingStatus({
100-
isTyping,
101-
userId: selfUser._id,
102-
chatRoomAuthId: activeRoom.chatRoomAuthId,
103-
});
108+
sendTypingStatus(
109+
{
110+
isTyping,
111+
userId: selfUser._id,
112+
chatRoomAuthId: activeRoom.chatRoomAuthId,
113+
},
114+
//handle Log params
115+
{
116+
apiKey,
117+
subscriptionKey,
118+
projectName,
119+
chatAuthId: selfUser!.chatAuthId,
120+
},
121+
);
104122
isAlreadyTypingRef.current = isTyping;
105123
};
106124

@@ -180,11 +198,21 @@ const Chat = ({
180198
tenantId,
181199
};
182200
// Create new room with socket event
183-
createNewRoom(data, (room) => {
184-
setActiveRoom(room);
185-
addRoom(room)(dispatch);
186-
sendMessage(message, room);
187-
});
201+
createNewRoom(
202+
data,
203+
(room) => {
204+
setActiveRoom(room);
205+
addRoom(room)(dispatch);
206+
sendMessage(message, room);
207+
},
208+
//handle Log params
209+
{
210+
apiKey,
211+
subscriptionKey,
212+
projectName,
213+
chatAuthId: selfUser!.chatAuthId,
214+
},
215+
);
188216
}
189217
} else {
190218
// if room exist send message

0 commit comments

Comments
 (0)