diff options
| author | Teddy Wing | 2016-09-17 06:51:09 -0400 |
|---|---|---|
| committer | Teddy Wing | 2016-09-17 06:51:09 -0400 |
| commit | fbcd0dce92f8fb57d85893b68cd85c9c7466ec6a (patch) | |
| tree | 3bc927733408406b8991a3343662d7301c0e8de9 | |
| parent | 586fabf96c50c5aa8e6811dab136b8d7d0318054 (diff) | |
| download | irssi-slack-profile-fbcd0dce92f8fb57d85893b68cd85c9c7466ec6a.tar.bz2 | |
cmd_set: Only call `update_user_profile` if `$key` is set
If the `/slack_profile_set` command is called with no arguments (in this
case, no key), then don't call this subroutine because it requests the
Slack API. We should only make remote requests when we have enough
information.
| -rw-r--r-- | slack_profile.pl | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/slack_profile.pl b/slack_profile.pl index 80e2501..7962e02 100644 --- a/slack_profile.pl +++ b/slack_profile.pl @@ -219,7 +219,9 @@ sub cmd_set { my ($data) = @_; my ($key, $value) = split /\s+/, $data, 2; - update_user_profile($key, $value); + if ($key) { + update_user_profile($key, $value); + } } sub find_user { |
