Commit 28974d04 authored by Evren Kutar's avatar Evren Kutar

messaging +

parent e0dff2b0
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
<div class="side-navigation"> <div class="side-navigation">
<ul class="channels"> <ul class="channels">
<li class="title">CHANNELS <span class="badge">8</span></li> <li class="title">CHANNELS <span class="badge">{{ }}</span></li>
<li class="notification">Channel One</li> <li class="notification">Channel One</li>
</ul> </ul>
...@@ -16,7 +16,7 @@ ...@@ -16,7 +16,7 @@
<ul class="direct-messages"> <ul class="direct-messages">
<li class="compose"><span class="glyphicon glyphicon-plus-sign"></span> Create New Message</li> <li class="compose"><span class="glyphicon glyphicon-plus-sign"></span> Create New Message</li>
<li class="title">DIRECT MESSAGES <span class="badge">14</span></li> <li class="title">DIRECT MESSAGES <span class="badge">14</span></li>
<li class="online active notification">Erkan Öğümsöğütlü</li> <li class="online" ng-class="{'active':'active', 'notification': 'notification'}">Erkan Öğümsöğütlü</li>
</ul> </ul>
</div> </div>
......
...@@ -15,7 +15,7 @@ angular.module('ulakbus.messagingService', ['ui.bootstrap']) ...@@ -15,7 +15,7 @@ angular.module('ulakbus.messagingService', ['ui.bootstrap'])
* @name Generator * @name Generator
* @description form service's Generator factory service handles all generic form operations * @description form service's Generator factory service handles all generic form operations
*/ */
.factory('MessagingService', function ($q, $timeout, $sce, $location, $route, $compile, $log, RESTURL, $rootScope, Moment, WSOps, FormConstraints, $uibModal) { .factory('MessagingService', function ($q, $timeout, $sce, $location, $route, $compile, $log, $rootScope, Moment, WSOps) {
var msg = {}; var msg = {};
msg.send = function (msg) { msg.send = function (msg) {
/** /**
...@@ -24,9 +24,6 @@ angular.module('ulakbus.messagingService', ['ui.bootstrap']) ...@@ -24,9 +24,6 @@ angular.module('ulakbus.messagingService', ['ui.bootstrap'])
* MSG_TYPES can be follwing; * MSG_TYPES can be follwing;
* *
* MSG_TYPES = ( * MSG_TYPES = (
* (1, "Info Notification"),
* (11, "Error Notification"),
* (111, "Success Notification"),
* (2, "Direct Message"), * (2, "Direct Message"),
* (3, "Broadcast Message"), * (3, "Broadcast Message"),
* (4, "Channel Message") * (4, "Channel Message")
...@@ -87,6 +84,29 @@ angular.module('ulakbus.messagingService', ['ui.bootstrap']) ...@@ -87,6 +84,29 @@ angular.module('ulakbus.messagingService', ['ui.bootstrap'])
*/ */
}; };
msg.update = function (msg, action) {
/**
* update / delete a message here
*/
var outgoing = {
form_params: {
view: '_zops_' + action + '_message',
message: {
'channel': msg.channel, // this can be both channel and direct msg. remember direct msg is channel
'receiver': msg.receiver,
'client_id': msg.client_id, // "Client side unique id for referencing this message",
'title': msg.title, // "Title of the message. Can be blank.",
'body': msg.body, // "Message body.",
'type': msg.TYPE // type can be one of the above
}
}
};
return WSOps.request(outgoing).then(function (data) {
$log.debug("update request sent");
return data;
})
};
/** /**
* use this method to get all messages of channel and direct messages * use this method to get all messages of channel and direct messages
* REMEMBER; direct messages are also channels, everything is channel on backend! * REMEMBER; direct messages are also channels, everything is channel on backend!
...@@ -137,7 +157,5 @@ angular.module('ulakbus.messagingService', ['ui.bootstrap']) ...@@ -137,7 +157,5 @@ angular.module('ulakbus.messagingService', ['ui.bootstrap'])
return data; return data;
}); });
}; };
msg.channels = [];
return msg; return msg;
}); });
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment