Changeset 190 in code for trunk


Ignore:
Timestamp:
Mar 31, 2020, 5:02:02 PM (5 years ago)
Author:
contact
Message:

Make "@" and "/" indicate client name and network, respectively

This allows both kinds "<username>@<client>/<network>" and
"<username>/<network>@<client>".

Location:
trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/doc/soju.1.scd

    r178 r190  
    3737  a channel, you need to use the suffix too: _/join #channel/network_. Same
    3838  applies to messages sent to users.
     39
     40For per-client history to work, clients need to indicate their name. This can
     41be done by adding a "@<client>" suffix to the username.
    3942
    4043# OPTIONS
  • trunk/downstream.go

    r188 r190  
    541541        }
    542542        if j >= 0 {
    543                 network = rawUsername[j+1:]
     543                if rawUsername[j] == '@' {
     544                        client = rawUsername[j+1:]
     545                } else {
     546                        network = rawUsername[j+1:]
     547                }
    544548        }
    545549        if i >= 0 && j >= 0 && i < j {
    546                 client = rawUsername[i+1 : j]
     550                if rawUsername[i] == '@' {
     551                        client = rawUsername[i+1 : j]
     552                } else {
     553                        network = rawUsername[i+1 : j]
     554                }
    547555        }
    548556
Note: See TracChangeset for help on using the changeset viewer.