Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
J
jami-client-gnome
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Deploy
Releases
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Issue analytics
Insights
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
savoirfairelinux
jami-client-gnome
Commits
76b9e8f9
Unverified
Commit
76b9e8f9
authored
6 years ago
by
Sébastien Blin
Browse files
Options
Downloads
Patches
Plain Diff
chatview: bufferize messages during chatview creation
Change-Id: I3cf17e7e508c0abf27400839bedf60e7db3e79b5 Gitlab:
#1038
parent
8d988c33
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/chatview.cpp
+31
-9
31 additions, 9 deletions
src/chatview.cpp
with
31 additions
and
9 deletions
src/chatview.cpp
+
31
−
9
View file @
76b9e8f9
...
@@ -40,6 +40,15 @@
...
@@ -40,6 +40,15 @@
// Client
// Client
#include
"utils/files.h"
#include
"utils/files.h"
struct
CppImpl
{
struct
Interaction
{
std
::
string
conv
;
uint64_t
id
;
lrc
::
api
::
interaction
::
Info
info
;
};
std
::
vector
<
Interaction
>
interactionsBuffer_
;
};
struct
_ChatView
struct
_ChatView
{
{
GtkBox
parent
;
GtkBox
parent
;
...
@@ -70,6 +79,9 @@ struct _ChatViewPrivate
...
@@ -70,6 +79,9 @@ struct _ChatViewPrivate
gulong
webkit_ready
;
gulong
webkit_ready
;
gulong
webkit_send_text
;
gulong
webkit_send_text
;
gulong
webkit_drag_drop
;
gulong
webkit_drag_drop
;
bool
ready_
{
false
};
CppImpl
*
cpp_
;
};
};
G_DEFINE_TYPE_WITH_PRIVATE
(
ChatView
,
chat_view
,
GTK_TYPE_BOX
);
G_DEFINE_TYPE_WITH_PRIVATE
(
ChatView
,
chat_view
,
GTK_TYPE_BOX
);
...
@@ -452,8 +464,6 @@ print_text_recording(ChatView *self)
...
@@ -452,8 +464,6 @@ print_text_recording(ChatView *self)
*
(
*
priv
->
accountInfo_
)
->
conversationModel
,
*
(
*
priv
->
accountInfo_
)
->
conversationModel
,
priv
->
conversation_
->
interactions
priv
->
conversation_
->
interactions
);
);
QObject
::
disconnect
(
priv
->
new_interaction_connection
);
}
}
static
void
static
void
...
@@ -472,14 +482,12 @@ webkit_chat_container_ready(ChatView* self)
...
@@ -472,14 +482,12 @@ webkit_chat_container_ready(ChatView* self)
print_text_recording
(
self
);
print_text_recording
(
self
);
load_participants_images
(
self
);
load_participants_images
(
self
);
priv
->
new_interaction_connection
=
QObject
::
connect
(
priv
->
ready_
=
true
;
&*
(
*
priv
->
accountInfo_
)
->
conversationModel
,
&
lrc
::
api
::
ConversationModel
::
newInteraction
,
for
(
const
auto
&
interaction
:
priv
->
cpp_
->
interactionsBuffer_
)
{
[
self
,
priv
](
const
std
::
string
&
uid
,
uint64_t
interactionId
,
lrc
::
api
::
interaction
::
Info
interaction
)
{
if
(
interaction
.
conv
==
priv
->
conversation_
->
uid
)
{
if
(
!
priv
->
conversation_
)
return
;
print_interaction_to_buffer
(
self
,
interaction
.
id
,
interaction
.
info
);
if
(
uid
==
priv
->
conversation_
->
uid
)
{
}
print_interaction_to_buffer
(
self
,
interactionId
,
interaction
);
}
}
});
priv
->
update_interaction_connection
=
QObject
::
connect
(
priv
->
update_interaction_connection
=
QObject
::
connect
(
&*
(
*
priv
->
accountInfo_
)
->
conversationModel
,
&
lrc
::
api
::
ConversationModel
::
interactionStatusUpdated
,
&*
(
*
priv
->
accountInfo_
)
->
conversationModel
,
&
lrc
::
api
::
ConversationModel
::
interactionStatusUpdated
,
...
@@ -641,6 +649,20 @@ build_chat_view(ChatView* self)
...
@@ -641,6 +649,20 @@ build_chat_view(ChatView* self)
self
self
);
);
priv
->
new_interaction_connection
=
QObject
::
connect
(
&*
(
*
priv
->
accountInfo_
)
->
conversationModel
,
&
lrc
::
api
::
ConversationModel
::
newInteraction
,
[
self
,
priv
](
const
std
::
string
&
uid
,
uint64_t
interactionId
,
lrc
::
api
::
interaction
::
Info
interaction
)
{
if
(
!
priv
->
conversation_
)
return
;
if
(
!
priv
->
ready_
&&
priv
->
cpp_
)
{
priv
->
cpp_
->
interactionsBuffer_
.
emplace_back
(
CppImpl
::
Interaction
{
uid
,
interactionId
,
interaction
});
}
else
if
(
uid
==
priv
->
conversation_
->
uid
)
{
print_interaction_to_buffer
(
self
,
interactionId
,
interaction
);
}
});
priv
->
cpp_
=
new
CppImpl
();
if
(
webkit_chat_container_is_ready
(
WEBKIT_CHAT_CONTAINER
(
priv
->
webkit_chat_container
)))
if
(
webkit_chat_container_is_ready
(
WEBKIT_CHAT_CONTAINER
(
priv
->
webkit_chat_container
)))
webkit_chat_container_ready
(
self
);
webkit_chat_container_ready
(
self
);
}
}
...
...
This diff is collapsed.
Click to expand it.
Sébastien Blin
@sblin
mentioned in issue
#1051 (closed)
·
5 years ago
mentioned in issue
#1051 (closed)
mentioned in issue #1051
Toggle commit list
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