Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Network
Konversation
Commits
aaa16c69
Commit
aaa16c69
authored
Jan 04, 2021
by
Peter Simonsson
Browse files
implement cap new and cap del (cap-notify)
parent
0276d06d
Changes
3
Hide whitespace changes
Inline
Side-by-side
src/irc/inputfilter.cpp
View file @
aaa16c69
...
...
@@ -862,6 +862,14 @@ void InputFilter::parseServerCommand(const QString &prefix, const QString &comma
m_server
->
capInitiateNegotiation
(
trailing
);
}
}
else
if
(
command
==
QLatin1String
(
"new"
))
{
m_server
->
capInitiateNegotiation
(
trailing
);
}
else
if
(
command
==
QLatin1String
(
"del"
))
{
m_server
->
capDel
(
trailing
);
}
}
else
if
(
command
==
QLatin1String
(
"authenticate"
)
&&
plHas
(
1
))
{
...
...
src/irc/server.cpp
View file @
aaa16c69
...
...
@@ -836,6 +836,21 @@ void Server::capDenied(const QString& name)
getStatusView
()
->
appendServerMessage
(
i18n
(
"Error"
),
i18n
(
"SASL capability denied or not supported by server."
));
}
void
Server
::
capDel
(
const
QString
&
unavailableCaps
)
{
#if QT_VERSION < QT_VERSION_CHECK(5, 15, 0)
const
QStringList
capsList
=
unavailableCaps
.
split
(
QLatin1Char
(
' '
),
QString
::
SkipEmptyParts
);
#else
const
QStringList
capsList
=
unavailableCaps
.
split
(
QLatin1Char
(
' '
),
Qt
::
SkipEmptyParts
);
#endif
for
(
const
QString
&
capString
:
qAsConst
(
capsList
))
{
if
(
m_capabilityNames
.
contains
(
capString
))
m_capabilities
&=
~
(
m_capabilityNames
.
value
(
capString
));
}
}
void
Server
::
registerWithServices
()
{
if
(
!
getIdentity
())
...
...
@@ -4451,6 +4466,7 @@ void Server::initCapablityNames()
{
QStringLiteral
(
"account-notify"
),
AccountNotify
},
{
QStringLiteral
(
"znc.in/self-message"
),
SelfMessage
},
{
QStringLiteral
(
"chghost"
),
ChgHost
},
{
QStringLiteral
(
"cap-notify"
),
CapNofify
},
};
}
...
...
src/irc/server.h
View file @
aaa16c69
...
...
@@ -102,6 +102,7 @@ class Server : public QObject
AccountNotify
=
0x80
,
SelfMessage
=
0x100
,
ChgHost
=
0x200
,
CapNofify
=
0x400
,
};
Q_DECLARE_FLAGS
(
CapabilityFlags
,
CapabilityFlag
)
...
...
@@ -560,6 +561,7 @@ class Server : public QObject
void
capAcknowledged
(
const
QString
&
name
,
CapModifiers
modifiers
);
void
capDenied
(
const
QString
&
name
);
void
sendAuthenticate
(
const
QString
&
message
);
void
capDel
(
const
QString
&
unavailableCaps
);
private
Q_SLOTS
:
void
hostFound
();
...
...
Write
Preview
Supports
Markdown
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