Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
R
Rocket.Chat
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Package Registry
Model registry
Operate
Terraform modules
Analyze
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
RocketChat
Rocket.Chat
Commits
f0025d4d
Unverified
Commit
f0025d4d
authored
1 year ago
by
Douglas Gubert
Committed by
GitHub
1 year ago
Browse files
Options
Downloads
Patches
Plain Diff
fix: Livechat message fetching method in LivechatBridge (#30000)
parent
cbad71ba
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
.changeset/good-elephants-live.md
+5
-0
5 additions, 0 deletions
.changeset/good-elephants-live.md
apps/meteor/app/apps/server/bridges/livechat.ts
+4
-4
4 additions, 4 deletions
apps/meteor/app/apps/server/bridges/livechat.ts
with
9 additions
and
4 deletions
.changeset/good-elephants-live.md
0 → 100644
+
5
−
0
View file @
f0025d4d
---
'
@rocket.chat/meteor'
:
patch
---
Fixed message fetching method in LivechatBridge for Apps
This diff is collapsed.
Click to expand it.
apps/meteor/app/apps/server/bridges/livechat.ts
+
4
−
4
View file @
f0025d4d
...
@@ -6,7 +6,7 @@ import type {
...
@@ -6,7 +6,7 @@ import type {
ILivechatTransferData
,
ILivechatTransferData
,
IDepartment
,
IDepartment
,
}
from
'
@rocket.chat/apps-engine/definition/livechat
'
;
}
from
'
@rocket.chat/apps-engine/definition/livechat
'
;
import
type
{
IMessage
}
from
'
@rocket.chat/apps-engine/definition/messages
'
;
import
type
{
IMessage
as
IAppsEngineMesage
}
from
'
@rocket.chat/apps-engine/definition/messages
'
;
import
type
{
IUser
}
from
'
@rocket.chat/apps-engine/definition/users
'
;
import
type
{
IUser
}
from
'
@rocket.chat/apps-engine/definition/users
'
;
import
{
LivechatBridge
}
from
'
@rocket.chat/apps-engine/server/bridges/LivechatBridge
'
;
import
{
LivechatBridge
}
from
'
@rocket.chat/apps-engine/server/bridges/LivechatBridge
'
;
import
type
{
SelectedAgent
}
from
'
@rocket.chat/core-typings
'
;
import
type
{
SelectedAgent
}
from
'
@rocket.chat/core-typings
'
;
...
@@ -280,7 +280,7 @@ export class AppLivechatBridge extends LivechatBridge {
...
@@ -280,7 +280,7 @@ export class AppLivechatBridge extends LivechatBridge {
return
Promise
.
all
((
await
LivechatDepartment
.
findEnabledWithAgents
().
toArray
()).
map
(
boundConverter
));
return
Promise
.
all
((
await
LivechatDepartment
.
findEnabledWithAgents
().
toArray
()).
map
(
boundConverter
));
}
}
protected
async
_fetchLivechatRoomMessages
(
appId
:
string
,
roomId
:
string
):
Promise
<
Array
<
IMes
s
age
>>
{
protected
async
_fetchLivechatRoomMessages
(
appId
:
string
,
roomId
:
string
):
Promise
<
Array
<
I
AppsEngine
Mesage
>>
{
this
.
orch
.
debugLog
(
`The App
${
appId
}
is getting the transcript for livechat room
${
roomId
}
.`
);
this
.
orch
.
debugLog
(
`The App
${
appId
}
is getting the transcript for livechat room
${
roomId
}
.`
);
const
messageConverter
=
this
.
orch
.
getConverters
()?.
get
(
'
messages
'
);
const
messageConverter
=
this
.
orch
.
getConverters
()?.
get
(
'
messages
'
);
...
@@ -288,9 +288,9 @@ export class AppLivechatBridge extends LivechatBridge {
...
@@ -288,9 +288,9 @@ export class AppLivechatBridge extends LivechatBridge {
throw
new
Error
(
'
Could not get the message converter to process livechat room messages
'
);
throw
new
Error
(
'
Could not get the message converter to process livechat room messages
'
);
}
}
const
boundMessageConverter
=
messageConverter
.
convertMessage
.
bind
(
messageConverter
);
const
livechatMessages
=
await
Livechat
.
getRoomMessages
({
rid
:
roomId
}
);
return
(
await
Livechat
.
getRoomMessages
({
rid
:
roomId
})).
map
(
boundMessageConverter
);
return
Promise
.
all
(
livechatMessages
.
map
((
message
)
=>
messageConverter
.
convertMessage
(
message
)
as
Promise
<
IAppsEngineMesage
>
)
);
}
}
protected
async
setCustomFields
(
protected
async
setCustomFields
(
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment