Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
biboumi
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
88
Issues
88
List
Boards
Labels
Service Desk
Milestones
Merge Requests
7
Merge Requests
7
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
CI / CD
Repository
Value Stream
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
louiz’
biboumi
Commits
5ec05cb0
Commit
5ec05cb0
authored
May 06, 2014
by
louiz’
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Forward CTCP version request to XMPP
parent
f35db5ce
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
35 additions
and
0 deletions
+35
-0
src/bridge/bridge.cpp
src/bridge/bridge.cpp
+5
-0
src/bridge/bridge.hpp
src/bridge/bridge.hpp
+4
-0
src/irc/irc_client.cpp
src/irc/irc_client.cpp
+2
-0
src/xmpp/xmpp_component.cpp
src/xmpp/xmpp_component.cpp
+19
-0
src/xmpp/xmpp_component.hpp
src/xmpp/xmpp_component.hpp
+5
-0
No files found.
src/bridge/bridge.cpp
View file @
5ec05cb0
...
...
@@ -304,3 +304,8 @@ void Bridge::send_affiliation_role_change(const Iid& iid, const std::string& tar
std
::
tie
(
role
,
affiliation
)
=
get_role_affiliation_from_irc_mode
(
mode
);
this
->
xmpp
->
send_affiliation_role_change
(
iid
.
chan
+
"%"
+
iid
.
server
,
target
,
affiliation
,
role
,
this
->
user_jid
);
}
void
Bridge
::
send_iq_version_request
(
const
std
::
string
&
nick
,
const
std
::
string
&
hostname
)
{
this
->
xmpp
->
send_iq_version_request
(
nick
+
"%"
+
hostname
,
this
->
user_jid
);
}
src/bridge/bridge.hpp
View file @
5ec05cb0
...
...
@@ -99,6 +99,10 @@ public:
* Send a role/affiliation change, matching the change of mode for that user
*/
void
send_affiliation_role_change
(
const
Iid
&
iid
,
const
std
::
string
&
target
,
const
char
mode
);
/**
* Send an iq version request coming from nick%hostname@
*/
void
send_iq_version_request
(
const
std
::
string
&
nick
,
const
std
::
string
&
hostname
);
/**
* Misc
...
...
src/irc/irc_client.cpp
View file @
5ec05cb0
...
...
@@ -348,6 +348,8 @@ void IrcClient::on_channel_message(const IrcMessage& message)
if
(
body
.
substr
(
1
,
6
)
==
"ACTION"
)
this
->
bridge
->
send_message
(
iid
,
nick
,
"/me"
s
+
body
.
substr
(
7
,
body
.
size
()
-
8
),
muc
);
else
if
(
body
.
substr
(
1
,
8
)
==
"VERSION
\01
"
)
this
->
bridge
->
send_iq_version_request
(
nick
,
this
->
hostname
);
}
else
this
->
bridge
->
send_message
(
iid
,
nick
,
body
,
muc
);
...
...
src/xmpp/xmpp_component.cpp
View file @
5ec05cb0
...
...
@@ -28,6 +28,9 @@
#define XHTMLIM_NS "http://jabber.org/protocol/xhtml-im"
#define STANZA_NS "urn:ietf:params:xml:ns:xmpp-stanzas"
#define STREAMS_NS "urn:ietf:params:xml:ns:xmpp-streams"
#define VERSION_NS "jabber:iq:version"
using
namespace
std
::
string_literals
;
unsigned
long
XmppComponent
::
current_id
=
0
;
...
...
@@ -786,6 +789,22 @@ void XmppComponent::send_self_disco_info(const std::string& id, const std::strin
this
->
send_stanza
(
iq
);
}
void
XmppComponent
::
send_iq_version_request
(
const
std
::
string
&
from
,
const
std
::
string
&
jid_to
)
{
Stanza
iq
(
"iq"
);
iq
[
"type"
]
=
"get"
;
iq
[
"id"
]
=
"version_"
s
+
XmppComponent
::
next_id
();
iq
[
"from"
]
=
from
+
"@"
+
this
->
served_hostname
;
iq
[
"to"
]
=
jid_to
;
XmlNode
query
(
"query"
);
query
[
"xmlns"
]
=
VERSION_NS
;
query
.
close
();
iq
.
add_child
(
std
::
move
(
query
));
iq
.
close
();
this
->
send_stanza
(
iq
);
}
std
::
string
XmppComponent
::
next_id
()
{
return
std
::
to_string
(
XmppComponent
::
current_id
++
);
...
...
src/xmpp/xmpp_component.hpp
View file @
5ec05cb0
...
...
@@ -154,6 +154,11 @@ public:
* Send a result IQ with the gateway disco informations.
*/
void
send_self_disco_info
(
const
std
::
string
&
id
,
const
std
::
string
&
jid_to
);
/**
* Send an iq version request
*/
void
send_iq_version_request
(
const
std
::
string
&
from
,
const
std
::
string
&
jid_to
);
/**
* Handle the various stanza types
*/
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment