Classified ads
|
This class produces items sent to peers over network. More...
#include <protocol_message_formatter.h>
Static Public Member Functions | |
static QByteArray | nodeGreeting (const Node &aNode) |
static QByteArray | randomNumbers (void) |
static QByteArray | requestForNodesAroundHash (const Hash &aHash) |
static QByteArray | requestForBinaryBlob (const Hash &aHash) |
static QByteArray | requestForUserProfile (const Hash &aHash) |
static QByteArray | requestForUserProfileComment (const Hash &aIndividualCommentHash) |
static QByteArray | requestForClassifiedAd (const Hash &aHash) |
static QByteArray | requestForPrivateMessages (const Hash &aMessageHash) |
static QByteArray | requestForPrivateMessagesForProfile (const Hash &aProfileHash, const quint32 aTimeOfOldestMsgToSend) |
static QByteArray | requestForProfileComments (const Hash &aCommentedProfileHash, const quint32 aTimeOfOldestMsgToSend) |
static QByteArray | requestForAdsClassified (const Hash &aHashOfClassification, const quint32 aStartingTimestamp, const quint32 aEndingTimestamp) |
static QByteArray | contentPublish (const unsigned char aContentMagicNumber, const Hash &aContentHash, const QByteArray &aContent, const QByteArray &aSignature, const QList< quint32 > &aBangPath, const QByteArray &aSigningKey, bool aIsContentEncrypted, bool aIsContentCompressed, quint32 aTimeStamp) |
static QByteArray | privMsgPublish (const Hash &aContentHash, const QByteArray &aContent, const QByteArray &aSignature, const QList< quint32 > &aBangPath, const Hash &aDestination, const Hash &aRecipient, quint32 aTimeStamp) |
static QByteArray | privMsgSend (const Hash &aContentHash, const QByteArray &aContent, const QByteArray &aSignature, const Hash &aDestination, const Hash &aRecipient, quint32 aTimeStamp) |
static QByteArray | profileCommentPublish (const Hash &aContentHash, const QByteArray &aContent, const QByteArray &aSignature, const QList< quint32 > &aBangPath, const Hash &aProfileCommented, quint32 aTimeStamp, quint32 aFlags) |
static QByteArray | profileCommentSend (const Hash &aContentHash, const QByteArray &aContent, const QByteArray &aSignature, const Hash &aProfileCommented, quint32 aTimeStamp, quint32 aFlags) |
static QByteArray | contentSend (const unsigned char aContentMagicNumber, const Hash &aContentHash, const QByteArray &aContent, const QByteArray &aSignature, const QByteArray &aSigningKey, bool aIsContentEncrypted, bool aIsContentCompressed, quint32 aTimeStamp) |
static QByteArray | replyToAdsClassified (const Hash &aClassificationHash, const QList< QPair< Hash, quint32 > > &aListOfAds) |
static QByteArray | searchSend (const QString &aSearch, bool aSearchAds, bool aSearchProfiles, bool aSearchComments, const Hash &aSearchIdentifier) |
static QByteArray | searchResultsSend (const QList< SearchModel::SearchResultItem > &aResults, quint32 aSearchId) |
Static Private Member Functions | |
static QByteArray | doContentSendOrPublish (QByteArray &retval, const unsigned char aContentMagicNumber, const Hash &aContentHash, const QByteArray &aContent, const QByteArray &aSignature, const QList< quint32 > &aBangPath, const QByteArray &aSigningKey, bool aIsContentEncrypted, bool aIsContentCompressed, quint32 aTimeStamp, bool aIsPublish) |
static QByteArray | doCommentSendOrPublish (const Hash &aContentHash, const QByteArray &aContent, const QByteArray &aSignature, const QList< quint32 > &aBangPath, const Hash &aProfileCommented, quint32 aTimeStamp, quint32 aFlags, bool aIsPublish) |
This class produces items sent to peers over network.
Class that contains (static) methods for producing byte-streams of various messages.
|
static |
method for producing byte-array containing (some) published content
aContentMagicNumber | tells what kind of item this is. For example KProfilePublish (from protocol.h) if we're publishing a profile here |
aContentHash | hash of the content to be published. Reason this Hash here is given explicitly is that different object types have different hashing methods - for binary blob it is the content itself that makes the hash but for profile it is the fingerprint of the signing key etc. |
aContent | actual content |
aSignature | signature verifying aContent |
aBangPath | list of low-order bits of hosts where this content has already been seen, 5 at max |
aSigningKey | contains public encryption key used to sign the content ; while it over time will be mostly overhead it anyway allows reader to reach the poster that is great advantage over some overhead.. |
aIsContentEncrypted | is true of aContent is protected with encryption |
aIsContentCompressed | is true of aContent is inside qCompress. if both compress+encryption, naturally the content is first compressed, only after that encrypted |
aTimeStamp | may be given for content where actual timestamp is inside encryption |
|
static |
this is almost same as .contentPublish but is reply to another node regarding request of content, not users own publishing so this has no bangpath but otherwise this behaves in about same way.
|
staticprivate |
workhorse of .profileCommentPublish and .profileCommentSend has parameter telling which action to take
|
staticprivate |
workhorse of .contentPublish and .contentSend has parameter telling which action to take
|
static |
method for producing node greeting message
aNode | is greeting about the node concerned, usually "this" node |
|
static |
separate publish-formatter for private messages as they're quite different from rest of the content
|
static |
separate send-formatter for private messages as they're quite different from rest of the content. Similar to publish but no bangpath
|
static |
separate publish-formatter for profile comments as they're quite different from rest of the content. in case of comments for public profiles they behave a bit like classified ads but comments commenting private profiles need to behave more-or-less like private messages as that's what they are ; private messages with more than 1 recipient .. or it is possible to have private profile with 0 readers and then comment it self. monologue ensues.
|
static |
separate send-formatter for profile comment as they're quite different from rest of the content.
|
static |
method for producing random number message
|
static |
|
static |
Classified ads have classification, the "intent-object-location" triplet shown in UI and it also has a hash. When user chooses this triplet, it might be nice to query surrounding nodes about classified ads regarding that triplet. This method is for sending such a request. Its response will contain hashes of the ads in that classification, possibly followed by the articles too.
aHashOfClassification | hash calculated over "intent-object-location" string |
aStartingTimestamp | possible starting timestamp for the articles. Currently not implemented in protocol, sender will limit the number of ads it sends |
aEndingTimestamp | possible ending timestamp for the articles Currently not implemented in protocol, sender will limit the number of ads it sends |
|
static |
method for producing binary blob request message
|
static |
method for producing operator classified ad request message
|
static |
method for producing nodegreeting request message
|
static |
method for sending request to other nodes regarding private messages having given hash
aProfileHash | hash of message that is to be found |
|
static |
method for sending request to other nodes regarding private messages destined to given profile
aProfileHash | hash of profile whose messages are searched |
aTimeOfOldesMsgToSend | since when to send msgs from |
|
static |
method for sending request to other nodes regarding comments about specified profile. in practice parser (upon receipt) will make calls that check not only for new comments, but also if there has been an update at the profile itself. Call to this method is result of RequestForProfilePoll being put into network request queue.
aCommentedProfileHash | hash of profile whose comments are searched |
aTimeOfOldesMsgToSend | since when to send comments from |
|
static |
method for producing operator profile request message
|
static |
method for producing message to other node that asks it to send an individual profile comment
|
static |
method for formatting a network search results
|
static |
method for formatting a network search query