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
68d6b829
Commit
68d6b829
authored
Apr 09, 2017
by
louiz’
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Properly handle multiline topics
fix #3254
parent
79b24d7e
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
30 additions
and
4 deletions
+30
-4
CHANGELOG.rst
CHANGELOG.rst
+1
-0
doc/biboumi.1.rst
doc/biboumi.1.rst
+7
-0
src/bridge/bridge.cpp
src/bridge/bridge.cpp
+4
-1
src/bridge/bridge.hpp
src/bridge/bridge.hpp
+1
-1
src/utils/string.hpp
src/utils/string.hpp
+0
-2
tests/end_to_end/__main__.py
tests/end_to_end/__main__.py
+17
-0
No files found.
CHANGELOG.rst
View file @
68d6b829
...
...
@@ -11,6 +11,7 @@ Version 5.0
- Use the udns library instead of c-ares, for asynchronous DNS resolution.
It’s still fully optional.
- Update MAM implementation to version 6.0 (namespace mam:2)
- Multiline topics are now properly handled
Version 4.1 - 2017-03-21
========================
...
...
doc/biboumi.1.rst
View file @
68d6b829
...
...
@@ -371,6 +371,13 @@ Notices
Notices are received exactly like private messages. It is not possible to
send a notice.
Topic
-----
The topic can be set and retrieved seemlessly. The unique difference is that
if an XMPP user tries to set a multiline topic, every line return (\n) will
be replaced by a space, because the IRC wouldn’t accept it.
Invitations
-----------
...
...
src/bridge/bridge.cpp
View file @
68d6b829
...
...
@@ -684,9 +684,12 @@ void Bridge::send_irc_kick(const Iid& iid, const std::string& target, const std:
this
->
add_waiting_irc
(
std
::
move
(
cb
));
}
void
Bridge
::
set_channel_topic
(
const
Iid
&
iid
,
const
std
::
string
&
subject
)
void
Bridge
::
set_channel_topic
(
const
Iid
&
iid
,
std
::
string
subject
)
{
IrcClient
*
irc
=
this
->
get_irc_client
(
iid
.
get_server
());
std
::
string
::
size_type
pos
{
0
};
while
((
pos
=
subject
.
find
(
'\n'
,
pos
))
!=
std
::
string
::
npos
)
subject
[
pos
]
=
' '
;
irc
->
send_topic_command
(
iid
.
get_local
(),
subject
);
}
...
...
src/bridge/bridge.hpp
View file @
68d6b829
...
...
@@ -83,7 +83,7 @@ public:
void
send_irc_nick_change
(
const
Iid
&
iid
,
const
std
::
string
&
new_nick
,
const
std
::
string
&
requesting_resource
);
void
send_irc_kick
(
const
Iid
&
iid
,
const
std
::
string
&
target
,
const
std
::
string
&
reason
,
const
std
::
string
&
iq_id
,
const
std
::
string
&
to_jid
);
void
set_channel_topic
(
const
Iid
&
iid
,
const
std
::
string
&
subject
);
void
set_channel_topic
(
const
Iid
&
iid
,
std
::
string
subject
);
void
send_xmpp_version_to_irc
(
const
Iid
&
iid
,
const
std
::
string
&
name
,
const
std
::
string
&
version
,
const
std
::
string
&
os
);
void
send_irc_ping_result
(
const
Iid
&
iid
,
const
std
::
string
&
id
);
...
...
src/utils/string.hpp
View file @
68d6b829
...
...
@@ -6,5 +6,3 @@
bool
to_bool
(
const
std
::
string
&
val
);
std
::
vector
<
std
::
string
>
cut
(
const
std
::
string
&
val
,
const
std
::
size_t
size
);
tests/end_to_end/__main__.py
View file @
68d6b829
...
...
@@ -707,6 +707,23 @@ if __name__ == '__main__':
),
partial
(
expect_stanza
,
"/message[@from='#foo%{irc_server_one}/{nick_one}'][@type='groupchat']/subject[text()='TOPIC TEST']"
),
]),
Scenario
(
"multiline_topic"
,
[
handshake_sequence
(),
# User joins
partial
(
send_stanza
,
"<presence from='{jid_one}/{resource_one}' to='#foo%{irc_server_one}/{nick_one}' />"
),
connection_sequence
(
"irc.localhost"
,
'{jid_one}/{resource_one}'
),
partial
(
expect_stanza
,
"/message/body"
),
partial
(
expect_stanza
,
"/presence"
),
partial
(
expect_stanza
,
"/message[@from='#foo%{irc_server_one}'][@type='groupchat']/subject[not(text())]"
),
# User tries to set a multiline topic
partial
(
send_stanza
,
"<message from='{jid_one}/{resource_one}' to='#foo%{irc_server_one}' type='groupchat'><subject>FIRST LINE
\n
SECOND LINE.</subject></message>"
),
partial
(
expect_stanza
,
"/message[@from='#foo%{irc_server_one}/{nick_one}'][@type='groupchat'][@to='{jid_one}/{resource_one}']/subject[text()='FIRST LINE SECOND LINE.']"
),
]),
Scenario
(
"channel_basic_join_on_fixed_irc_server"
,
[
handshake_sequence
(),
...
...
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