Package com.biglybt.plugin.net.buddy
Class BuddyPluginBeta.ChatInstance
java.lang.Object
com.biglybt.plugin.net.buddy.BuddyPluginBeta.ChatInstance
- All Implemented Interfaces:
DataSourceResolver.ExportableDataSource
- Enclosing class:
- BuddyPluginBeta
public class BuddyPluginBeta.ChatInstance
extends Object
implements DataSourceResolver.ExportableDataSource
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate LinkedHashMap<String,
String> private boolean
private boolean
private Object
private AESemaphore
private Object
private boolean
private boolean
(package private) AsyncDispatcher
private String
private boolean
private Object
private boolean
private boolean
private String
private int
private boolean
private boolean
private boolean
private boolean
private boolean
private final String
private String
private BuddyPluginBeta.ChatMessage
private boolean
private byte[]
private ByteArrayHashMap<String>
private boolean
private AtomicInteger
private List<BuddyPluginBeta.ChatMessage>
private int
private static final int
private PluginInterface
private InetSocketAddress
private byte[]
private final String
private Map<String,
List<BuddyPluginBeta.ChatParticipant>> static final String
private final BuddyPluginBeta.ChatParticipant
private boolean
private int
private boolean
private TimerEvent
private boolean
private int
Fields inherited from interface com.biglybt.core.util.DataSourceResolver.ExportableDataSource
OPT_CAN_MINIMIZE, OPT_ON_TOP
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprivate
ChatInstance
(String _network, String _key, BuddyPluginBeta.ChatParticipant _private_target, boolean _is_private_chat, Map<String, Object> _options) -
Method Summary
Modifier and TypeMethodDescriptionvoid
addListener
(BuddyPluginBeta.ChatListener listener) protected void
protected void
boolean
private void
bind
(PluginInterface _msgsync_pi, Object _handler, long timeout) chatRequested
(Map<String, Object> message_map) private void
private void
void
destroy()
private void
destroy
(boolean force) export()
void
private List<BuddyPluginBeta.ChatMessage>
flattenTree
(BuddyPluginBeta.ChatMessage head, Map<BuddyPluginBeta.ChatMessage, Object> next_map, int num_messages) boolean
getBooleanOption
(int opt) getClone()
boolean
boolean
int
private Object
boolean
int
-ve -> state unknown 0 - synced +ve - number of messages pendingboolean
getKey()
boolean
int
getMessageCount
(boolean not_mine) boolean
getName()
getName
(boolean abbreviated) getNickname
(boolean use_default) private boolean
int
-ve -> state unknown 0 - synced +ve - number of messages pendinggetParticipant
(String nick) byte[]
int
boolean
getURL()
getUserData
(Object key) int
void
handleDrop
(String str) boolean
boolean
boolean
boolean
boolean
boolean
boolean
boolean
boolean
boolean
boolean
isManagedFor
(String network, String key) boolean
boolean
boolean
boolean
isReadOnlyFor
(String network, String key) boolean
boolean
private List<BuddyPluginBeta.ChatMessage>
merge
(List<BuddyPluginBeta.ChatMessage> list1, List<BuddyPluginBeta.ChatMessage> list2) void
messageReceived
(Map<String, Object> message_map) private void
registerNick
(BuddyPluginBeta.ChatParticipant p, String old_nick, String new_nick) void
remove()
void
removeListener
(BuddyPluginBeta.ChatListener listener) private BuddyPluginBeta.ChatParticipant
(package private) void
void
sendControlMessage
(String cmd) void
sendLocalMessage
(String message, String[] args, int message_type) void
sendMessage
(Download download) void
sendMessage
(String message, Map<String, Object> options) void
private void
void
void
setAutoMute
(boolean b) void
setAutoNotify
(boolean b) void
setDisableNewMsgIndications
(boolean b) void
setDisplayName
(String str) void
setEnableNotificationsPost
(boolean b) void
setFavourite
(boolean b) void
void
setInstanceNickname
(String _nick) void
setInteresting
(boolean b) void
setKeepAlive
(boolean b) void
setLogMessages
(boolean b) void
void
setSaveMessages
(boolean b) void
setSharedNickname
(boolean _shared) private void
setSpammer
(BuddyPluginBeta.ChatParticipant participant, boolean is_spammer) void
setUserData
(Object key, Object value) void
setViewType
(int t) private void
sortMessages
(boolean force_change) private boolean
private String
trimMagnet
(String magnet, int max) private void
unbind()
private void
update()
private void
updated()
protected void
private void
updateOptions
(Map<String, Object> options)
-
Field Details
-
OPT_INVISIBLE
- See Also:
-
MSG_HISTORY_MAX
private static final int MSG_HISTORY_MAX- See Also:
-
network
-
key
-
is_private_chat
private boolean is_private_chat -
is_invisible_chat
private boolean is_invisible_chat -
private_target
-
binding_lock
-
binding_sem
-
msgsync_pi
-
handler
-
my_public_key
private byte[] my_public_key -
managing_public_key
private byte[] managing_public_key -
read_only
private boolean read_only -
ipc_version
private int ipc_version -
my_address
-
chat_lock
-
message_uid_next
-
messages
-
message_ids
-
messages_not_mine_count
private int messages_not_mine_count -
participants
-
nick_clash_map
-
listeners
-
user_data
-
auto_dup_set
-
keep_alive
private boolean keep_alive -
have_interest
private boolean have_interest -
status
-
instance_nick
-
reference_count
private volatile int reference_count -
virtual_reference_count
private int virtual_reference_count -
last_message_requiring_attention
-
message_outstanding
private boolean message_outstanding -
is_favourite
private boolean is_favourite -
auto_notify
private boolean auto_notify -
save_messages
private boolean save_messages -
log_messages
private boolean log_messages -
auto_mute
private boolean auto_mute -
enable_notification_posts
private boolean enable_notification_posts -
disable_new_msg_indications
private boolean disable_new_msg_indications -
display_name
-
has_been_viewed
private boolean has_been_viewed -
last_bind_fail
-
destroyed
private boolean destroyed -
sort_event
-
sort_force_changed
private boolean sort_force_changed -
dispatcher
AsyncDispatcher dispatcher
-
-
Constructor Details
-
ChatInstance
-
-
Method Details
-
getClone
- Throws:
Exception
-
exportDataSource
- Specified by:
exportDataSource
in interfaceDataSourceResolver.ExportableDataSource
-
getBooleanOption
- Specified by:
getBooleanOption
in interfaceDataSourceResolver.ExportableDataSource
-
addVirtualReference
protected void addVirtualReference() -
addReference
protected void addReference() -
getReferenceCount
public int getReferenceCount() -
getName
-
getName
-
getShortName
-
getNetwork
-
getKey
-
isFavourite
public boolean isFavourite() -
setAutoNotify
public void setAutoNotify(boolean b) -
isAutoNotify
public boolean isAutoNotify() -
isInteresting
public boolean isInteresting() -
setInteresting
public void setInteresting(boolean b) -
isStatistics
public boolean isStatistics() -
setFavourite
public void setFavourite(boolean b) -
setHasBeenViewed
public void setHasBeenViewed() -
getHasBeenViewed
public boolean getHasBeenViewed() -
getSaveMessages
public boolean getSaveMessages() -
setSaveMessages
public void setSaveMessages(boolean b) -
getLogMessages
public boolean getLogMessages() -
setLogMessages
public void setLogMessages(boolean b) -
getAutoMute
public boolean getAutoMute() -
setAutoMute
public void setAutoMute(boolean b) -
getViewType
public int getViewType() -
setViewType
public void setViewType(int t) -
getDisableNewMsgIndications
public boolean getDisableNewMsgIndications() -
setDisableNewMsgIndications
public void setDisableNewMsgIndications(boolean b) -
getEnableNotificationsPost
public boolean getEnableNotificationsPost() -
setEnableNotificationsPost
public void setEnableNotificationsPost(boolean b) -
getDisplayName
-
setDisplayName
-
setSpammer
-
isManaged
public boolean isManaged() -
amManager
public boolean amManager() -
isManagedFor
-
getManagedChannel
- Throws:
Exception
-
isReadOnlyFor
-
getReadOnlyChannel
- Throws:
Exception
-
isReadOnly
public boolean isReadOnly() -
getURL
-
getPublicKey
public byte[] getPublicKey() -
isInvisible
public boolean isInvisible() -
isPrivateChat
public boolean isPrivateChat() -
isAnonymous
public boolean isAnonymous() -
getNetAndKey
-
setKeepAlive
public void setKeepAlive(boolean b) -
getKeepAlive
public boolean getKeepAlive() -
getDefaultNickname
-
getInstanceNickname
-
setInstanceNickname
-
getNickname
-
getHandler
-
bind
- Throws:
Exception
-
checkRebind
private void checkRebind() -
updateOptions
- Throws:
Exception
-
unbind
private void unbind() -
isAvailable
public boolean isAvailable() -
getHistory
-
update
private void update() -
updated
private void updated() -
configChanged
private void configChanged() -
handleDrop
-
getEstimatedNodes
public int getEstimatedNodes() -
getMessageCount
public int getMessageCount(boolean not_mine) -
getIncomingSyncState
public int getIncomingSyncState()-ve -> state unknown 0 - synced +ve - number of messages pending- Returns:
-
getOutgoingSyncState
public int getOutgoingSyncState()-ve -> state unknown 0 - synced +ve - number of messages pending- Returns:
-
isInitialised
public boolean isInitialised() -
getStatus
-
sortMessages
private void sortMessages(boolean force_change) -
sortMessagesSupport
private boolean sortMessagesSupport() -
flattenTree
private List<BuddyPluginBeta.ChatMessage> flattenTree(BuddyPluginBeta.ChatMessage head, Map<BuddyPluginBeta.ChatMessage, Object> next_map, int num_messages) -
merge
private List<BuddyPluginBeta.ChatMessage> merge(List<BuddyPluginBeta.ChatMessage> list1, List<BuddyPluginBeta.ChatMessage> list2) -
messageReceived
- Throws:
IPCException
-
chatRequested
- Throws:
IPCException
-
sendMessage
-
resetIPFilters
void resetIPFilters() -
getMagnet
-
trimMagnet
-
sendMessage
-
sendMessage
-
sendRawMessage
-
sendLocalMessage
-
sendControlMessage
-
sendMessageSupport
-
export
-
getMessages
-
hasUnseenMessageWithNick
public boolean hasUnseenMessageWithNick() -
getUnseenMessages
-
getParticipants
-
getParticipant
-
removeParticipant
-
updated
-
registerNick
-
getOtherNickClashesHidden
-
getLastMessageRequiringAttention
-
setUserData
-
getUserData
-
getMessageOutstanding
public boolean getMessageOutstanding() -
setMessageOutstanding
-
isOldOutstandingMessage
-
fixupSeenState
-
getMyAddress
-
addListener
-
removeListener
-
remove
public void remove() -
isDestroyed
public boolean isDestroyed() -
destroy
public void destroy() -
destroy
private void destroy(boolean force)
-