1. 22 Nov, 2017 1 commit
    • rswindell's avatar
      Fixed bug in JS msgbase.save_msg(), when multiple recipients were · 6f5aa63c
      rswindell authored
      passed (as an array), the message's data blocks would be allocated with a
      refcount of 1, as though only one message header referenced the data. This
      is really only an issue with bulkmail/multiple-recipient email and when the
      first message was deleted, the remaining (headers) would point to free
      data blocks which could and eventually would be overwritten by another
      message's data (body text). chksmb would only catch the problem when the
      refcount reached 0 but there was still one or more message headers pointing
      at the data.
  2. 06 Nov, 2017 1 commit
  3. 01 Nov, 2017 1 commit
    • rswindell's avatar
      Hopefully fix issue with converting auxattr with bit 31 set to/from JS value: · aaa250d1
      rswindell authored
      Poll with results "closed" (only visible to pollster until the poll is closed)
      have bit 31 set in the auxattr message header field. Reportedly (by Nightfox)
      this causes Error: can't convert 2147483648 to an integer when attempting
      to use this message in JS.
      I could'vd sworn I've solved this problem before, but maybe that was with
      JS-C v1.5 - anyway, first convert to double using JS_ValueToNumber and then
      typecast to uint32.
      We probably will need to do something similar with the time values in year
      2038 (holding my breath).
  4. 19 Aug, 2017 1 commit
  5. 01 Dec, 2016 1 commit
    • rswindell's avatar
      Error messages logged with errormsg() now contain the name of the C/C++ · b4b6713e
      rswindell authored
      function where the error is being reported from. So the WHERE macro now
      contains the __FUNCTION__ "macro" and the various js*.c files that use the
      WHERE macro to report errors had to be updated too.
      Also, the 'access' argument is now being passed as a signed long rather than
      unsigned long. Status/return values are often passed in here (e.g. from smblib)
      and may be negative. This argument was being displayed with %ld but wasn't
      being passed in as a signed value, so on 64-bit long systems, negative numbers
      were just printed as large (4M+) numbers.
      Also, no need to call getfname() in errormsg() since this is embedded in the
      WHERE macro (since 2009).
  6. 22 Nov, 2016 1 commit
  7. 21 Nov, 2016 4 commits
    • rswindell's avatar
      Change MsgBase.get_user_votes() to MsgBase.how_user_voted(). · 0b984ab1
      rswindell authored
      New MsgBase header propeties:
      - total_votes (total number of votes this msg or poll has received)
      - tally[], an array of 16 numbers indicating the total votes for each poll answer
        in the case of a normal message, tally[0] is the same as upvotes and tally[1]
        is the same as downvotes.
      This should complete what echicken needs to display polls and voting results
      in his web UI.
    • rswindell's avatar
      Handle poll-closures correctly (don't treat as votes in get_msg_index and · e5dde404
      rswindell authored
      Added new method: get_user_votes(msg number, user name or alias)
      The user name or alias must match the posting configuration on the local
      system (i.e. if set for real names, pass the user's real name instead of alias).
      This function returns 0 for no votes on the reference message, 1 for an
      up-vote, 2 for a down-vote or in the case of a poll-response, a bit-field of
    • rswindell's avatar
      Add the "votes" header property. · bb6a507f
      rswindell authored
      On polls, this is the maximum number of votes per ballot in response to this
      poll (0 is the same as 1).
      On ballots, this is the bit-field of votes submitted by the user (e.g. bit 0
      set is a vote for answer 1, bit 1 for answer 2, etc.).
      For normal messages, this field has no current use.
    • rswindell's avatar
  8. 19 Nov, 2016 1 commit
  9. 16 Nov, 2016 1 commit
  10. 15 Nov, 2016 1 commit
  11. 13 Nov, 2016 2 commits
    • rswindell's avatar
      MsgBase.get_all_msg_headers() now returns the vote totals for each message · e4df751e
      rswindell authored
      (new header properties: upvotes and downvotes), regardless of the
      "include_votes" argument value (default: false).
      get_all_msg_headers() reads the entire index already, so there's really no
      performance penalty unless there are actual votes (and even then, very low).
      The MsgBase.get_msg_header() function will *not* return these vote totals since
      that would incur a pretty substatial performance hit on that function.
    • rswindell's avatar
      Add new MsgBase method: vote_msg(). it takes a message header object · cd4c51bb
      rswindell authored
      (like save_msg), except you only need a few properties, in order of importarnce:
      attr: you need to have this set to MSG_UPVOTE, MSG_DOWNVOTE, or MSG_VOTE
      thread_back or reply_id: either of these must be set to indicate msg to vote on
      from: name of voter
      from_net_type and from_net_addr: if applicable
  12. 12 Nov, 2016 1 commit
    • rswindell's avatar
      MsgBase methods now exclude vote messages by default: · 294cd729
      rswindell authored
      - get_msg_index()
      - get_msg_header()
      - get_all_msg_headers()
      these functions all accept a new (optonal, last) bool argument "include_votes"
      which defaults to false. So if for some reason, you want to load votes, just
      pass an additional 'true' argument.
      ToDo: polls and vote tallying.
      At least for now, existing JS stuff that uses the MsgBase object won't get
      messed up by the new voting messages.
  13. 03 Dec, 2015 1 commit
    • rswindell's avatar
      Bug-fix/enhancement: Allow QWKnet netmail to be sent using the JavaScript · d2892791
      rswindell authored
      MsgBase.save_msg() method. The bug was that it was forcing the idx.to value to
      0 which would only work (in theory) for mail going to a QWKnet hub.
      Now, save_msg() will check the 'to_net_addr' property of the header object
      (or recipient objects) and actually verify that it/they are routeable QWKnet
      address(es) and throw an exception if not.
      If the first hop is a QWKnet node, sets the to_ext (and thus, idx.to value) to
      the account number of the node. This also looks up full-routes via the
      route.dat and replaces the to_net_addr value with the full route if necessary.
      I guess nobody (including me) tried sending QWKnet netmail via JS before.
  14. 26 Nov, 2015 1 commit
    • rswindell's avatar
      Make the SMB plain-text only feature available to users of the · 83cd7103
      rswindell authored
      MsgBase.get_msg_body() method: added an additional boolean argument (following
      the 'include_tails' argument), which defaults to false (disabled). Pass true
      for this argument to enable this feature. Yes, JS-authors could do this parsing
      easily via JS, but I figure so long as this feature is in the SMBLIB, might as
      well expose it to JS for consistency (e.g. in 3rd party message reader mods).
  15. 23 Nov, 2015 2 commits
  16. 28 Oct, 2015 1 commit
  17. 29 Jul, 2015 1 commit
  18. 08 Nov, 2014 1 commit
  19. 06 Apr, 2014 1 commit
    • rswindell's avatar
      Store scfg_t* in JS runtime private rather than object private or global · 451ca678
      rswindell authored
      variable (with various race conditions). This resolves a long LONG standing
      bug that caused crashes when shutting down or recycling servers/services
      while one or more servers/services were in use.
      This change requires every thread which calls into libjs to have its own JS
  20. 05 Oct, 2013 1 commit
  21. 01 Oct, 2013 2 commits
  22. 30 Sep, 2013 1 commit
  23. 08 Feb, 2013 3 commits
  24. 07 Mar, 2012 1 commit
    • rswindell's avatar
      Created new SMB fixed header field: thread_id which contains the message number · bdfe0f79
      rswindell authored
      of the first message in the thread, or 0 if unknown (e.g. legacy message). When
      a new message is created, the thread_id value of the message being replied-to
      will be used, else if the new msg is not a reply, then the new message's number
      will be the value used for the thread_id.
      This "thread-id" feature (Deuce's idea) allows threads with a common parent to
      remain logically grouped after the original messages in the thread have been
      purged (though the original hiearchy will start to be lost).
  25. 12 Nov, 2011 1 commit
  26. 09 Nov, 2011 4 commits
  27. 02 Nov, 2011 1 commit
  28. 29 Oct, 2011 1 commit
  29. 27 Oct, 2011 1 commit