qTox  Version: nightly | Commit: bc751c8e1cac455f9690654fcfe0f560d2d7dfdd
Public Member Functions | Private Attributes | List of all members
AvatarBroadcaster Class Reference

#include <avatarbroadcaster.h>

Inheritance diagram for AvatarBroadcaster:
Inheritance graph
Collaboration diagram for AvatarBroadcaster:
Collaboration graph

Public Member Functions

 AvatarBroadcaster (Core &_core)
 
void setAvatar (QByteArray data)
 Set our current avatar. More...
 
void sendAvatarTo (uint32_t friendId)
 Send our current avatar to this friend, if not already sent. More...
 
void enableAutoBroadcast (bool state=true)
 Setup auto broadcast sending avatar. More...
 

Private Attributes

Corecore
 
QByteArray avatarData
 
QMap< uint32_t, bool > friendsSentTo
 

Detailed Description

Takes care of broadcasting avatar changes to our friends in a smart way Cache a copy of our current avatar and friends who have received it so we don't spam avatar transfers to a friend who already has it.

Definition at line 28 of file avatarbroadcaster.h.

Constructor & Destructor Documentation

◆ AvatarBroadcaster()

AvatarBroadcaster::AvatarBroadcaster ( Core _core)

Definition at line 36 of file avatarbroadcaster.cpp.

Member Function Documentation

◆ enableAutoBroadcast()

void AvatarBroadcaster::enableAutoBroadcast ( bool  state = true)

Setup auto broadcast sending avatar.

Parameters
stateIf true, we automatically broadcast our avatar to friends when they come online.

Definition at line 82 of file avatarbroadcaster.cpp.

◆ sendAvatarTo()

void AvatarBroadcaster::sendAvatarTo ( uint32_t  friendId)

Send our current avatar to this friend, if not already sent.

Parameters
friendIdId of friend to send avatar.

Definition at line 63 of file avatarbroadcaster.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ setAvatar()

void AvatarBroadcaster::setAvatar ( QByteArray  data)

Set our current avatar.

Parameters
dataByte array on avater.

Definition at line 44 of file avatarbroadcaster.cpp.

Here is the call graph for this function:

Member Data Documentation

◆ avatarData

QByteArray AvatarBroadcaster::avatarData
private

Definition at line 40 of file avatarbroadcaster.h.

◆ core

Core& AvatarBroadcaster::core
private

Definition at line 39 of file avatarbroadcaster.h.

◆ friendsSentTo

QMap<uint32_t, bool> AvatarBroadcaster::friendsSentTo
private

Definition at line 41 of file avatarbroadcaster.h.


The documentation for this class was generated from the following files: