MessageSender.h 3.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. // _____ _
  2. // |_ _| |_ _ _ ___ ___ _ __ __ _
  3. // | | | ' \| '_/ -_) -_) ' \/ _` |_
  4. // |_| |_||_|_| \___\___|_|_|_\__,_(_)
  5. //
  6. // Threema iOS Client
  7. // Copyright (c) 2014-2020 Threema GmbH
  8. //
  9. // This program is free software: you can redistribute it and/or modify
  10. // it under the terms of the GNU Affero General Public License, version 3,
  11. // as published by the Free Software Foundation.
  12. //
  13. // This program is distributed in the hope that it will be useful,
  14. // but WITHOUT ANY WARRANTY; without even the implied warranty of
  15. // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  16. // GNU Affero General Public License for more details.
  17. //
  18. // You should have received a copy of the GNU Affero General Public License
  19. // along with this program. If not, see <https://www.gnu.org/licenses/>.
  20. #import <Foundation/Foundation.h>
  21. #import <CoreLocation/CoreLocation.h>
  22. #import "AbstractMessage.h"
  23. #import "BaseMessage.h"
  24. #import "BallotMessage.h"
  25. #import "TextMessage.h"
  26. #import "GroupProxy.h"
  27. @class Conversation;
  28. @class Contact;
  29. @interface MessageSender : NSObject
  30. + (void)sendDeliveryReceiptForMessage:(BaseMessage*)message fromIdentity:(NSString*)identity;
  31. + (void)sendDeliveryReceiptForAbstractMessage:(AbstractMessage*)message fromIdentity:(NSString*)identity;
  32. + (void)sendMessage:(NSString*)message inConversation:(Conversation*)conversation async:(BOOL)async quickReply:(BOOL)quickReply requestId:(NSString *)requestId onCompletion:(void(^)(TextMessage *message, Conversation *conv))onCompletion;
  33. + (void)sendLocation:(CLLocationCoordinate2D)coordinates accuracy:(CLLocationAccuracy)accuracy poiName:(NSString*)poiName poiAddress:(NSString*)poiAddress inConversation:(Conversation*)conversation onCompletion:(void(^)(NSData *messageId))onCompletion;
  34. + (void)markMessageAsSent:(NSData*)messageId;
  35. + (void)sendReadReceiptForMessages:(NSArray*)messages toIdentity:(NSString*)identity async:(BOOL)async quickReply:(BOOL)quickReply;
  36. + (void)sendUserAckForMessages:(NSArray*)messages toIdentity:(NSString*)identity async:(BOOL)async quickReply:(BOOL)quickReply;
  37. + (void)sendUserDeclineForMessages:(NSArray*)messages toIdentity:(NSString*)identity async:(BOOL)async quickReply:(BOOL)quickReply;
  38. + (void)sendTypingIndicatorMessage:(BOOL)typing toIdentity:(NSString*)identity;
  39. + (void)sendGroupCreateMessageForGroup:(GroupProxy*)group toMember:(Contact*)toMember;
  40. + (void)sendGroupSharedMessagesForConversation:(Conversation*)groupConversation toMember:(Contact *)newMember;
  41. + (void)sendGroupRenameMessageForConversation:(Conversation*)groupConversation addSystemMessage:(BOOL)addSystemMessage;
  42. + (void)sendGroupRenameMessageForConversation:(Conversation *)groupConversation toMember:(Contact*)member addSystemMessage:(BOOL)addSystemMessage;
  43. + (void)sendGroupLeaveMessageForConversation:(Conversation*)groupConversation;
  44. + (void)sendGroupLeaveMessageForCreator:(NSString*)creator groupId:(NSData*)groupId toIdentity:(NSString*)toIdentity;
  45. + (void)sendGroupRequestSyncMessageForCreatorContact:(Contact*)creatorContact groupId:(NSData*)groupId;
  46. + (void)markBlobAsDone:(NSData *)blobId;
  47. + (void)sendCreateMessageForBallot:(Ballot *)ballot;
  48. + (void)sendBallotVoteMessage:(Ballot *)ballot;
  49. @end