llinstantmessage.h 5.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182
  1. /**
  2. * @file llinstantmessage.h
  3. * @brief Constants and declarations used by instant messages.
  4. *
  5. * $LicenseInfo:firstyear=2002&license=viewergpl$
  6. *
  7. * Copyright (c) 2002-2009, Linden Research, Inc.
  8. *
  9. * Second Life Viewer Source Code
  10. * The source code in this file ("Source Code") is provided by Linden Lab
  11. * to you under the terms of the GNU General Public License, version 2.0
  12. * ("GPL"), unless you have obtained a separate licensing agreement
  13. * ("Other License"), formally executed by you and Linden Lab. Terms of
  14. * the GPL can be found in doc/GPL-license.txt in this distribution, or
  15. * online at http://secondlifegrid.net/programs/open_source/licensing/gplv2
  16. *
  17. * There are special exceptions to the terms and conditions of the GPL as
  18. * it is applied to this Source Code. View the full text of the exception
  19. * in the file doc/FLOSS-exception.txt in this software distribution, or
  20. * online at
  21. * http://secondlifegrid.net/programs/open_source/licensing/flossexception
  22. *
  23. * By copying, modifying or distributing this software, you acknowledge
  24. * that you have read and understood your obligations described above,
  25. * and agree to abide by those obligations.
  26. *
  27. * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO
  28. * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY,
  29. * COMPLETENESS OR PERFORMANCE.
  30. * $/LicenseInfo$
  31. */
  32. #ifndef LL_LLINSTANTMESSAGE_H
  33. #define LL_LLINSTANTMESSAGE_H
  34. #include <string>
  35. #include "lluuid.h"
  36. #include "llvector3.h"
  37. // The ImprovedInstantMessage only supports 8 bits in the "Dialog" field, so do
  38. // not go past the byte boundary
  39. enum EInstantMessage
  40. {
  41. // Default. ID is meaningless, nothing in the binary bucket.
  42. IM_NOTHING_SPECIAL = 0,
  43. // Pops up a messagebox with a single OK button
  44. IM_MESSAGEBOX = 1,
  45. // Pops up a countdown messagebox with a single OK button
  46. // IM_MESSAGEBOX_COUNTDOWN = 2,
  47. // You have been invited to join a group. ID is the group id. The binary
  48. // bucket contains a null terminated string representation of the officer
  49. // or member status and join cost for the invitee. The format is 1 byte for
  50. // officer/member (O for officer, M for member), and as many bytes as
  51. // necessary for cost.
  52. IM_GROUP_INVITATION = 3,
  53. // Inventory offer. ID is the transaction id. Binary bucket is a list of
  54. // inventory uuid and type.
  55. IM_INVENTORY_OFFERED = 4,
  56. IM_INVENTORY_ACCEPTED = 5,
  57. IM_INVENTORY_DECLINED = 6,
  58. // Group vote - DEPRECATED as part of vote removal - DEV-24856
  59. IM_GROUP_VOTE = 7,
  60. // Group message. This means that the message is meant for everyone in the
  61. // agent's group. This will result in a database query to find all
  62. // participants and start an im session.
  63. IM_GROUP_MESSAGE_DEPRECATED = 8,
  64. // Task inventory offer. ID is the transaction id. Binary bucket is a
  65. // (mostly) complete packed inventory item.
  66. IM_TASK_INVENTORY_OFFERED = 9,
  67. IM_TASK_INVENTORY_ACCEPTED = 10,
  68. IM_TASK_INVENTORY_DECLINED = 11,
  69. // Copied as pending, type LL_NOTHING_SPECIAL, for new users used by
  70. // offline tools
  71. IM_NEW_USER_DEFAULT = 12,
  72. //
  73. // Session based messaging - the way that people usually actually
  74. // communicate with each other.
  75. //
  76. // Invite users to a session.
  77. IM_SESSION_INVITE = 13,
  78. IM_SESSION_P2P_INVITE = 14,
  79. // Start a session with your group
  80. IM_SESSION_GROUP_START = 15,
  81. // Start a session without a calling card (finder or objects)
  82. IM_SESSION_CONFERENCE_START = 16,
  83. // Send a message to a session.
  84. IM_SESSION_SEND = 17,
  85. // Leave a session
  86. IM_SESSION_LEAVE = 18,
  87. // An instant message from an object - for differentiation on the viewer,
  88. // since you can't IM an object yet.
  89. IM_FROM_TASK = 19,
  90. // Sent an IM to a busy user, this is the auto response
  91. IM_BUSY_AUTO_RESPONSE = 20,
  92. // Shows the message in the console and chat history
  93. IM_CONSOLE_AND_CHAT_HISTORY = 21,
  94. // IM Types used for luring your friends
  95. IM_LURE_USER = 22,
  96. IM_LURE_ACCEPTED = 23,
  97. IM_LURE_DECLINED = 24,
  98. IM_GODLIKE_LURE_USER = 25,
  99. IM_TELEPORT_REQUEST = 26,
  100. // IM that notifie of a new group election - DEPRECATED
  101. IM_GROUP_ELECTION_DEPRECATED = 27,
  102. // IM to tell the user to go to an URL. Put a text message in the message
  103. // field, and put the url with a trailing \0 in the binary bucket.
  104. IM_GOTO_URL = 28,
  105. // A message generated by a script which we do not want to be sent through
  106. // e-mail. Similar to IM_FROM_TASK, but it is shown as an alert on the
  107. // viewer.
  108. IM_FROM_TASK_AS_ALERT = 31,
  109. // IM from group officer to all group members.
  110. IM_GROUP_NOTICE = 32,
  111. IM_GROUP_NOTICE_INVENTORY_ACCEPTED = 33,
  112. IM_GROUP_NOTICE_INVENTORY_DECLINED = 34,
  113. IM_GROUP_INVITATION_ACCEPT = 35,
  114. IM_GROUP_INVITATION_DECLINE = 36,
  115. IM_GROUP_NOTICE_REQUESTED = 37,
  116. IM_FRIENDSHIP_OFFERED = 38,
  117. IM_FRIENDSHIP_ACCEPTED = 39,
  118. IM_FRIENDSHIP_DECLINED_DEPRECATED = 40,
  119. IM_TYPING_START = 41,
  120. IM_TYPING_STOP = 42,
  121. IM_COUNT
  122. };
  123. constexpr U8 IM_ONLINE = 0;
  124. constexpr U8 IM_OFFLINE = 1;
  125. constexpr U32 NO_TIMESTAMP = 0;
  126. constexpr S32 EMPTY_BINARY_BUCKET_SIZE = 1;
  127. extern const char EMPTY_BINARY_BUCKET[];
  128. extern const std::string SYSTEM_FROM;
  129. extern const std::string INCOMING_IM;
  130. extern const std::string INTERACTIVE_SYSTEM_FROM;
  131. void pack_instant_message(const LLUUID& from_id, bool from_group,
  132. const LLUUID& session_id, const LLUUID& to_id,
  133. const std::string& name, const std::string& message,
  134. U8 offline = IM_ONLINE,
  135. EInstantMessage dialog = IM_NOTHING_SPECIAL,
  136. const LLUUID& id = LLUUID::null,
  137. U32 parent_estate_id = 0,
  138. const LLUUID& region_id = LLUUID::null,
  139. const LLVector3& position = LLVector3::zero,
  140. U32 timestamp = NO_TIMESTAMP,
  141. const U8* binary_bucket = (U8*)EMPTY_BINARY_BUCKET,
  142. S32 binary_bucket_size = EMPTY_BINARY_BUCKET_SIZE);
  143. // For debugging purposes. HB
  144. std::string im_status_to_string(EInstantMessage status);
  145. #endif // LL_LLINSTANTMESSAGE_H