diff options
| author | Teddy Wing | 2016-09-12 20:32:48 -0400 |
|---|---|---|
| committer | Teddy Wing | 2016-09-12 20:32:48 -0400 |
| commit | fb1a39d5c7bf923452248b85de6349a1c4e516fc (patch) | |
| tree | f123eff196df446a45d7dab652a14d4cb9f56c85 | |
| parent | c8a665f52919500debd313bed5d6311419b325b5 (diff) | |
| download | irssi-slack-profile-fb1a39d5c7bf923452248b85de6349a1c4e516fc.tar.bz2 | |
Add command to refresh users list
New command `/slack_profile sync` (and `/slack_profile` for now)
re-fetches the users list from the Slack API. This gives users a way to
update their cache manually in case they find that the information is
out of date.
| -rw-r--r-- | slack_profile.pl | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/slack_profile.pl b/slack_profile.pl index 91a4c7a..706da77 100644 --- a/slack_profile.pl +++ b/slack_profile.pl @@ -129,6 +129,12 @@ sub fetch_users_list { store \@users_list, users_list_cache; } +# Re-fetch the users list for the most up-to-date information +sub sync { + fetch_users_list(); + Irssi::print('Done.'); +} + sub fetch_user_profile { my ($user) = @_; @@ -232,6 +238,11 @@ sub swhois { } Irssi::command_bind('swhois', 'swhois'); + +Irssi::command_bind('slack_profile', 'sync'); +Irssi::command_bind('slack_profile sync', 'sync'); + Irssi::command_bind('help', 'help'); + Irssi::settings_add_str('slack_profile', 'slack_profile_token', ''); |
