<html lang='en'>
<head>
<meta content='text/html; charset=utf-8' http-equiv='Content-Type'>
<title>
GitLab
</title>
</meta>
</head>
<style>
  img {
    max-width: 100%;
    height: auto;
  }
  p.details {
    font-style:italic;
    color:#777
  }
  .footer p {
    font-size:small;
    color:#777
  }
  pre.commit-message {
    white-space: pre-wrap;
  }
  .file-stats a {
    text-decoration: none;
  }
  .file-stats .new-file {
    color: #090;
  }
  .file-stats .deleted-file {
    color: #B00;
  }
</style>
<body>
<div class='content'>
<h3>Justin Mitchell pushed to branch master at <a href="https://projects.sucs.org/arthur/mw">Justin Mitchell / mw</a></h3>
<h4>
Commits:
</h4>
<ul>
<li>
<strong><a href="https://projects.sucs.org/arthur/mw/commit/e820321b99c978b3f36a7fb5168eef223a8de9ba">e820321b</a></strong>
<div>
<span>by Justin Mitchell</span>
<i>at 2016-01-13T16:42:01Z</i>
</div>
<pre class='commit-message'>Add colour 15 to all incoming IPC_EVENT messages,
as they should all count as being "user action" messages
fixes #11</pre>
</li>
</ul>
<h4>1 changed file:</h4>
<ul>
<li class='file-stats'>
<a href='#diff-0'>
src/client/incoming.c
</a>
</li>
</ul>
<h4>Changes:</h4>
<li id='diff-0'>
<a href='https://projects.sucs.org/arthur/mw/commit/e820321b99c978b3f36a7fb5168eef223a8de9ba#diff-0'>
<strong>
src/client/incoming.c
</strong>
</a>
<hr>
<pre class="highlight"><code><span style="color: #000000;background-color: #ffdddd">--- a/src/client/incoming.c
</span><span style="color: #000000;background-color: #ddffdd">+++ b/src/client/incoming.c
</span><span style="color: #aaaaaa">@@ -45,6 +45,7 @@ static struct mstack *MesgStack=NULL;
</span> 
 static void accept_pipe_cmd(ipc_message_t *msg, struct user *mesg_user);
 static void force_text(ipc_message_t *msg, const char *text, const char *from);
<span style="color: #000000;background-color: #ddffdd">+static void force_vtext(ipc_message_t *msg, const char *from, const char *format, ...) __attribute__((format (printf, 3, 4)));
</span> static void force_ipc(char *text, char *from);
 static void force_rpc(char *text, char *from);
 static void force_checkonoff(char *text, char *from);
<span style="color: #aaaaaa">@@ -640,15 +641,16 @@ static void display_content(ipc_message_t *msg)
</span>           const char * reason = json_getstring(j, "reason");
 
                if (verbose) force_text(msg, verbose, whom);
<span style="color: #000000;background-color: #ffdddd">-                force_text(msg, text, whom);
</span><span style="color: #000000;background-color: #ddffdd">+
+               /* user action messages have colour 15 */
+               force_vtext(msg, whom, "\033%d%s", 15, text);
+
</span>           if (reason) {
<span style="color: #000000;background-color: #ffdddd">-                        _autofree char *excuse = NULL;
</span>                   if (strcasecmp(type, "mrod")==0 || strcasecmp(type, "zod")==0) {
<span style="color: #000000;background-color: #ffdddd">-                                asprintf(&excuse, "Zebedee says \"%s\".", reason);
</span><span style="color: #000000;background-color: #ddffdd">+                           force_vtext(msg, whom, "Zebedee says \"%s\".", reason);
</span>                   } else {
<span style="color: #000000;background-color: #ffdddd">-                                asprintf(&excuse, "%s gives the reason \"%s\".", whom, reason);
</span><span style="color: #000000;background-color: #ddffdd">+                           force_vtext(msg, whom, "%s gives the reason \"%s\".", whom, reason);
</span>                   }
<span style="color: #000000;background-color: #ffdddd">-                        force_text(msg, excuse, whom);
</span>           }
        } else {
                printf("Unknown message type %4.4s", (char *)&msg->head.type);
<span style="color: #aaaaaa">@@ -765,6 +767,18 @@ static void force_newmail(void)
</span>   new_mail_waiting++;
 }
 
<span style="color: #000000;background-color: #ddffdd">+
+static void force_vtext(ipc_message_t *msg, const char *from, const char *format, ...)
+{
+       va_list va;
+       _autofree char * text = NULL;
+       va_start(va, format);
+       vasprintf(&text, format, va);
+       va_end(va);
+
+       force_text(msg, text, from);
+}
+
</span> static void force_text(ipc_message_t *msg, const char *text, const char *from)
 {
        char tb[MAXTEXTLENGTH];
</code></pre>

<br>
</li>

</div>
<div class='footer' style='margin-top: 10px;'>
<p>

<br>
<a href="https://projects.sucs.org/arthur/mw/commit/e820321b99c978b3f36a7fb5168eef223a8de9ba">View it on GitLab</a>.
<br>
You're receiving this email because of your account on projects.sucs.org.
If you'd like to receive fewer emails, you can adjust your notification settings.
<script type="application/ld+json">{"@context":"http://schema.org","@type":"EmailMessage","action":{"@type":"ViewAction","name":"View Commit","url":"https://projects.sucs.org/arthur/mw/commit/e820321b99c978b3f36a7fb5168eef223a8de9ba"}}</script>
</p>
</div>
</body>
</html>