Muting Objects and Agents

From Second Life Wiki
Revision as of 11:13, 13 June 2007 by Able Whitman (talk | contribs) (loading the mute list)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

The viewer is responsible for implementing the muting on agents and objects. When the viewer initiates a new session, it requests the Mute List from the Second Life service. Once this list has been received and processed, each chat message that the viewer receives is compared against a list of muted items. If a chat message originates from a muted item, it is suppressed.

Mute List Classes

There are two primary classes that are used to implement and manage the viewer's mute list:

  • LLMute -- each muted object or agent is represented by an instance of this class
  • LLMuteList -- a single global instance of this class is used to manage the list of object and agents that are muted

Both of these classes are declared in llmutelist.h and implemented in llmutelist.cpp.

Loading the Mute List

The viewer's mute list is internally represented by the global LLMuteList* gMuteListp.

Requesting the Mute List from the service

  1. The viewer requests the agent's mute list by calling LLMuteList::requestFromServer() in llmutelist.cpp
  2. The viewer sends a MuteListRequest message to the service
  3. The service replies with either:
    • A MuteListUpdate message, indicating that the viewer should request a new mute list file from the service, or
    • A UseCachedMuteList message, indicating that the viewer should use its cached copy of the mute list file

Loading a new Mute List

  1. The viewer recevies a MuteListUpdate message from the serice
  2. The mute list file specified in the message is requested by the viewer
  3. Upon receipt of the mute list file, the callback LLMuteList::onFileMuteList() is invoked
  4. The viewer opens the received file, and invokes LLMuteList::loadFromFile() to parse it

Loading a cached Mute List

  1. The viewer receives a UseCachedMuteList message from the service
  2. The viewer opens the cached file, and invokes LLMuteList::loadFromFile() to parse it

Populating the Global Mute List

  1. The mute list file, whether new or cached, is opened by LLMuteList::loadFromFile()
  2. Each mute entry in the pipe-delimited list is parsed
  3. A new LLMute instance is created for each entry, and this instance is added to gMuteListp.