Skip to content
GitLab
Explore
Sign in
Register
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
a7a84201
Commit
a7a84201
authored
2 years ago
by
Io Daza-Dillon
Committed by
Adrien Béraud
2 years ago
Browse files
Options
Downloads
Patches
Plain Diff
nodejs: add composing indicators
Change-Id: I3a1109e0acc64aed296abe19a198d71253cd4364
parent
b16308ea
No related branches found
No related tags found
No related merge requests found
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
bin/nodejs/callback.h
+25
-0
25 additions, 0 deletions
bin/nodejs/callback.h
bin/nodejs/configurationmanager.i
+3
-0
3 additions, 0 deletions
bin/nodejs/configurationmanager.i
bin/nodejs/nodejs_interface.i
+1
-0
1 addition, 0 deletions
bin/nodejs/nodejs_interface.i
with
29 additions
and
0 deletions
bin/nodejs/callback.h
+
25
−
0
View file @
a7a84201
...
@@ -12,6 +12,7 @@ using namespace v8;
...
@@ -12,6 +12,7 @@ using namespace v8;
Persistent
<
Function
>
accountsChangedCb
;
Persistent
<
Function
>
accountsChangedCb
;
Persistent
<
Function
>
accountDetailsChangedCb
;
Persistent
<
Function
>
accountDetailsChangedCb
;
Persistent
<
Function
>
registrationStateChangedCb
;
Persistent
<
Function
>
registrationStateChangedCb
;
Persistent
<
Function
>
composingStatusChangedCb
;
Persistent
<
Function
>
volatileDetailsChangedCb
;
Persistent
<
Function
>
volatileDetailsChangedCb
;
Persistent
<
Function
>
incomingAccountMessageCb
;
Persistent
<
Function
>
incomingAccountMessageCb
;
Persistent
<
Function
>
accountMessageStatusChangedCb
;
Persistent
<
Function
>
accountMessageStatusChangedCb
;
...
@@ -56,6 +57,8 @@ getPresistentCb(std::string_view signal)
...
@@ -56,6 +57,8 @@ getPresistentCb(std::string_view signal)
return
&
accountDetailsChangedCb
;
return
&
accountDetailsChangedCb
;
else
if
(
signal
==
"RegistrationStateChanged"
)
else
if
(
signal
==
"RegistrationStateChanged"
)
return
&
registrationStateChangedCb
;
return
&
registrationStateChangedCb
;
else
if
(
signal
==
"ComposingStatusChanged"
)
return
&
composingStatusChangedCb
;
else
if
(
signal
==
"VolatileDetailsChanged"
)
else
if
(
signal
==
"VolatileDetailsChanged"
)
return
&
volatileDetailsChangedCb
;
return
&
volatileDetailsChangedCb
;
else
if
(
signal
==
"IncomingAccountMessage"
)
else
if
(
signal
==
"IncomingAccountMessage"
)
...
@@ -226,6 +229,28 @@ registrationStateChanged(const std::string& accountId,
...
@@ -226,6 +229,28 @@ registrationStateChanged(const std::string& accountId,
uv_async_send
(
&
signalAsync
);
uv_async_send
(
&
signalAsync
);
}
}
void
composingStatusChanged
(
const
std
::
string
&
accountId
,
const
std
::
string
&
conversationId
,
const
std
::
string
&
from
,
int
state
)
{
std
::
lock_guard
<
std
::
mutex
>
lock
(
pendingSignalsLock
);
pendingSignals
.
emplace
([
accountId
,
conversationId
,
from
,
state
]()
{
Local
<
Function
>
func
=
Local
<
Function
>::
New
(
Isolate
::
GetCurrent
(),
composingStatusChangedCb
);
if
(
!
func
.
IsEmpty
())
{
SWIGV8_VALUE
callback_args
[]
=
{
V8_STRING_NEW_LOCAL
(
accountId
),
V8_STRING_NEW_LOCAL
(
conversationId
),
V8_STRING_NEW_LOCAL
(
from
),
SWIGV8_INTEGER_NEW
(
state
)};
func
->
Call
(
SWIGV8_CURRENT_CONTEXT
(),
SWIGV8_NULL
(),
4
,
callback_args
);
}
});
uv_async_send
(
&
signalAsync
);
}
void
void
volatileDetailsChanged
(
const
std
::
string
&
accountId
,
volatileDetailsChanged
(
const
std
::
string
&
accountId
,
const
std
::
map
<
std
::
string
,
std
::
string
>&
details
)
const
std
::
map
<
std
::
string
,
std
::
string
>&
details
)
...
...
This diff is collapsed.
Click to expand it.
bin/nodejs/configurationmanager.i
+
3
−
0
View file @
a7a84201
...
@@ -35,6 +35,7 @@ public:
...
@@ -35,6 +35,7 @@ public:
virtual
void
incomingAccountMessage
(
const
std
::
string&
/*account_id*/
,
const
std
::
string&
/*from*/
,
const
std
::
map
<
std
::
string
,
std
::
string
>
&
/*payload*/
)
{}
virtual
void
incomingAccountMessage
(
const
std
::
string&
/*account_id*/
,
const
std
::
string&
/*from*/
,
const
std
::
map
<
std
::
string
,
std
::
string
>
&
/*payload*/
)
{}
virtual
void
accountMessageStatusChanged
(
const
std
::
string&
/*account_id*/
,
const
std
::
string&
/*conversationId*/
,
const
std
::
string&
/*peer*/
,
const
std
::
string&
/*message_id*/
,
int
/*state*/
)
{}
virtual
void
accountMessageStatusChanged
(
const
std
::
string&
/*account_id*/
,
const
std
::
string&
/*conversationId*/
,
const
std
::
string&
/*peer*/
,
const
std
::
string&
/*message_id*/
,
int
/*state*/
)
{}
virtual
void
profileReceived
(
const
std
::
string&
/*account_id*/
,
const
std
::
string&
/*from*/
,
const
std
::
string&
/*path*/
)
{}
virtual
void
profileReceived
(
const
std
::
string&
/*account_id*/
,
const
std
::
string&
/*from*/
,
const
std
::
string&
/*path*/
)
{}
virtual
void
composingStatusChanged
(
const
std
::
string&
/*account_id*/
,
const
std
::
string&
/*convId*/
,
const
std
::
string&
/*from*/
,
int
/*state*/
)
{}
virtual
void
knownDevicesChanged
(
const
std
::
string&
/*account_id*/
,
const
std
::
map
<
std
::
string
,
std
::
string
>
&
/*devices*/
)
{}
virtual
void
knownDevicesChanged
(
const
std
::
string&
/*account_id*/
,
const
std
::
map
<
std
::
string
,
std
::
string
>
&
/*devices*/
)
{}
virtual
void
exportOnRingEnded
(
const
std
::
string&
/*account_id*/
,
int
/*state*/
,
const
std
::
string&
/*pin*/
)
{}
virtual
void
exportOnRingEnded
(
const
std
::
string&
/*account_id*/
,
int
/*state*/
,
const
std
::
string&
/*pin*/
)
{}
...
@@ -91,6 +92,7 @@ std::vector<Message> getLastMessages(const std::string& accountID, const uint64_
...
@@ -91,6 +92,7 @@ std::vector<Message> getLastMessages(const std::string& accountID, const uint64_
int getMessageStatus(uint64_t id);
int getMessageStatus(uint64_t id);
int getMessageStatus(const std::string& accountID, uint64_t id);
int getMessageStatus(const std::string& accountID, uint64_t id);
bool cancelMessage(const std::string& accountID, uint64_t id);
bool cancelMessage(const std::string& accountID, uint64_t id);
void setIsComposing(const std::string& accountID, const std::string& conversationUri, bool isWriting);
bool setMessageDisplayed(const std::string& accountID, const std::string& conversationUri, const std::string& messageId, int status);
bool setMessageDisplayed(const std::string& accountID, const std::string& conversationUri, const std::string& messageId, int status);
bool lookupName(const std::string& account, const std::string& nameserver, const std::string& name);
bool lookupName(const std::string& account, const std::string& nameserver, const std::string& name);
bool lookupAddress(const std::string& account, const std::string& nameserver, const std::string& address);
bool lookupAddress(const std::string& account, const std::string& nameserver, const std::string& address);
...
@@ -231,6 +233,7 @@ public:
...
@@ -231,6 +233,7 @@ public:
virtual
void
incomingAccountMessage
(
const
std
::
string&
/*account_id*/
,
const
std
::
string&
/*from*/
,
const
std
::
map
<
std
::
string
,
std
::
string
>
&
/*payload*/
)
{}
virtual
void
incomingAccountMessage
(
const
std
::
string&
/*account_id*/
,
const
std
::
string&
/*from*/
,
const
std
::
map
<
std
::
string
,
std
::
string
>
&
/*payload*/
)
{}
virtual
void
accountMessageStatusChanged
(
const
std
::
string&
/*account_id*/
,
const
std
::
string&
/*conversationId*/
,
const
std
::
string&
/*peer*/
,
const
std
::
string&
/*message_id*/
,
int
/*state*/
)
{}
virtual
void
accountMessageStatusChanged
(
const
std
::
string&
/*account_id*/
,
const
std
::
string&
/*conversationId*/
,
const
std
::
string&
/*peer*/
,
const
std
::
string&
/*message_id*/
,
int
/*state*/
)
{}
virtual
void
profileReceived
(
const
std
::
string&
/*account_id*/
,
const
std
::
string&
/*from*/
,
const
std
::
string&
/*path*/
)
{}
virtual
void
profileReceived
(
const
std
::
string&
/*account_id*/
,
const
std
::
string&
/*from*/
,
const
std
::
string&
/*path*/
)
{}
virtual
void
composingStatusChanged
(
const
std
::
string&
/*account_id*/
,
const
std
::
string&
/*convId*/
,
const
std
::
string&
/*from*/
,
int
/*state*/
)
{}
virtual
void
knownDevicesChanged
(
const
std
::
string&
/*account_id*/
,
const
std
::
map
<
std
::
string
,
std
::
string
>
&
/*devices*/
)
{}
virtual
void
knownDevicesChanged
(
const
std
::
string&
/*account_id*/
,
const
std
::
map
<
std
::
string
,
std
::
string
>
&
/*devices*/
)
{}
virtual
void
exportOnRingEnded
(
const
std
::
string&
/*account_id*/
,
int
/*state*/
,
const
std
::
string&
/*pin*/
)
{}
virtual
void
exportOnRingEnded
(
const
std
::
string&
/*account_id*/
,
int
/*state*/
,
const
std
::
string&
/*pin*/
)
{}
...
...
This diff is collapsed.
Click to expand it.
bin/nodejs/nodejs_interface.i
+
1
−
0
View file @
a7a84201
...
@@ -131,6 +131,7 @@ void init(const SWIGV8_VALUE& funcMap){
...
@@ -131,6 +131,7 @@ void init(const SWIGV8_VALUE& funcMap){
exportable_callback<ConfigurationSignal::AccountsChanged>(bind(&accountsChanged)),
exportable_callback<ConfigurationSignal::AccountsChanged>(bind(&accountsChanged)),
exportable_callback<ConfigurationSignal::AccountDetailsChanged>(bind(&accountDetailsChanged, _1, _2)),
exportable_callback<ConfigurationSignal::AccountDetailsChanged>(bind(&accountDetailsChanged, _1, _2)),
exportable_callback<ConfigurationSignal::RegistrationStateChanged>(bind(®istrationStateChanged, _1, _2, _3, _4)),
exportable_callback<ConfigurationSignal::RegistrationStateChanged>(bind(®istrationStateChanged, _1, _2, _3, _4)),
exportable_callback<ConfigurationSignal::ComposingStatusChanged>(bind(composingStatusChanged, _1, _2, _3, _4 )),
exportable_callback<ConfigurationSignal::ContactAdded>(bind(&contactAdded, _1, _2, _3 )),
exportable_callback<ConfigurationSignal::ContactAdded>(bind(&contactAdded, _1, _2, _3 )),
exportable_callback<ConfigurationSignal::ContactRemoved>(bind(&contactRemoved, _1, _2, _3 )),
exportable_callback<ConfigurationSignal::ContactRemoved>(bind(&contactRemoved, _1, _2, _3 )),
exportable_callback<ConfigurationSignal::ExportOnRingEnded>(bind(&exportOnRingEnded, _1, _2, _3 )),
exportable_callback<ConfigurationSignal::ExportOnRingEnded>(bind(&exportOnRingEnded, _1, _2, _3 )),
...
...
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