[4176] in BarnOwl Developers

home help back first fref pref prev next nref lref last post

Re: [barnowl/barnowl] Experimental Zulip support (#184)

daemon@ATHENA.MIT.EDU (Anders Kaseorg)
Tue Oct 17 03:11:17 2017

Date: Mon, 16 Oct 2017 20:00:04 +0000 (UTC)
From: Anders Kaseorg <notifications@github.com>
Reply-To: barnowl/barnowl <reply+004448c9ffa664774eea8d29e61f764c3b2b028343fa033f92cf0000000115fcd1c492a169ce0fd8a3d7@reply.github.com>
To: barnowl/barnowl <barnowl@noreply.github.com>
Cc: Subscribed <subscribed@noreply.github.com>
In-Reply-To: <barnowl/barnowl/pull/184@github.com>

----==_mimepart_59e50fc4ca41a_1bb73fbbac9d8f3096496
Content-Type: text/plain;
 charset=UTF-8
Content-Transfer-Encoding: 7bit

andersk requested changes on this pull request.



> +       @recipients = $self->private_recipient_list;
+    } else {
+        if ($self->sender eq BarnOwl::Module::Zulip::user()) {
+            @recipients = $self->private_recipient_list;
+            if (scalar(@recipients) > 1) {
+                BarnOwl::error("Cannot reply privately to message to more than one recipient");
+                return;
+            }
+        } else {
+            @recipients = $self->sender;
+        }
+    }
+    my @filtered_recipients = grep { $_ ne BarnOwl::Module::Zulip::user() } @recipients;
+    if (scalar(@filtered_recipients) == 0) {
+        # Self must have been only recipient, so re-add it (one copy)
+        @filtered_recipients = @recipients[0];

`Scalar value @recipients[0] better written as $recipients[0] at barnowl/perl/modules/Zulip/lib/BarnOwl/Message/Zulip.pm line 92.`

> +    undef $queue_id;
+    undef $last_event_id;
+
+    BarnOwl::admin_message('Zulip Error', $msg);
+    die("Zulip Error: $msg\n");
+}
+
+
+sub initialize {
+    my $conffile = BarnOwl::get_config_dir() . "/zulip";
+
+    if (open(my $fh, "<", "$conffile")) {
+        read_config($fh);
+        close($fh);
+    }
+    if ($cfg{'api_url'} =~ /^https/) {

`Use of uninitialized value $BarnOwl::Module::Zulip::cfg{"api_url"} in pattern match (m//) at barnowl/perl/modules/Zulip/lib/BarnOwl/Module/Zulip.pm line 46.`
(for non-Zulip users)

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/barnowl/barnowl/pull/184#pullrequestreview-69680154
----==_mimepart_59e50fc4ca41a_1bb73fbbac9d8f3096496
Content-Type: text/html;
 charset=UTF-8
Content-Transfer-Encoding: 7bit

<p><b>@andersk</b> requested changes on this pull request.</p>

<hr>

<p>In <a href="https://github.com/barnowl/barnowl/pull/184#discussion_r144951646">perl/modules/Zulip/lib/BarnOwl/Message/Zulip.pm</a>:</p>
<pre style='color:#555'>&gt; +       @recipients = $self-&gt;private_recipient_list;
+    } else {
+        if ($self-&gt;sender eq BarnOwl::Module::Zulip::user()) {
+            @recipients = $self-&gt;private_recipient_list;
+            if (scalar(@recipients) &gt; 1) {
+                BarnOwl::error(&quot;Cannot reply privately to message to more than one recipient&quot;);
+                return;
+            }
+        } else {
+            @recipients = $self-&gt;sender;
+        }
+    }
+    my @filtered_recipients = grep { $_ ne BarnOwl::Module::Zulip::user() } @recipients;
+    if (scalar(@filtered_recipients) == 0) {
+        # Self must have been only recipient, so re-add it (one copy)
+        @filtered_recipients = @recipients[0];
</pre>
<p><code>Scalar value @recipients[0] better written as $recipients[0] at barnowl/perl/modules/Zulip/lib/BarnOwl/Message/Zulip.pm line 92.</code></p>

<hr>

<p>In <a href="https://github.com/barnowl/barnowl/pull/184#discussion_r144951985">perl/modules/Zulip/lib/BarnOwl/Module/Zulip.pm</a>:</p>
<pre style='color:#555'>&gt; +    undef $queue_id;
+    undef $last_event_id;
+
+    BarnOwl::admin_message(&#39;Zulip Error&#39;, $msg);
+    die(&quot;Zulip Error: $msg\n&quot;);
+}
+
+
+sub initialize {
+    my $conffile = BarnOwl::get_config_dir() . &quot;/zulip&quot;;
+
+    if (open(my $fh, &quot;&lt;&quot;, &quot;$conffile&quot;)) {
+        read_config($fh);
+        close($fh);
+    }
+    if ($cfg{&#39;api_url&#39;} =~ /^https/) {
</pre>
<p><code>Use of uninitialized value $BarnOwl::Module::Zulip::cfg{"api_url"} in pattern match (m//) at barnowl/perl/modules/Zulip/lib/BarnOwl/Module/Zulip.pm line 46.</code><br>
(for non-Zulip users)</p>

<p style="font-size:small;-webkit-text-size-adjust:none;color:#666;">&mdash;<br />You are receiving this because you are subscribed to this thread.<br />Reply to this email directly, <a href="https://github.com/barnowl/barnowl/pull/184#pullrequestreview-69680154">view it on GitHub</a>, or <a href="https://github.com/notifications/unsubscribe-auth/AERIySTu_cDuqJlGqOtiYfK8UtH5NuQzks5ss7XEgaJpZM4P6_o2">mute the thread</a>.<img alt="" height="1" src="https://github.com/notifications/beacon/AERIyeX-ZAfUBVgF0QsY0jzXq6E1VyQJks5ss7XEgaJpZM4P6_o2.gif" width="1" /></p>
<div itemscope itemtype="http://schema.org/EmailMessage">
<div itemprop="action" itemscope itemtype="http://schema.org/ViewAction">
  <link itemprop="url" href="https://github.com/barnowl/barnowl/pull/184#pullrequestreview-69680154"></link>
  <meta itemprop="name" content="View Pull Request"></meta>
</div>
<meta itemprop="description" content="View this Pull Request on GitHub"></meta>
</div>

<script type="application/json" data-scope="inboxmarkup">{"api_version":"1.0","publisher":{"api_key":"05dde50f1d1a384dd78767c55493e4bb","name":"GitHub"},"entity":{"external_key":"github/barnowl/barnowl","title":"barnowl/barnowl","subtitle":"GitHub repository","main_image_url":"https://cloud.githubusercontent.com/assets/143418/17495839/a5054eac-5d88-11e6-95fc-7290892c7bb5.png","avatar_image_url":"https://cloud.githubusercontent.com/assets/143418/15842166/7c72db34-2c0b-11e6-9aed-b52498112777.png","action":{"name":"Open in GitHub","url":"https://github.com/barnowl/barnowl"}},"updates":{"snippets":[{"icon":"PERSON","message":"@andersk requested changes on #184"}],"action":{"name":"View Pull Request","url":"https://github.com/barnowl/barnowl/pull/184#pullrequestreview-69680154"}}}</script>
----==_mimepart_59e50fc4ca41a_1bb73fbbac9d8f3096496--

home help back first fref pref prev next nref lref last post