Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
Synchronet
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
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
Main
Synchronet
Commits
f8d80652
Commit
f8d80652
authored
11 years ago
by
deuce
Browse files
Options
Downloads
Patches
Plain Diff
Use onick for matching BBS users as well as cmd[0].
parent
29192d53
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
exec/ircbots/weather/weather_commands.js
+11
-13
11 additions, 13 deletions
exec/ircbots/weather/weather_commands.js
with
11 additions
and
13 deletions
exec/ircbots/weather/weather_commands.js
+
11
−
13
View file @
f8d80652
...
...
@@ -2,6 +2,7 @@ Bot_Commands["WEATHER"] = new Bot_Command(0,false,false);
Bot_Commands
[
"
WEATHER
"
].
command
=
function
(
target
,
onick
,
ouh
,
srv
,
lvl
,
cmd
)
{
var
i
;
var
lstr
;
var
nick
=
onick
;
// Remove empty cmd args
for
(
i
=
1
;
i
<
cmd
.
length
;
i
++
)
{
...
...
@@ -12,12 +13,11 @@ Bot_Commands["WEATHER"].command = function (target,onick,ouh,srv,lvl,cmd) {
}
cmd
.
shift
();
if
(
!
cmd
[
0
])
lstr
=
get_nicklocation
(
srv
,
onick
);
else
if
(
srv
.
users
[
cmd
[
0
].
toUpperCase
()])
lstr
=
get_nicklocation
(
srv
,
cmd
[
0
]);
if
(
cmd
[
0
])
nick
=
cmd
[
0
];
lstr
=
get_nicklocation
(
srv
,
nick
);
if
(
!
lstr
)
{
var
usr
=
new
User
(
system
.
matchuser
(
cmd
[
0
]
));
var
usr
=
new
User
(
system
.
matchuser
(
nick
));
if
(
typeof
(
usr
)
==
'
object
'
)
lstr
=
usr
.
location
;
}
...
...
@@ -80,6 +80,7 @@ Bot_Commands["FORECAST"] = new Bot_Command(0,false,false);
Bot_Commands
[
"
FORECAST
"
].
command
=
function
(
target
,
onick
,
ouh
,
srv
,
lvl
,
cmd
)
{
var
i
;
var
lstr
;
var
nick
=
onick
;
// Remove empty cmd args
for
(
i
=
1
;
i
<
cmd
.
length
;
i
++
)
{
...
...
@@ -90,20 +91,17 @@ Bot_Commands["FORECAST"].command = function (target,onick,ouh,srv,lvl,cmd) {
}
cmd
.
shift
();
if
(
!
cmd
[
0
])
lstr
=
get_nicklocation
(
srv
,
onick
);
else
if
(
srv
.
users
[
cmd
[
0
].
toUpperCase
()])
lstr
=
get_nicklocation
(
srv
,
cmd
[
0
]);
if
(
cmd
[
0
])
nick
=
cmd
[
0
];
lstr
=
get_nicklocation
(
srv
,
nick
);
if
(
!
lstr
)
{
var
usr
=
new
User
(
system
.
matchuser
(
cmd
[
0
]
));
var
usr
=
new
User
(
system
.
matchuser
(
nick
));
if
(
typeof
(
usr
)
==
'
object
'
)
lstr
=
usr
.
location
;
}
if
(
!
lstr
&&
cmd
[
0
])
lstr
=
cmd
.
join
(
'
'
);
var
query
=
""
;
query
=
encodeURIComponent
(
lstr
);
var
query
=
encodeURIComponent
(
lstr
);
var
location_url
=
"
http://api.wunderground.com/auto/wui/geo/GeoLookupXML/index.xml?query=
"
+
query
;
var
forecast_url
=
"
http://api.wunderground.com/auto/wui/geo/ForecastXML/index.xml?query=
"
+
query
;
...
...
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