]> git.pond.sub.org Git - empserver/commitdiff
(sendmessage): Don't split messages into lines of no more than 60
authorMarkus Armbruster <armbru@pond.sub.org>
Sat, 20 Jan 2007 16:32:35 +0000 (16:32 +0000)
committerMarkus Armbruster <armbru@pond.sub.org>
Sat, 20 Jan 2007 16:32:35 +0000 (16:32 +0000)
characters.  Update info flash and wall.  They were wrong, anyway:
they claimed long messages were truncated.

info/flash.t
info/wall.t
src/lib/commands/flash.c

index ba21d1e564a6d7fb2d4e9f1cd211e8dce9fc9882..3b862be227c46cbfda075c57472319fa6baff824 100644 (file)
@@ -20,7 +20,6 @@ Or you can send a multi-line message:
 .FI
 Note that you can end a multi-line flash with either a '.' (period)
 on a line all by itself, or by hitting ^D on a line by itself.
-Note also that all messages are truncated to 60 characters long!
 .s1
 If you do not wish to receive any flash messages from your friends,
 then you can temporarily turn the feature off by typing "toggle flash".
index 2bfbd60f3e6d605f66d85da79f01c6721c496ea1..2e03c7ebf9385f9f4b001b8289606f3a06404893 100644 (file)
@@ -17,7 +17,6 @@ Or you can send a multi-line message:
 .FI
 Note that you can end a multi-line wall with either a '.' (period)
 on a line all by itself, or by hitting ^D on a line by itself.
-Note also that all messages are truncated to 60 characters long!
 .s1
 If you do not wish to receive any broadcast messages from your allies,
 then you can temporarily turn the feature off by typing "toggle flash".
index 724e214c1f2832aa67151d35e63aa2b1aa876b8f..09348cc349013e6a8b953e3a09e6005ddf7d52a8 100644 (file)
@@ -117,25 +117,19 @@ wall(void)
 
 /*
  * Send flash message MESSAGE from US to TO.
- * MESSAGE is UTF-8.  Long messages are broken into several parts.
- * A header identifying US is prepended to each part.  The first
- * header is more verbose if ONESHOT.
+ * MESSAGE is UTF-8.
+ * Null TO broadcasts to all.
+ * A header identifying US is prepended to the message.  It is more
+ * verbose if VERBOSE.
  */
 int
-sendmessage(struct natstr *us, struct natstr *to, char *message, int oneshot)
+sendmessage(struct natstr *us, struct natstr *to, char *message, int verbose)
 {
     struct player *other;
     struct tm *tm;
     time_t now;
     int sent = 0;
     struct natstr *wto;
-    char c;
-    int pos;
-
-    pos = ufindpfx(message, 60);
-    c = message[pos];
-    if (c)
-        message[pos] = '\0';
 
     time(&now);
     tm = localtime(&now);
@@ -152,7 +146,7 @@ sendmessage(struct natstr *us, struct natstr *to, char *message, int oneshot)
            continue;
        if (player == other)
            continue;
-       if (oneshot)
+       if (verbose)
            if (to)
                pr_flash(other, "FLASH from %s (#%d) @ %02d:%02d%s\n",
                         us->nat_cnam, us->nat_cnum, tm->tm_hour,
@@ -189,9 +183,5 @@ sendmessage(struct natstr *us, struct natstr *to, char *message, int oneshot)
                pr("%s is not accepting flashes\n", to->nat_cnam);
        }
     }
-    if (c) {
-       message[pos] = c;
-       sendmessage(us, to, &message[pos], 0);
-    }
     return 0;
 }