0

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')
Matt Norris
  • 8,596
  • 14
  • 59
  • 90
  • I can't find a problem with it. Perhaps try posting the `Outgoing:` operations (from your logs) or trying the Google Wave API group: http://groups.google.com/group/google-wave-api – Brian McKenna Jan 13 '10 at 02:22
  • Have you seen this working? I just searched the forum and found a post suggesting that private replies cannot be made through the API: http://bit.ly/7bSMFy – Matt Norris Jan 14 '10 at 03:18
  • 1
    A Google employee confirmed that this is not possible yet, but will be coming soon. See the bit.ly link above to track. Thank you again, Brian, for all of your help. – Matt Norris Jan 17 '10 at 00:45

1 Answers1

2

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!")
Brian McKenna
  • 45,528
  • 6
  • 61
  • 60
  • Thank you for the response. However, I can't quite get this to work. I thought I needed to add the line "root_wave = context.GetRootWavelet()" to your code, but that didn't work either. Perhaps creating a wavelet privately only works with certain events? – Matt Norris Jan 12 '10 at 03:14
  • 1
    With `context.GetRootWavelet()` you're getting the root __Wavelet__. Now that you have the root Wavelet you can find the root __Wave__ via `root_wave_id = root_wavelet.GetWaveId()` and `root_wave = context.GetWaveById(root_wave_id)`. You can find more information about Wave entities here: http://code.google.com/apis/wave/guide.html#WaveEntities – Brian McKenna Jan 12 '10 at 03:48
  • I've incorporated your feedback into the question, but the blip is still not created. Is there anything I'm missing? – Matt Norris Jan 13 '10 at 01:03
  • I haven't gotten this working yet, but I wanted to accept because this is a great start. Once I find out about the limitations for private replies I will post. – Matt Norris Jan 15 '10 at 00:33