Question

Google Wave allows two or more participants to speak privately within a wave. When my robot is added to the wave, I recognize the WAVELET_SELF_ADDED event and call the method below. However, nothing happens.

I can tell that the code is executed because of the Debug and Info statements in the logs. Is there any reason why the robot does not start a private blip when it's added?

def start_private_wavelet(properties, context):
    """Start a private conversation between the robot and some participants."""
    participants = []
    participants.append('my-username@googlewave.com')
    participants.append('my-robot@appspot.com')

    logging.debug('Getting wave info')

    root_wavelet = context.GetRootWavelet()
    root_wave_id = root_wavelet.GetWaveId()
    root_wave = context.GetWaveById(root_wave_id)

    logging.debug('Creating private wave in %s' % root_wave_id)

    private_wavelet = root_wave.CreateWavelet(participants)
    message = private_wavelet.CreateBlip()
    message.GetDocument().SetText("This is a private conversation...")

    logging.debug('Private wave created')
Was it helpful?

Solution

A private conversion is created through a Wavelet.

So, using the Python API, I think you're looking for OpBasedWave.CreateWavelet.

participants = []
participants.append('other-user@googlewave.com')
participants.append('self-robot@appspot.com') # Remember to add your robot!

private_wavelet = root_wave.CreateWavelet(participants)
message = private_wavelet.CreateBlip()
message.GetDocument().SetText("Hi there, this is just a secret!")
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top