From 73daa738876a0beb9957d30e02aadbefd590bc78 Mon Sep 17 00:00:00 2001 From: Zev Benjamin Date: Wed, 7 Nov 2012 18:38:21 -0500 Subject: [PATCH] Unify huddles and personals into private messages on the send path Personals are now just private messages between two people (which sometimes manifests as a private message with one recipient). The new message type on the send path is 'private'. Note that the receive path still has 'personal' and 'huddle' message types. (imported from commit 97a438ef5c0b3db4eb3e6db674ea38a081265dd3) --- bots/check-mirroring | 2 +- bots/gcal-bot | 2 +- bots/zephyr_mirror.py | 6 +++--- examples/curl-examples | 2 +- examples/send-message | 2 +- 5 files changed, 7 insertions(+), 7 deletions(-) diff --git a/bots/check-mirroring b/bots/check-mirroring index bc8bd94..12eeaf4 100755 --- a/bots/check-mirroring +++ b/bots/check-mirroring @@ -57,7 +57,7 @@ if child_pid == 0: # Run the humbug => zephyr mirror in the child time.sleep(3) humbug_client.send_message({ - "type": "personal", + "type": "private", "content": str(hzkey1), "recipient": humbug_user, }); diff --git a/bots/gcal-bot b/bots/gcal-bot index 91b4c13..0f2fd77 100755 --- a/bots/gcal-bot +++ b/bots/gcal-bot @@ -128,7 +128,7 @@ def send_reminders(): message = 'Reminder:\n\n' + '\n'.join('* ' + m for m in messages) humbug.send_message(dict( - type = 'personal', + type = 'private', recipient = options.user, content = message)) diff --git a/bots/zephyr_mirror.py b/bots/zephyr_mirror.py index 6a3c37c..cf34f0d 100755 --- a/bots/zephyr_mirror.py +++ b/bots/zephyr_mirror.py @@ -247,10 +247,10 @@ def process_notice(notice, log): 'zsig' : zsig, # logged here but not used by app 'content' : body } if is_huddle: - zeph['type'] = 'personal' + zeph['type'] = 'private' zeph['recipient'] = huddle_recipients elif is_personal: - zeph['type'] = 'personal' + zeph['type'] = 'private' zeph['recipient'] = to_humbug_username(notice.recipient) else: zeph['type'] = 'stream' @@ -261,7 +261,7 @@ def process_notice(notice, log): zeph["subject"] = '(instance "%s")' % (notice.instance,) # Add instances in for instanced personals - if zeph['type'] == "personal" and notice.instance.lower() != "personal": + if zeph['type'] == "private" and notice.instance.lower() != "personal": zeph["content"] = "[-i %s]" % (notice.instance,) + "\n" + zeph["content"] zeph = decode_unicode_byte_strings(zeph) diff --git a/examples/curl-examples b/examples/curl-examples index aa74fd5..3bf35f3 100755 --- a/examples/curl-examples +++ b/examples/curl-examples @@ -4,7 +4,7 @@ curl https://humbughq.com/api/v1/send_message \ -d "api-key=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" \ -d "email=tabbott@humbughq.com" \ - -d "type=personal" -d "content=test" \ + -d "type=private" -d "content=test" \ -d "recipient=tabbott@humbughq.com" curl https://humbughq.com/api/v1/get_messages \ diff --git a/examples/send-message b/examples/send-message index 9c4e60f..ee1945b 100755 --- a/examples/send-message +++ b/examples/send-message @@ -31,7 +31,7 @@ client = api.common.HumbugAPI(email=options.user, site=options.site) message_data = { - "type": "personal", + "type": "private", "content": "test", "recipient": "tabbott@humbughq.com", }