Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
L
linkedin
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Container Registry
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
mautrix
linkedin
Commits
51b906cd
Unverified
Commit
51b906cd
authored
2 weeks ago
by
Sumner Evans
Browse files
Options
Downloads
Patches
Plain Diff
connector/client: only sync chats on first connection
Signed-off-by:
Sumner Evans
<
sumner.evans@automattic.com
>
parent
cca17856
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Pipeline
#16595
passed
2 weeks ago
Stage: build
Stage: build docker
Stage: manifest
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
pkg/connector/client.go
+10
-4
10 additions, 4 deletions
pkg/connector/client.go
pkg/connector/sync.go
+0
-1
0 additions, 1 deletion
pkg/connector/sync.go
with
10 additions
and
5 deletions
pkg/connector/client.go
+
10
−
4
View file @
51b906cd
...
@@ -42,6 +42,8 @@ type LinkedInClient struct {
...
@@ -42,6 +42,8 @@ type LinkedInClient struct {
userLogin
*
bridgev2
.
UserLogin
userLogin
*
bridgev2
.
UserLogin
client
*
linkedingo
.
Client
client
*
linkedingo
.
Client
firstConnection
bool
linkedinFmtParams
linkedinfmt
.
FormatParams
linkedinFmtParams
linkedinfmt
.
FormatParams
matrixParser
*
matrixfmt
.
HTMLParser
matrixParser
*
matrixfmt
.
HTMLParser
}
}
...
@@ -65,9 +67,10 @@ var (
...
@@ -65,9 +67,10 @@ var (
func
NewLinkedInClient
(
ctx
context
.
Context
,
lc
*
LinkedInConnector
,
login
*
bridgev2
.
UserLogin
)
*
LinkedInClient
{
func
NewLinkedInClient
(
ctx
context
.
Context
,
lc
*
LinkedInConnector
,
login
*
bridgev2
.
UserLogin
)
*
LinkedInClient
{
userID
:=
networkid
.
UserID
(
login
.
ID
)
userID
:=
networkid
.
UserID
(
login
.
ID
)
client
:=
&
LinkedInClient
{
client
:=
&
LinkedInClient
{
main
:
lc
,
main
:
lc
,
userID
:
userID
,
userID
:
userID
,
userLogin
:
login
,
userLogin
:
login
,
firstConnection
:
true
,
}
}
client
.
client
=
linkedingo
.
NewClient
(
client
.
client
=
linkedingo
.
NewClient
(
ctx
,
ctx
,
...
@@ -80,7 +83,10 @@ func NewLinkedInClient(ctx context.Context, lc *LinkedInConnector, login *bridge
...
@@ -80,7 +83,10 @@ func NewLinkedInClient(ctx context.Context, lc *LinkedInConnector, login *bridge
ClientConnection
:
func
(
context
.
Context
,
*
linkedingo
.
ClientConnection
)
{
ClientConnection
:
func
(
context
.
Context
,
*
linkedingo
.
ClientConnection
)
{
login
.
BridgeState
.
Send
(
status
.
BridgeState
{
StateEvent
:
status
.
StateConnected
})
login
.
BridgeState
.
Send
(
status
.
BridgeState
{
StateEvent
:
status
.
StateConnected
})
go
client
.
syncConversations
(
ctx
)
if
client
.
firstConnection
{
go
client
.
syncConversations
(
ctx
)
client
.
firstConnection
=
false
}
},
},
TransientDisconnect
:
client
.
onTransientDisconnect
,
TransientDisconnect
:
client
.
onTransientDisconnect
,
BadCredentials
:
client
.
onBadCredentials
,
BadCredentials
:
client
.
onBadCredentials
,
...
...
This diff is collapsed.
Click to expand it.
pkg/connector/sync.go
+
0
−
1
View file @
51b906cd
...
@@ -10,7 +10,6 @@ import (
...
@@ -10,7 +10,6 @@ import (
"maunium.net/go/mautrix/bridgev2/simplevent"
"maunium.net/go/mautrix/bridgev2/simplevent"
)
)
// TODO limits
func
(
l
*
LinkedInClient
)
syncConversations
(
ctx
context
.
Context
)
{
func
(
l
*
LinkedInClient
)
syncConversations
(
ctx
context
.
Context
)
{
log
:=
zerolog
.
Ctx
(
ctx
)
.
With
()
.
Str
(
"action"
,
"sync_conversations"
)
.
Logger
()
log
:=
zerolog
.
Ctx
(
ctx
)
.
With
()
.
Str
(
"action"
,
"sync_conversations"
)
.
Logger
()
log
.
Info
()
.
Msg
(
"starting conversation sync"
)
log
.
Info
()
.
Msg
(
"starting conversation sync"
)
...
...
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