Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
A
anonymous-chat
Manage
Activity
Members
Labels
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Package registry
Model registry
Operate
Terraform modules
Analyze
Contributor analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
This is an archived project. Repository and other project resources are read-only.
Show more breadcrumbs
archives
Shielded Help Demo
anonymous-chat
Commits
324ba15b
Commit
324ba15b
authored
Jul 27, 2022
by
Jono Wenger
Browse files
Options
Downloads
Patches
Plain Diff
Make chats show up when a connection is made and not when the initial message is received
parent
d5e85769
No related branches found
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
cmd/utils.go
+1
-1
1 addition, 1 deletion
cmd/utils.go
ui/chats.go
+3
-0
3 additions, 0 deletions
ui/chats.go
with
4 additions
and
1 deletion
cmd/utils.go
+
1
−
1
View file @
324ba15b
...
@@ -59,7 +59,7 @@ func runTestUI() {
...
@@ -59,7 +59,7 @@ func runTestUI() {
l1
.
Hear
(
receive
.
Message
{
l1
.
Hear
(
receive
.
Message
{
MessageType
:
1
,
MessageType
:
1
,
ID
:
cryptoE2e
.
MessageID
{},
ID
:
cryptoE2e
.
MessageID
{},
Payload
:
[]
byte
(
"
My name is Sally. 1 abortion please!
"
),
Payload
:
[]
byte
(
"
Hello this is a test.
"
),
Sender
:
partnerID
,
Sender
:
partnerID
,
RecipientID
:
myID
,
RecipientID
:
myID
,
Timestamp
:
netTime
.
Now
(),
Timestamp
:
netTime
.
Now
(),
...
...
This diff is collapsed.
Click to expand it.
ui/chats.go
+
3
−
0
View file @
324ba15b
...
@@ -56,6 +56,9 @@ func (cs *Chats) Add(receivedMsgChan chan []byte, sendFn SendMessage,
...
@@ -56,6 +56,9 @@ func (cs *Chats) Add(receivedMsgChan chan []byte, sendFn SendMessage,
maxMessageLen
:
maxMessageLen
,
maxMessageLen
:
maxMessageLen
,
unread
:
true
,
unread
:
true
,
}
}
cs
.
updateFeed
<-
struct
{}{}
go
cs
.
UpdateChatList
(
cs
.
nextIndex
)
go
cs
.
chats
[
cs
.
nextIndex
]
.
updateChatFeed
(
cs
.
updateFeed
,
cs
.
UpdateChatList
)
go
cs
.
chats
[
cs
.
nextIndex
]
.
updateChatFeed
(
cs
.
updateFeed
,
cs
.
UpdateChatList
)
cs
.
nextIndex
++
cs
.
nextIndex
++
}
}
...
...
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