Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
QuasselDroid-ng
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
External wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Monitor
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
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
Janne Mareike Koschinski
QuasselDroid-ng
Commits
ec53a966
Verified
Commit
ec53a966
authored
6 years ago
by
Janne Mareike Koschinski
Browse files
Options
Downloads
Patches
Plain Diff
Add identd replacements for aliases
parent
16cba573
No related branches found
No related tags found
No related merge requests found
Pipeline
#307
passed
6 years ago
Stage: build
Changes
1
Pipelines
2
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
lib/src/main/java/de/kuschku/libquassel/quassel/syncables/AliasManager.kt
+22
-1
22 additions, 1 deletion
...a/de/kuschku/libquassel/quassel/syncables/AliasManager.kt
with
22 additions
and
1 deletion
lib/src/main/java/de/kuschku/libquassel/quassel/syncables/AliasManager.kt
+
22
−
1
View file @
ec53a966
...
...
@@ -164,7 +164,7 @@ class AliasManager constructor(
// Append new replacement text
commandBuffer
.
append
(
replacement
)
index
=
match
.
range
.
endInclusive
+
1
}
// Append remaining text
...
...
@@ -174,9 +174,30 @@ class AliasManager constructor(
for
(
j
in
params
.
size
downTo
1
)
{
val
user
=
network
?.
ircUser
(
params
[
j
-
1
])
// Hostname, or "*" if blank/nonexistent
command
=
command
.
replace
(
"\$$j:hostname"
,
user
?.
host
()
?:
"*"
)
// Identd
// Ident if verified, or "*" if blank/unknown/unverified (prefixed with "~")
//
// Most IRC daemons have the option to prefix an ident with "~" if it could not be
// verified via an identity daemon such as oidentd. In these cases, it can be handy to
// have a way to ban via ident if verified, or all idents if not verified. If the
// server does not verify idents, it usually won't add "~".
//
// Identd must be replaced before ident to avoid being treated as "$i:ident" + "d"
command
=
command
.
replace
(
"\$$j:identd"
,
(
user
?.
user
()).
let
{
when
{
it
==
null
||
it
.
startsWith
(
prefix
=
"~"
)
->
"*"
else
->
it
}
})
// Ident, or "*" if blank/nonexistent
command
=
command
.
replace
(
"\$$j:ident"
,
user
?.
user
()
?:
"*"
)
// Account, or "*" if blank/nonexistent/logged out
command
=
command
.
replace
(
"\$$j:account"
,
user
?.
account
()
?:
"*"
)
// Nickname
// Must be replaced last to avoid interferring with more specific aliases
command
=
command
.
replace
(
"\$$j"
,
params
[
j
-
1
])
}
command
=
command
.
replace
(
"$0"
,
msg
)
...
...
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