Sha256: 2b688b8196333a7e6666758d8da7cbfd8175927871513331b9f014f9e1b0fd0e

Contents?: true

Size: 628 Bytes

Versions: 14

Compression:

Stored size: 628 Bytes

Contents

# frozen_string_literal: true

module JabberAdmin
  module Commands
    # Set nickname in a user's vCard.
    #
    # @see https://bit.ly/2rBdyqc
    class SetNickname
      # Pass the correct data to the given callable.
      #
      # @param callable [Proc, #call] the callable to call
      # @param user [String] user JID wo/ resource (eg. +tom@localhost+)
      # @param nick [String] the user nickname (eg. +TomTom+)
      def self.call(callable, user:, nick:)
        uid, host = user.split('@')
        callable.call(
          'set_nickname', user: uid, host: host, nickname: nick
        )
      end
    end
  end
end

Version data entries

14 entries across 14 versions & 1 rubygems

Version Path
jabber_admin-1.3.4 lib/jabber_admin/commands/set_nickname.rb
jabber_admin-1.3.3 lib/jabber_admin/commands/set_nickname.rb
jabber_admin-1.3.2 lib/jabber_admin/commands/set_nickname.rb
jabber_admin-1.3.1 lib/jabber_admin/commands/set_nickname.rb
jabber_admin-1.3.0 lib/jabber_admin/commands/set_nickname.rb
jabber_admin-1.2.0 lib/jabber_admin/commands/set_nickname.rb
jabber_admin-1.1.0 lib/jabber_admin/commands/set_nickname.rb
jabber_admin-1.0.5 lib/jabber_admin/commands/set_nickname.rb
jabber_admin-1.0.4 lib/jabber_admin/commands/set_nickname.rb
jabber_admin-1.0.3 lib/jabber_admin/commands/set_nickname.rb
jabber_admin-1.0.2 lib/jabber_admin/commands/set_nickname.rb
jabber_admin-1.0.1 lib/jabber_admin/commands/set_nickname.rb
jabber_admin-1.0.0 lib/jabber_admin/commands/set_nickname.rb
jabber_admin-0.2.0 lib/jabber_admin/commands/set_nickname.rb