Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
jami-daemon
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
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
savoirfairelinux
jami-daemon
Commits
7f5fa093
Commit
7f5fa093
authored
1 year ago
by
Sébastien Blin
Browse files
Options
Downloads
Patches
Plain Diff
typers: do not emit message for remote device
Change-Id: I6c783563a0a58327012a3e2889ea78ea6c595d89
parent
a07f0b39
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
src/jamidht/typers.cpp
+11
-8
11 additions, 8 deletions
src/jamidht/typers.cpp
src/jamidht/typers.h
+7
-2
7 additions, 2 deletions
src/jamidht/typers.h
with
18 additions
and
10 deletions
src/jamidht/typers.cpp
+
11
−
8
View file @
7f5fa093
...
...
@@ -55,7 +55,7 @@ getIsComposing(const std::string& conversationId, bool isWriting)
}
void
Typers
::
addTyper
(
const
std
::
string
&
typer
)
Typers
::
addTyper
(
const
std
::
string
&
typer
,
bool
sendMessage
)
{
auto
acc
=
acc_
.
lock
();
if
(
!
acc
||
!
acc
->
isComposingEnabled
())
...
...
@@ -73,27 +73,30 @@ Typers::addTyper(const std::string &typer)
if
(
typer
!=
selfUri_
)
emitSignal
<
libjami
::
ConfigurationSignal
::
ComposingStatusChanged
>
(
accountId_
,
convId_
,
typer
,
1
);
convId_
,
typer
,
1
);
return
;
}
if
(
typer
==
selfUri_
)
{
if
(
sendMessage
)
{
// In this case we should emit for remote to update the timer
acc
->
sendInstantMessage
(
convId_
,
{{
MIME_TYPE_IM_COMPOSING
,
getIsComposing
(
convId_
,
true
)}});
}
}
void
Typers
::
removeTyper
(
const
std
::
string
&
typer
)
Typers
::
removeTyper
(
const
std
::
string
&
typer
,
bool
sendMessage
)
{
auto
acc
=
acc_
.
lock
();
if
(
!
acc
||
!
acc
->
isComposingEnabled
())
return
;
if
(
watcher_
.
erase
(
typer
))
{
if
(
typer
==
selfUri_
)
{
if
(
sendMessage
)
{
acc
->
sendInstantMessage
(
convId_
,
{{
MIME_TYPE_IM_COMPOSING
,
getIsComposing
(
convId_
,
false
)}});
}
else
{
}
if
(
typer
!=
selfUri_
)
{
emitSignal
<
libjami
::
ConfigurationSignal
::
ComposingStatusChanged
>
(
accountId_
,
convId_
,
typer
,
...
...
This diff is collapsed.
Click to expand it.
src/jamidht/typers.h
+
7
−
2
View file @
7f5fa093
...
...
@@ -34,8 +34,13 @@ public:
Typers
(
const
std
::
shared_ptr
<
JamiAccount
>&
acc
,
const
std
::
string
&
convId
);
~
Typers
();
void
addTyper
(
const
std
::
string
&
typer
);
void
removeTyper
(
const
std
::
string
&
typer
);
/**
* Add typer to the list of typers
* @param typer
* @param sendMessage (should be true for local typer, false for remote typer)
*/
void
addTyper
(
const
std
::
string
&
typer
,
bool
sendMessage
=
false
);
void
removeTyper
(
const
std
::
string
&
typer
,
bool
sendMessage
=
false
);
private:
void
onTyperTimeout
(
const
asio
::
error_code
&
ec
,
const
std
::
string
&
typer
);
...
...
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