Open melvo opened 1 year ago
Base: 68.42% // Head: 68.42% // Decreases project coverage by -0.00%
:warning:
Coverage data is based on head (
9e5647c
) compared to base (9f474d2
). Patch coverage: 60.00% of modified lines in pull request are covered.
:umbrella: View full report at Codecov.
:loudspeaker: Do you have feedback about the report comment? Let us know in this issue.
there are probably other places where this is the case, can you also adjust them?
There are the following setters:
QXmppMessage::setIsSpoiler()
QXmppMessage::setIsFallback()
QXmppPresence::setIsPreparingMujiSession()
QXmppRegisterIq::setIsRegistered()
QXmppRegisterIq::setIsRemove()
QXmppRosterIq::Item::setIsApproved()
QXmppRosterIq::Item::setIsMixChannel()
Changing 1, 2, 3 and 7 could confuse the users because it gets a different meaning. E.g., setSpoiler()
could be confused with setting the actual spoiler. We should use a consistent naming convention.
I'd like to stick to the Qt conventions as much as possible.
https://wiki.qt.io/API_Design_Principles#Naming_Boolean_Getters.2C_Setters.2C_and_Properties
It says:
is
for the getter at all, except it would be misleading. (e.g. isMixChannel() instead of mixChannel())is
in itAt first I agreed that having a setter called setMixChannel()
sounds weird, but the more I think about it, it sounds more and more reasonable to me. I think setMixChannel(true)
is okay.
However, it's probably a good idea to use more explicit types such as enums or structs to avoid such situations. For example:
setSpoiler(bool)
(and setSpoilerHint()
) could be replaced with setSpoiler(optional<Spoiler>)
and a struct Spoiler { QString hint; };
;setMixChannel()
could be replaced with setChatType(ChatType)
and an enum ChatType { User, MixChannel }
(in this case this approach could lead to issues later tough, e.g. if the channel is also a MUC and MIX2 chat and that should also be represented)I'd suggest to:
setIsSpoiler()
with setSpoiler(optional<Spoiler>)
+ spoiler structsetIsFallback()
: wait with replacing until the contents of the new version of the fallback indicator are implemented and then use a fallback struct/classis
in QXmppPresence::setIsPreparingMujiSession()
, QXmppRegisterIq::setIsRegistered()
, QXmppRegisterIq::setIsRemove()
, QXmppRosterIq::Item::setIsApproved()
setIsMixChannel(bool)
with setMixChannel(optional<MixChannel>)
and a struct/class MixChannel { QString participantId; }
.It would be great if you could do 3. in this PR, the other points can be done later (if you don't want to do them I can do them too). :)
PR check list:
\since QXmpp 1.X
,QXMPP_EXPORT
-DBUILD_DOCUMENTATION=ON
)doc/doap.xml
clang-format -i src/<edited-file(s)> tests/<edited-file(s)>